Browser polyfills
npm install @carv/polyfills> Browser polyfills
- Usage
- Polyfills
- Available Scripts
- Create a release
- Folder Structure
``html`
src="/path/to/cdn/-/bootstrap"
data-main="
data-state="encodeURIComponent(
data-token="encodeURIComponent(
nonce="${request.id}"
>
We provide the most common APIs in a target specific bundle. APIs that are detectable globals are replaced per usage with an import to the poylfill.
> If a feature is not listed here check if it is already supported by IE 11.
- Promise
- SystemJS
- Array.isArray
- Array.prototype.\*
- DOMTokenList\*
- DocumentFragment\*
- Element\*
- Event\*
- Function\*
- HTMLTemplateElement
- Node.prototype.\* (including baseURI)
- NodeList.prototype.\*
- Object.\* except Object.fromEntries
- Promise
- Promise.allSettled
- Promise.prototype.finally
- RegExp.prototype.flags
- Reflect
- Reflect.\*
- String.prototype.\*
- Symbol
- Symbol.\*
- console.\*
- fetch
- AbortController
- Array.from
- Array.of
- ArrayBuffer
- Blob
- CSS.supports
- CustomEvent
- DataView
- IntersectionObserver & IntersectionObserverEntry
- Intl
- Map
- Math.\*
- MutationObserver
- Number
- Object.fromEntries
- ResizeObserver
- Set
- String.fromCodePoint
- String.raw
- URL
- URLSearchParams
- TextEncoder
- UserTiming (self.performance)
- WeakMap
- WeakSet
- globalThis
- navigator.sendBeacon
- queueMicrotask
- requestIdleCallback
- setImmediate
Two sub scripts will came in handy from time to time:
- npm start test.watch: re-run tests on changenpm start test.coverage
- : creates a coverage report at coverage/lcov-report/index.html
Formats all sources using prettier.
1. Update changelog
2. npm run formatnpm test
3.
4. git commit -a -m "chore: prepare release
5. [npm version [\
Put all your source code including your test files here. Test files
are matched using the following regexp:
- src/*/__tests__/.{js,jsx,ts,tsx}: matches every file within a __tests__ directory but not in child directories
- src/*/.{spec,test}.{js,jsx,ts,tsx}: matches .test.js and .spec.js files; some for the other extensions
This directory is used by snowpack on npm start to render a preview of your code.
Modify src/__preview__/app.svelte to match your needs.