You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[chore] Standardizing polyfills for reporting (#647)
* chore Moving polyfills into a separate file with standard syntax to make reporting on these easier in future
* chore Add a documentation section on other types of polyfills and the property syntax for adding them
* chore Add reporting to the demo page for polyfills and todos
-[3ccec6](https://github.com/patternfly/patternfly-elements/commit/3ccec6c82efc52aae67b74072b6c0b8ff1b47f23) Update pfe-cta to include broadcast variables for all variants [#659](https://github.com/patternfly/patternfly-elements/issues/658)
15
+
-[](https://github.com/patternfly/patternfly-elements/commit/) chore: Pull polyfills out into separate files for easier parsing/reporting
-[67fa1fb](https://github.com/patternfly/patternfly-elements/commit/67fa1fb3f29ec3e48a6d0767b6c08eb008e56655) fix: pfe-navigation mobile login/language links working [#620](https://github.com/patternfly/patternfly-elements/pull/620)
31
32
-[4ebcbcc](https://github.com/patternfly/patternfly-elements/commit/4ebcbcccaf50247c27a242a944dd4a5a654aeb80) fix: pfe-navigation add styles for when JavaScript does not load [#600](https://github.com/patternfly/patternfly-elements/pull/600))
32
33
-[27ef3ec](https://github.com/patternfly/patternfly-elements/commit/27ef3ec08371ec32c9a9376904163ef48148affa) feat: Updating broadcast and how variables are applied [#392](https://github.com/patternfly/patternfly-elements/pull/392)
33
-
-[a78ea1f]() Speed up Travis tests [#621](https://github.com/patternfly/patternfly-elements/issues/621)
34
+
-[a78ea1f](https://github.com/patternfly/patternfly-elements/commit/a78ea1fc5e114856ede20e459d35875697410b56) fix: Speed up Travis tests [#621](https://github.com/patternfly/patternfly-elements/issues/621)
@@ -78,7 +78,7 @@ For a more in-depth explanation, view the [example on GitHub](https://github.com
78
78
The two examples above also include the `custom-elements-es5-adapter.js` file before the web component polyfill. In the case that you need to support ES5, you need to include this polyfill. According to the spec, custom elements must be written as ES6 classes. However, in our build step we transpile our ES6 components to ES5 which makes it necessary for us to include the adapter to get our components to work.
For more documentation, check out the [custom-elements-es5-adapter.js section](https://github.com/WebComponents/webcomponentsjs#custom-elements-es5-adapterjs) on GitHub.
This polyfill is needed if your custom elements have been compiled from ES6 to ES5.
46
-
It's not necessary to include this polyfill for IE 11 and it will throw a syntax
47
-
error in IE 11 because the adapter was written in ES6. However, you can ignore
46
+
It's not necessary to include this polyfill for IE11 and it will throw a syntax
47
+
error in IE11 because the adapter was written in ES6. However, you can ignore
48
48
this error because it will not cause issues with your elements.
49
49
50
50
@@ -68,3 +68,18 @@ this error because it will not cause issues with your elements.
68
68
69
69
Check out the ES6 pfelement and include it.
70
70
71
+
## Additional polyfills
72
+
73
+
Some components may require the addition of certain functions in order to use modern JavaScript in older browsers. Until we can build in a way to automatically add these polyfills, please create a separate file called `polyfills--<component-name>.js` and import that file into your component using the following syntax. Be sure to specify what functions are being defined inside the polyfills file in the comment section above the import statement.
74
+
75
+
```js
76
+
// Import polyfills: <list of function names>
77
+
import"polyfills--<component-name>.js";
78
+
```
79
+
80
+
In your polyfills file, please prefix each addition with the name of the polyfill and the URL from which it was copied. Please use the following syntax so that we can easily report on/grep for these values:
0 commit comments