Skip to content

modernizr-scrumw 1.0.0

Install from the command line:
Learn more about npm packages
$ npm install @u-next/modernizr-scrumw@1.0.0
Install via package.json:
"@u-next/modernizr-scrumw": "1.0.0"

About this version

modernizr-scrumw

Modernizr-scrumw is a JavaScript library for scrumw team which provides feature detection for HTML5, CSS3, JavaScript, and browser-common functionalities. These tests help us create adaptable web experiences by identifying supported features in users' devices. Its original version comes from https://modernizr.com/docs/.

Why Did We Refactor Modernizer

Initially, we want to generate a report using Modernizr tests. However, we encounter the following challenges:

  1. Modernizr's support for ES modules is limited. we can't use it directely in webpack 5. For further details, see the discussion on Modernizr GitHub issue #2012.
  2. There is a necessity to add or modify tests as our own requirements.
  3. Modernizr tests execute immediately after import rather than on demand, affecting our startup speed.
  4. Some web features have already been removed from the relevant web standards, but are still retained in Modernizr.

Hence, we have developed this customized version!

How to use it

npm install @u-next/modernizr-scrumw

  1. normal test
import aDownload from '@u-next/modernizr-scrumw/feature/html/a/download';

console.log(aDownload()); // Are a download supported?
  1. Async tests
import flash from 'modernizr-esm/feature/browserCommon/flash';

flash(( support ) => {
	console.log(support); // Is Flash supported?
});
  • Each test can be imported and used separately.
  • Tests return multiple named exports if they test multiple features.
  • Async tests support Promises as a result.
  • No global modifications, such as setting classes on the html element.
  • Ignores browser globals when imported directly in an SSR environment.

How to check the tests we have currently

https://github.com/u-next/modernizr-scrumw/blob/master/TESTS.md

How to publish a new package

npm version [patch | minor | major]

npm run release

Related Repositories

This repository is used to manage web features referenced in TVH.

https://github.com/u-next/web-feature-detection

Details


Assets

  • modernizr-scrumw-1.0.0.tgz

Download activity

  • Total downloads 5,002
  • Last 30 days 529
  • Last week 153
  • Today 0