diff --git a/.modernizrrc.js b/.modernizrrc.js deleted file mode 100644 index f94dd21c9..000000000 --- a/.modernizrrc.js +++ /dev/null @@ -1,99 +0,0 @@ -module.exports = { - "classPrefix": "", - "enableClasses": true, - "enableJSClass": true, - "options": ["setClasses"], - "feature-detects": [ - "a/download", - "css/all", - "css/animations", - "css/appearance", - "css/backdropfilter", - "css/backgroundblendmode", - "css/backgroundcliptext", - "css/backgroundposition-shorthand", - "css/backgroundposition-xy", - "css/backgroundrepeat", - "css/backgroundsize", - "css/backgroundsizecover", - "css/borderimage", - "css/borderradius", - "css/boxshadow", - "css/boxsizing", - "css/calc", - "css/checked", - "css/chunit", - "css/columns", - "css/cssgrid", - "css/cubicbezierrange", - "css/displayrunin", - "css/displaytable", - "css/ellipsis", - "css/escape", - "css/exunit", - "css/filters", - "css/flexbox", - "css/flexboxlegacy", - "css/flexboxtweener", - "css/flexwrap", - "css/fontface", - "css/generatedcontent", - "css/gradients", - "css/hairline", - "css/hsla", - "css/invalid", - "css/lastchild", - "css/mask", - "css/mediaqueries", - "css/multiplebgs", - "css/nthchild", - "css/objectfit", - "css/opacity", - "css/overflow-scrolling", - "css/pointerevents", - "css/positionsticky", - "css/pseudoanimations", - "css/pseudotransitions", - "css/reflections", - "css/regions", - "css/remunit", - "css/resize", - "css/rgba", - "css/scrollbars", - "css/scrollsnappoints", - "css/shapes", - "css/siblinggeneral", - "css/subpixelfont", - "css/supports", - "css/target", - "css/textalignlast", - "css/textshadow", - "css/transforms", - "css/transformslevel2", - "css/transforms3d", - "css/transformstylepreserve3d", - "css/transitions", - "css/userselect", - "css/valid", - "css/vhunit", - "css/vmaxunit", - "css/vminunit", - "css/vwunit", - "css/will-change", - "css/wrapflow", - "event/deviceorientation-motion", - "exif-orientation", - "forms/capture", - "forms/fileinput", - "forms/validation", - "inputtypes", - "fullscreen-api", - "hiddenscroll", - "mediaquery/hovermq", - "mediaquery/pointermq", - "touchevents", - "vibration", - "video/autoplay", - "video/loop", - ], -}; diff --git a/README.md b/README.md index 0a5f92068..4e8a38ffe 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,6 @@ global settings or access otherwise hidden objects. | window.\_\_patternslib_registry_initializing | True, while the registry waits for Module Federation remotes before the initial scan. | undefined | | window.\_\_patternslib_mf_initialized | Promise provided by the Module Federation helper of `@patternslib/dev`, resolved once all remote bundles are initialized. The registry waits for it before the initial scan. | undefined | | window.\_\_patternslib_mf_init_timeout | Maximum time in milliseconds the registry waits for Module Federation remotes before scanning anyway. | 5000 | -| window.\_\_patternslib_disable_modernizr (Deprecated) | Disable modernizr, but still write the js/no-js classes to the body. | undefined | ### Bundle build analyzation diff --git a/package.json b/package.json index 1c5af85c3..966a48954 100644 --- a/package.json +++ b/package.json @@ -43,9 +43,7 @@ "@patternslib/pat-sortable-table": "^3.1.0", "@patternslib/pat-tiptap": "^4.11.0", "@patternslib/pat-upload": "^3.1.1", - "copy-webpack-plugin": "^14.0.0", "css.escape": "^1.5.1", - "modernizr": "^3.13.1", "pegjs": "0.11.0-master.b7b87ea" }, "resolutions": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1ecd915b4..0e9e4ba8f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -215,15 +215,9 @@ importers: '@patternslib/pat-upload': specifier: ^3.1.1 version: 3.1.1 - copy-webpack-plugin: - specifier: ^14.0.0 - version: 14.0.0(webpack@5.111.1) css.escape: specifier: ^1.5.1 version: 1.5.1 - modernizr: - specifier: ^3.13.1 - version: 3.13.1 pegjs: specifier: 0.11.0-master.b7b87ea version: 0.11.0-master.b7b87ea @@ -2745,9 +2739,6 @@ packages: cliui@5.0.0: resolution: {integrity: sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==} - cliui@6.0.0: - resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} - cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -2894,12 +2885,6 @@ packages: resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==} engines: {node: '>= 0.6'} - copy-webpack-plugin@14.0.0: - resolution: {integrity: sha512-3JLW90aBGeaTLpM7mYQKpnVdgsUZRExY55giiZgLuX/xTQRUs1dOCwbBnWnvY6Q6rfZoXMNwzOQJCSZPppfqXA==} - engines: {node: '>= 20.9.0'} - peerDependencies: - webpack: ^5.1.0 - core-js-compat@3.50.0: resolution: {integrity: sha512-XGpFGbMLHwSt74YLTKho7Ib242qi6O8MSX+sRokV4oz7iKXvQWGYZthjIhjRGMxjzVkAubBO512dKGYcefmX3Q==} engines: {node: '>=6.4.0'} @@ -3118,10 +3103,6 @@ packages: resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} engines: {node: '>=8.6'} - entities@3.0.1: - resolution: {integrity: sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==} - engines: {node: '>=0.12'} - entities@4.5.0: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} @@ -3320,9 +3301,6 @@ packages: file-entry-cache@11.1.5: resolution: {integrity: sha512-+PFTHITI08JIGhnNpGNI8T8inUpgZfk3GNEqfT9R2zZV2iFXg3CvqzSl/uEhs7TSGujYRELEANyDvS8Fj7+S7Q==} - file@0.2.2: - resolution: {integrity: sha512-gwabMtChzdnpDJdPEpz8Vr/PX0pU85KailuPV71Zw/un5yJVKvzukhB3qf6O3lnTwIe5CxlMYLh3jOK3w5xrLA==} - fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} @@ -3985,9 +3963,6 @@ packages: lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - linkify-it@4.0.1: - resolution: {integrity: sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw==} - linkify-it@5.0.2: resolution: {integrity: sha512-ONTm2jCMAVZjgQa/Fy1kScXsuOoF5NPTsoFBdE1KVIZ2vAh/r9+Bqo+0jINCBYnavTPQZz38QzFTme79ENoN3Q==} @@ -4027,9 +4002,6 @@ packages: lodash.uniqby@4.7.0: resolution: {integrity: sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww==} - lodash@4.18.1: - resolution: {integrity: sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==} - log-symbols@4.1.0: resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} engines: {node: '>=10'} @@ -4064,10 +4036,6 @@ packages: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} - markdown-it@13.0.2: - resolution: {integrity: sha512-FtwnEuuK+2yVU7goGn/MJ0WBZMM9ZPgU9spqlFs7/A/pDIUNSOQZhUgOqYCficIuR2QaFnrt8LHqBWsbTAoI5w==} - hasBin: true - markdown-it@14.3.2: resolution: {integrity: sha512-sHHjZ5fJKlgrG4qns2YwVcdNep35h5fERrfkD2YNsb9UFk0UIHarbiTaHKVMlPuWAoiilyK8Fv/jAm11slsY7Q==} hasBin: true @@ -4084,9 +4052,6 @@ packages: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} - mdurl@1.0.1: - resolution: {integrity: sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==} - mdurl@2.1.0: resolution: {integrity: sha512-1+HBaOx0zi/dQWht8rNv9MYf9qqpqL/kxI0hXImU6Y547zM6Sni8BQibt7ifgMcYtQg41ao3Ivd6cnSM86inpg==} @@ -4209,20 +4174,11 @@ packages: resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} engines: {node: '>=16 || 14 >=14.17'} - mkdirp@0.5.6: - resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} - hasBin: true - mkdirp@1.0.4: resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} engines: {node: '>=10'} hasBin: true - modernizr@3.13.1: - resolution: {integrity: sha512-jc7F04Wd8ngu+fNZYMdWmho6bdiNNnt01lAEF6WAGRay7haGzjWEj5wfBC/zNgv5BySJ+h29/ERMFX+zEcijvg==} - engines: {node: '>=8'} - hasBin: true - moment-timezone@0.6.4: resolution: {integrity: sha512-JHUK8Mgheach4uMQmIV/pIfrv0ubPiDCPPqc7Mi604je1UblP6Gbm+FfV+Oh88KP03rZqGCZG3t0wmpfdlDv+w==} @@ -4764,11 +4720,6 @@ packages: require-main-filename@2.0.0: resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} - requirejs@2.3.8: - resolution: {integrity: sha512-7/cTSLOdYkNBNJcDMWf+luFvMriVm7eYxp4BcFCsAX0wF421Vyce5SXP17c+Jd5otXKGNehIonFlyQXSowL6Mw==} - engines: {node: '>=0.4.0'} - hasBin: true - resolve-cwd@3.0.0: resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} engines: {node: '>=8'} @@ -4887,10 +4838,6 @@ packages: resolution: {integrity: sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==} engines: {node: '>= 18'} - serialize-javascript@7.1.1: - resolution: {integrity: sha512-k3CMsaIvvdSwm8oLB4MXSl0wH2/cwlH7xGcnRd2DaeRmBkbzYmyT8j0tsX60DwD1eRwHTpNpH8ljKu9oUT1MeQ==} - engines: {node: '>=20.0.0'} - serve-index@1.9.2: resolution: {integrity: sha512-KDj11HScOaLmrPxl70KYNW1PksP4Nb/CLL2yvC+Qd2kHMPEEpfc4Re2e4FOay+bC/+XQl/7zAcWON3JVo5v3KQ==} engines: {node: '>= 0.8.0'} @@ -5291,9 +5238,6 @@ packages: engines: {node: '>=16.20.0'} hasBin: true - uc.micro@1.0.6: - resolution: {integrity: sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==} - uc.micro@2.1.0: resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==} @@ -5502,10 +5446,6 @@ packages: resolution: {integrity: sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==} engines: {node: '>=6'} - wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} - engines: {node: '>=8'} - wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -5561,10 +5501,6 @@ packages: yargs-parser@15.0.3: resolution: {integrity: sha512-/MVEVjTXy/cGAjdtQf8dW3V9b97bPN7rNn8ETj6BmAQL7ibC7O1Q9SPJbGjgh3SlwoBNXMzj/ZGIj8mBgl12YA==} - yargs-parser@18.1.3: - resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} - engines: {node: '>=6'} - yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} @@ -5576,10 +5512,6 @@ packages: yargs@14.2.3: resolution: {integrity: sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==} - yargs@15.4.1: - resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} - engines: {node: '>=8'} - yargs@17.7.3: resolution: {integrity: sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==} engines: {node: '>=12'} @@ -8496,12 +8428,6 @@ snapshots: strip-ansi: 5.2.0 wrap-ansi: 5.1.0 - cliui@6.0.0: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - cliui@8.0.1: dependencies: string-width: 4.2.3 @@ -8641,15 +8567,6 @@ snapshots: cookie@0.7.2: {} - copy-webpack-plugin@14.0.0(webpack@5.111.1): - dependencies: - glob-parent: 6.0.2 - normalize-path: 3.0.0 - schema-utils: 4.5.0 - serialize-javascript: 7.1.1 - tinyglobby: 0.2.17 - webpack: 5.111.1(postcss@8.5.28)(webpack-cli@7.2.3) - core-js-compat@3.50.0: dependencies: browserslist: 4.29.0 @@ -8826,8 +8743,6 @@ snapshots: ansi-colors: 4.1.3 strip-ansi: 6.0.1 - entities@3.0.1: {} - entities@4.5.0: {} entities@6.0.1: {} @@ -9048,8 +8963,6 @@ snapshots: dependencies: flat-cache: 6.1.23 - file@0.2.2: {} - fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 @@ -9894,10 +9807,6 @@ snapshots: lines-and-columns@1.2.4: {} - linkify-it@4.0.1: - dependencies: - uc.micro: 1.0.6 - linkify-it@5.0.2: dependencies: uc.micro: 2.1.0 @@ -9931,8 +9840,6 @@ snapshots: lodash.uniqby@4.7.0: {} - lodash@4.18.1: {} - log-symbols@4.1.0: dependencies: chalk: 4.1.2 @@ -9961,14 +9868,6 @@ snapshots: dependencies: semver: 7.8.5 - markdown-it@13.0.2: - dependencies: - argparse: 2.0.1 - entities: 3.0.1 - linkify-it: 4.0.1 - mdurl: 1.0.1 - uc.micro: 1.0.6 - markdown-it@14.3.2: dependencies: argparse: 2.0.1 @@ -9987,8 +9886,6 @@ snapshots: math-intrinsics@1.1.0: {} - mdurl@1.0.1: {} - mdurl@2.1.0: {} media-typer@1.1.1: {} @@ -10067,22 +9964,8 @@ snapshots: minipass@7.1.3: {} - mkdirp@0.5.6: - dependencies: - minimist: 1.2.8 - mkdirp@1.0.4: {} - modernizr@3.13.1: - dependencies: - doctrine: 3.0.0 - file: 0.2.2 - lodash: 4.18.1 - markdown-it: 13.0.2 - mkdirp: 0.5.6 - requirejs: 2.3.8 - yargs: 15.4.1 - moment-timezone@0.6.4: dependencies: moment: 2.31.0 @@ -10676,8 +10559,6 @@ snapshots: require-main-filename@2.0.0: {} - requirejs@2.3.8: {} - resolve-cwd@3.0.0: dependencies: resolve-from: 5.0.0 @@ -10788,8 +10669,6 @@ snapshots: transitivePeerDependencies: - supports-color - serialize-javascript@7.1.1: {} - serve-index@1.9.2(supports-color@8.1.1): dependencies: accepts: 1.3.8 @@ -11164,8 +11043,6 @@ snapshots: '@typescript/typescript-win32-arm64': 7.0.2 '@typescript/typescript-win32-x64': 7.0.2 - uc.micro@1.0.6: {} - uc.micro@2.1.0: {} underscore@1.13.8: {} @@ -11435,12 +11312,6 @@ snapshots: string-width: 3.1.0 strip-ansi: 5.2.0 - wrap-ansi@6.2.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 @@ -11488,11 +11359,6 @@ snapshots: camelcase: 5.3.1 decamelize: 1.2.0 - yargs-parser@18.1.3: - dependencies: - camelcase: 5.3.1 - decamelize: 1.2.0 - yargs-parser@21.1.1: {} yargs-parser@22.0.0: {} @@ -11511,20 +11377,6 @@ snapshots: y18n: 4.0.3 yargs-parser: 15.0.3 - yargs@15.4.1: - dependencies: - cliui: 6.0.0 - decamelize: 1.2.0 - find-up: 4.1.0 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - require-main-filename: 2.0.0 - set-blocking: 2.0.0 - string-width: 4.2.3 - which-module: 2.0.1 - y18n: 4.0.3 - yargs-parser: 18.1.3 - yargs@17.7.3: dependencies: cliui: 8.0.1 diff --git a/src/core/feature-detection.js b/src/core/feature-detection.js index 01ff0394a..a3ace8688 100644 --- a/src/core/feature-detection.js +++ b/src/core/feature-detection.js @@ -1,33 +1,13 @@ (function () { - // Add JavaScript feature as class to the element, just like - // Modernizr does. This is needed for accessibility reasons, to support - // browsers and situations where JavaScript is not available or disabled. - // The HTML root tag needs to have the `no-js` class set which is then - // replaced by `js`. + // JavaScript feature detection. + // If JavaScript is available, `js` will be added to the HTML class list. + // This is needed for accessibility reasons, to support browsers and + // situations where JavaScript is not available or disabled. + // NOTE: The HTML root tag needs to have the `no-js` class set which is + // then replaced by `js`. const html = document.getElementsByTagName("html")[0]; if (html.classList.contains("no-js")) { html.classList.remove("no-js"); html.classList.add("js"); } - - // NOTE: Modernizr will be removed in an upcoming minor release. - - // Do not load modernizr if disabled. It's enabled by default. - // You might want to disable it for your project by setting: - // window.__patternslib_disable_modernizr = true; - if (window.__patternslib_disable_modernizr) { - return; - } - - // Get the current script tag's URL. - const script_url = document.currentScript.src; - // Get the base URL of the current script tag's URL. - let base_url = script_url.substring(0, script_url.lastIndexOf("/")) + "/"; - // The modernizr script is located outside the chunks directory. - base_url = base_url.replace("chunks/", ""); - - // Inject a new one with the modernizr bundle. - const script_tag = document.createElement("script"); - script_tag.src = base_url + "modernizr.min.js"; - document.getElementsByTagName("head")[0].appendChild(script_tag); })(); diff --git a/src/core/feature-detection.md b/src/core/feature-detection.md index f04513b44..d453fe40a 100644 --- a/src/core/feature-detection.md +++ b/src/core/feature-detection.md @@ -1,6 +1,6 @@ # Feature detection -This module adds the `js` class to the HTML root node and loads Modernizr for more feature detection. +This module adds the `js` class to the HTML root node. --- ** Note ** @@ -44,28 +44,3 @@ When the JavaScript is loaded, the `no-js` class is removed and the `js` class i ``` - - -## Loading Modernizr - -Modernizr is loaded for more feature detection. - -To disable Modernizr you can set `window.__patternslib_disable_modernizr = true;` just before you load the Patternslib bundle: - -``` - - - - - - - - -``` - ---- -** Note ** - -The Modernizr feature detection is being phased out and might be removed in a future version of Patternslib. - ---- diff --git a/src/index.js b/src/index.js index cfc4f9f02..d6444c681 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,4 @@ -// Load modernizr and the `html.js` feature class. -// NOTE: Modernizr will be removed in an upcoming minor release. +// Load `html.js` feature class. import "./core/feature-detection"; // Webpack entry point for module federation. diff --git a/src/pat/clone-code/index.html b/src/pat/clone-code/index.html index 641cb6614..0740f109b 100644 --- a/src/pat/clone-code/index.html +++ b/src/pat/clone-code/index.html @@ -4,7 +4,6 @@ pat-clone demo page - diff --git a/style/common.css b/style/common.css index b6a5018e2..47dfcabc6 100644 --- a/style/common.css +++ b/style/common.css @@ -418,10 +418,6 @@ body.component-index #component-index > div { background-position: 0 -100px; } -.component-index a.modernizr:before { - background-position: -100px -100px; -} - .component-index a.ajax:before { background-position: -300px 0; } diff --git a/webpack/webpack.config.js b/webpack/webpack.config.js index 38a0f46f9..27e6e8fd1 100644 --- a/webpack/webpack.config.js +++ b/webpack/webpack.config.js @@ -1,12 +1,9 @@ // Webpack configuration for the Patternslib bundle distribution. process.traceDeprecation = true; -const CopyPlugin = require("copy-webpack-plugin"); const mf_config = require("@patternslib/dev/webpack/webpack.mf"); const package_json = require("../package.json"); const path = require("path"); const webpack_config = require("@patternslib/dev/webpack/webpack.config").config; -const modernizr_config = require("../.modernizrrc.js"); -const modernizr = require("modernizr"); module.exports = () => { let config = { @@ -42,41 +39,6 @@ module.exports = () => { }) ); - // Copy static files - config.plugins.push( - new CopyPlugin({ - patterns: [ - // Build and copy Modernizr. - // We're abusing the CopyPlugin transform method here to build - // a Modernizr bundle using the modernizr config. The input - // file does not matter and could be anything - we're using the - // modernizr config itself. - // Why building modernizr here and not in the Makefile? - // Because we want webpack-dev-server also to serve it. - { - from: path.resolve(__dirname, "../.modernizrrc.js"), - to: "[path]modernizr.min.js", - transform: { - transformer: () => { - return new Promise((resolve) => { - modernizr.build( - { - ...modernizr_config, - minify: process.env.NODE_ENV === "production", - }, - (result) => { - resolve(result); - } - ); - }); - }, - cache: true, - }, - }, - ], - }) - ); - if (process.env.NODE_ENV === "development") { config.devServer.static.directory = path.resolve(__dirname, "../"); config.devServer.watchFiles = ["src/"];