https://github.com/stimulusreflex/polyfills
Polyfills to support StimulusReflex in older browsers
https://github.com/stimulusreflex/polyfills
cableready polyfills rails stimulus stimulusreflex
Last synced: about 1 month ago
JSON representation
Polyfills to support StimulusReflex in older browsers
- Host: GitHub
- URL: https://github.com/stimulusreflex/polyfills
- Owner: stimulusreflex
- License: mit
- Created: 2021-05-05T21:45:23.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-13T01:29:35.000Z (almost 5 years ago)
- Last Synced: 2025-06-30T12:43:20.503Z (12 months ago)
- Topics: cableready, polyfills, rails, stimulus, stimulusreflex
- Language: JavaScript
- Homepage: https://docs.stimulusreflex.com
- Size: 97.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Polyfills for StimulusReflex
### Description
The `@stimulus_reflex/polyfills` package provides support for StimulusReflex and CableReady in older browsers like Internet Explorer 11.
### Usage
To include the polyfills you just have to import the package. Typically you want to import it in `app/javascript/packs/application.js`.
```javascript
// app/javascript/packs/application.js
import '@stimulus_reflex/polyfills'
import 'controllers'
// ...
```
If you have an existing import for `@stimulus/polyfills` you can safely remove it. The `@stimulus/polyfills` package is included with `@stimulus_reflex/polyfills`.
```diff
-import '@stimulus/polyfills'
+import '@stimulus_reflex/polyfills'
```
### Details
This repository contains a few polyfills itself and bundles up polyfills from other packages. The following list shows the included polyfills and where they are coming from:
#### Polyfills included/imported in this package
* Custom
* [`NodeList.forEach()`](https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach#Polyfill)
* [core-js](https://www.npmjs.com/package/core-js)
* `String.startsWith()`
* `String.includes()`
#### Polyfills imported from `@stimulus/polyfills`
* [core-js](https://www.npmjs.com/package/core-js)
* `Array.find()`
* `Array.findIndex()`
* `Array.from()`
* `Map`
* `Object.assign()`
* `Promise`
* `Reflect.deleteProperty()`
* `Set`
* [element-closest](https://www.npmjs.com/package/element-closest)
* `Element.closest()`
* [mutation-observer-inner-html-shim](https://www.npmjs.com/package/mutation-observer-inner-html-shim)
* `MutationObserver` support for Internet Explorer 11
* [eventlistener-polyfill](https://github.com/github/eventlistener-polyfill)
* once & passive support for Internet Explorer 11 & Edge
#### Polyfills imported from `@cable_ready/polyfills`
* [`CustomEvent`](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill)
* [core-js](https://www.npmjs.com/package/core-js)
* `Array.flat()`
* `Array.forEach()`
* `Array.from()`
* `Array.includes()`
* `Object.entries()`
* `Promise`
* [``](https://www.npmjs.com/package/@webcomponents/template)
#### Polyfills imported from `formdata-polyfill`
* [`FormData`](https://www.npmjs.com/package/formdata-polyfill)