Skip to content
Snippets Groups Projects
Verified Commit 4e68aa5f authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix: remove polifill #218

parent 6025c10c
No related branches found
No related tags found
No related merge requests found
...@@ -76,14 +76,7 @@ Voilà! ...@@ -76,14 +76,7 @@ Voilà!
### Polyfill ### Polyfill
While we strive to work around some browser bugs, generally, we do not use polyfills or feature detection. While we strive to work around some browser bugs, generally, we do not use polyfills or feature detection.
However, many functions can be supplemented through [polyfill.io](https://polyfill.io/), thus enhancing compatibility. However, many functions can be supplemented through polyfills, thus enhancing compatibility.
```html
<script id="polyfill"
src="https://polyfill.io/v3/polyfill.min.js?features=AbortController,Array.prototype.entries,Array.prototype.fill,Array.prototype.find,Array.prototype.includes,Array.prototype.keys,Array.prototype.sort,Array.prototype.values,atob,AudioContext,blissfuljs,Blob,CharacterData.prototype.nextElementSibling,CharacterData.prototype.previousElementSibling,CharacterData.prototype.remove,console,console.error,console.log,CSS.supports,CustomEvent,DocumentFragment,DocumentFragment.prototype.append,DocumentFragment.prototype.prepend,DOMRect,DOMTokenList,DOMTokenList.prototype.forEach,DOMTokenList.prototype.replace,Element.prototype.append,Element.prototype.getAttributeNames,Element.prototype.prepend,Element.prototype.remove,Element.prototype.scroll,Event,EventSource,fetch,Function.prototype.name,globalThis,HTMLDocument,HTMLPictureElement,HTMLTemplateElement,IntersectionObserver,IntersectionObserverEntry,Intl,Intl.DateTimeFormat,Intl.NumberFormat,Intl.PluralRules,Map,Math.log2,MutationObserver,Node.prototype.contains,Node.prototype.getRootNode,Node.prototype.isConnected,Node.prototype.isSameNode,NodeList.prototype.forEach,Number.isFinite,Number.isInteger,Object.assign,Object.entries,Object.freeze,Object.getOwnPropertyNames,Object.prototype.toString,Reflect,Reflect.defineProperty,Reflect.get,Reflect.getOwnPropertyDescriptor,Reflect.setPrototypeOf,requestAnimationFrame,ResizeObserver,Set,String.prototype.includes,String.prototype.matchAll,String.prototype.padStart,Symbol,Symbol.for,Symbol.hasInstance,Symbol.iterator,TextDecoder,TextEncoder,Uint16Array,Uint8Array,URLSearchParams,WeakSet"
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
```
## Questions ## Questions
......
...@@ -22,35 +22,6 @@ in ...@@ -22,35 +22,6 @@ in
${pkgs'.gnused}/bin/sed -i -E "s_(\"[0-9]+\.[0-9]+\.[0-9]+\")_\"${version}\"_g" "''${SOURCE_PATH}/types/version.mjs" ${pkgs'.gnused}/bin/sed -i -E "s_(\"[0-9]+\.[0-9]+\.[0-9]+\")_\"${version}\"_g" "''${SOURCE_PATH}/types/version.mjs"
${pkgs'.gnused}/bin/sed -i -E "s_(\"[0-9]+\.[0-9]+\.[0-9]+\")_\"${version}\"_g" "''${TEST_CASES_PATH}/monster.mjs" ${pkgs'.gnused}/bin/sed -i -E "s_(\"[0-9]+\.[0-9]+\.[0-9]+\")_\"${version}\"_g" "''${TEST_CASES_PATH}/monster.mjs"
echo_step "Create polyfill service URL"
TMPDIR=$(${pkgs'.mktemp}/bin/mktemp -d)
if [ $? -ne 0 ]
then
echo_fail "ERROR: mktemp failed"
exit 1
fi
if [ -z "$TEMP" ]; then
TEMP="/tmp"
fi
if ! ${pkgs'.esbuild}/bin/esbuild --platform=browser --bundle ''${SOURCE_PATH}/monster.mjs --outfile=''${TMPDIR}/monster.js
then
echo_fail "ERROR: esbuild failed, check your JS!"
exit 1
fi
url="$(${pkgs'.nodejs_20}/bin/npx create-polyfill-service-url analyse --cwd="''${TMPDIR}" --file=monster.js)"
${pkgs'.coreutils}/bin/rm ''${TMPDIR}/monster.js
${pkgs'.coreutils}/bin/rm -rf ''${TMPDIR}/js*
${pkgs'.coreutils}/bin/rmdir ''${TMPDIR}
if [ ! -x {$url} ]
then
${pkgs'.gnused}/bin/sed -i -E "/id=\"polyfill\"/s|.*| <script id=\"polyfill\" src=\"''${url}\"|g" ''${TEST_WEB_PATH}/test.html
${pkgs'.gnused}/bin/sed -i -E "/id=\"polyfill\"/s|.*|<script id=\"polyfill\" src=\"''${url}\"|g" ''${PROJECT_ROOT}/README.md
fi
${pkgs'.findutils}/bin/find ''${TEST_CASES_PATH} -type f | sed "s|^$TEST_CASES_PATH||" > ''${TEST_WEB_PATH}/import.js ${pkgs'.findutils}/bin/find ''${TEST_CASES_PATH} -type f | sed "s|^$TEST_CASES_PATH||" > ''${TEST_WEB_PATH}/import.js
${pkgs'.gnused}/bin/sed -i 's|^|import "../cases/|' ''${TEST_WEB_PATH}/import.js ${pkgs'.gnused}/bin/sed -i 's|^|import "../cases/|' ''${TEST_WEB_PATH}/import.js
${pkgs'.gnused}/bin/sed -i 's|$|";|' ''${TEST_WEB_PATH}/import.js ${pkgs'.gnused}/bin/sed -i 's|$|";|' ''${TEST_WEB_PATH}/import.js
......
...@@ -40,14 +40,14 @@ ...@@ -40,14 +40,14 @@
"author": "schukai GmbH", "author": "schukai GmbH",
"license": "AGPL 3.0", "license": "AGPL 3.0",
"dependencies": { "dependencies": {
"@floating-ui/dom": "^1.6.5", "@floating-ui/dom": "^1.6.6",
"@popperjs/core": "^2.11.8" "@popperjs/core": "^2.11.8"
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "1.3.3", "@biomejs/biome": "1.3.3",
"@esbuild-plugins/node-modules-polyfill": "^0.2.2", "@esbuild-plugins/node-modules-polyfill": "^0.2.2",
"@peculiar/webcrypto": "^1.5.0", "@peculiar/webcrypto": "^1.5.0",
"@playwright/test": "^1.44.1", "@playwright/test": "^1.45.0",
"@roarr/cli": "^5.12.4", "@roarr/cli": "^5.12.4",
"autoprefixer": "^10.4.19", "autoprefixer": "^10.4.19",
"browserslist": "^4.23.1", "browserslist": "^4.23.1",
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
"c8": "^8.0.1", "c8": "^8.0.1",
"chai": "^4.4.1", "chai": "^4.4.1",
"chai-dom": "^1.12.0", "chai-dom": "^1.12.0",
"create-polyfill-service-url": "^2.3.0",
"crypt": "^0.0.2", "crypt": "^0.0.2",
"cssnano": "^6.1.2", "cssnano": "^6.1.2",
"dom-storage": "^2.1.0", "dom-storage": "^2.1.0",
...@@ -65,12 +64,12 @@ ...@@ -65,12 +64,12 @@
"estraverse": "^5.3.0", "estraverse": "^5.3.0",
"flow-bin": "^0.221.0", "flow-bin": "^0.221.0",
"fs": "0.0.1-security", "fs": "0.0.1-security",
"glob": "^10.4.1", "glob": "^10.4.2",
"graphviz": "^0.0.9", "graphviz": "^0.0.9",
"jsdom": "^22.1.0", "jsdom": "^22.1.0",
"jsdom-global": "^3.0.2", "jsdom-global": "^3.0.2",
"mocha": "^10.4.0", "mocha": "^10.5.1",
"playwright": "^1.44.1", "playwright": "^1.45.0",
"postcss": "^8.4.38", "postcss": "^8.4.38",
"postcss-fluid": "^1.4.2", "postcss-fluid": "^1.4.2",
"postcss-for": "^2.1.1", "postcss-for": "^2.1.1",
......
This diff is collapsed.
...@@ -5,12 +5,6 @@ ...@@ -5,12 +5,6 @@
<title>Mocha Monster</title> <title>Mocha Monster</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="mocha.css"/> <link rel="stylesheet" href="mocha.css"/>
<script id="polyfill" src="https://polyfill.io/v3/polyfill.min.js?features=AbortController,Array.prototype.entries,Array.prototype.fill,Array.prototype.find,Array.prototype.includes,Array.prototype.keys,Array.prototype.sort,Array.prototype.values,atob,AudioContext,blissfuljs,Blob,CharacterData.prototype.nextElementSibling,CharacterData.prototype.previousElementSibling,CharacterData.prototype.remove,console,console.error,console.log,CSS.supports,CustomEvent,DocumentFragment,DocumentFragment.prototype.append,DocumentFragment.prototype.prepend,DOMRect,DOMTokenList,DOMTokenList.prototype.forEach,DOMTokenList.prototype.replace,Element.prototype.append,Element.prototype.getAttributeNames,Element.prototype.prepend,Element.prototype.remove,Element.prototype.scroll,Event,EventSource,fetch,Function.prototype.name,globalThis,HTMLDocument,HTMLPictureElement,HTMLTemplateElement,IntersectionObserver,IntersectionObserverEntry,Intl,Intl.DateTimeFormat,Intl.NumberFormat,Intl.PluralRules,Map,Math.log2,MutationObserver,Node.prototype.contains,Node.prototype.getRootNode,Node.prototype.isConnected,Node.prototype.isSameNode,NodeList.prototype.forEach,Number.isFinite,Number.isInteger,Object.assign,Object.entries,Object.freeze,Object.getOwnPropertyNames,Object.prototype.toString,Reflect,Reflect.defineProperty,Reflect.get,Reflect.getOwnPropertyDescriptor,Reflect.setPrototypeOf,requestAnimationFrame,ResizeObserver,Set,String.prototype.includes,String.prototype.matchAll,String.prototype.padStart,Symbol,Symbol.for,Symbol.hasInstance,Symbol.iterator,TextDecoder,TextEncoder,Uint16Array,Uint8Array,URLSearchParams,WeakSet"
src="https://polyfill.io/v3/polyfill.min.js?features=Array.from,Array.isArray,Array.prototype.entries,Array.prototype.every,Array.prototype.fill,Array.prototype.filter,Array.prototype.find,Array.prototype.forEach,Array.prototype.includes,Array.prototype.indexOf,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.map,Array.prototype.reduce,Array.prototype.some,Array.prototype.sort,Array.prototype.values,ArrayBuffer,atob,Blob,console,CustomEvent,DataView,Date.prototype.toISOString,document,Document,DocumentFragment,Element,Event,fetch,Function.prototype.bind,getComputedStyle,globalThis,HTMLDocument,HTMLTemplateElement,IntersectionObserver,Intl,JSON,Map,Math.log2,MutationObserver,Number.isFinite,Number.isInteger,Object.assign,Object.defineProperty,Object.entries,Object.freeze,Object.getOwnPropertyDescriptor,Object.getOwnPropertyNames,Object.getPrototypeOf,Object.keys,Promise,Reflect,Reflect.defineProperty,Reflect.get,Reflect.getOwnPropertyDescriptor,Reflect.setPrototypeOf,requestAnimationFrame,ResizeObserver,Set,String.prototype.endsWith,String.prototype.includes,String.prototype.matchAll,String.prototype.padStart,String.prototype.startsWith,String.prototype.trim,Symbol,Symbol.for,Symbol.hasInstance,Symbol.iterator,Uint16Array,Uint8Array,URL,WeakMap,WeakSet"
src="https://polyfill.io/v3/polyfill.min.js?features=Array.from,Array.isArray,Array.prototype.entries,Array.prototype.fill,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.map,Array.prototype.reduce,Array.prototype.sort,ArrayBuffer,atob,DataView,document,DocumentFragment,Element,Event,globalThis,HTMLDocument,HTMLTemplateElement,JSON,Map,Math.log2,Number.isInteger,Object.assign,Object.defineProperty,Object.entries,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.keys,Promise,Reflect,Reflect.defineProperty,Reflect.get,Reflect.getOwnPropertyDescriptor,Reflect.setPrototypeOf,Set,String.prototype.endsWith,String.prototype.matchAll,String.prototype.padStart,String.prototype.startsWith,String.prototype.trim,Symbol,Symbol.iterator,WeakMap,WeakSet"
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<script src="https://cdn.jsdelivr.net/npm/element-internals-polyfill"></script>
</head> </head>
<body> <body>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment