bv-ui-core
Advanced tools
Comparing version 0.14.1 to 0.14.2
# Polyfills! | ||
The polyfills contained in this folder can be imported as necessary. They should | ||
export either the built-in being polyfilled, if found on the global, or the | ||
polyfill. | ||
export either the builtin native function(s), if found on the global, or the | ||
polyfill itself. | ||
@@ -17,2 +17,12 @@ ## Usage | ||
```js | ||
const { fetch, Headers } = require('bv-ui-core/lib/polyfills/fetch') | ||
// Do things with the fetch polyfill! | ||
fetch(url, { | ||
headers: new Headers({ | ||
'Accept': 'application/json', | ||
}), | ||
}).then(myCallback) | ||
``` | ||
**In webpack** | ||
@@ -22,8 +32,10 @@ | ||
plugins: [ | ||
// Any references to these items in the bundle will be wrapped in | ||
// references to their respective polyfill module exports. | ||
new webpack.ProvidePlugin({ | ||
// Any Promise references in the bundle will be wrapped in references to | ||
// the polyfill. | ||
Promise: 'bv-ui-core/lib/polyfill/promise' | ||
Promise: 'bv-ui-core/lib/polyfill/promise', | ||
fetch: ['bv-ui-core/lib/polyfill/fetch', 'fetch'], | ||
Headers: ['bv-ui-core/lib/polyfill/fetch', 'Headers'], | ||
}) | ||
] | ||
``` |
{ | ||
"name": "bv-ui-core", | ||
"version": "0.14.1", | ||
"version": "0.14.2", | ||
"license": "Apache 2.0", | ||
@@ -53,3 +53,6 @@ "description": "Bazaarvoice UI-related JavaScript", | ||
} | ||
}, | ||
"dependencies": { | ||
"whatwg-fetch": "^2.0.3" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
201694
94
4716
1
4
+ Addedwhatwg-fetch@^2.0.3
+ Addedwhatwg-fetch@2.0.4(transitive)