react-app-polyfill 0.1.4-next.c662dfb0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,17 +13,19 @@ Each polyfill ensures the following language features are present:
13
13
  1. `Symbol` (a built-in object used by `for...of` syntax and friends)
14
14
  1. `Array.from` (a built-in static method used by array spread, i.e. `[...arr]`)
15
15
 
16
+ *If you need more features, you must include them manually.*
17
+
16
18
  ### Usage
17
19
 
18
20
  First, install the package using Yarn or npm:
19
21
 
20
- ```bash
22
+ ```sh
21
23
  npm install react-app-polyfill
22
24
  ```
23
25
 
24
26
  or
25
27
 
26
- ```bash
28
+ ```sh
27
29
  yarn add react-app-polyfill
28
30
  ```
29
31
 
package/ie11.js CHANGED
@@ -14,8 +14,12 @@ if (typeof Promise === 'undefined') {
14
14
  window.Promise = require('promise/lib/es6-extensions.js');
15
15
  }
16
16
 
17
- // fetch() polyfill for making API calls.
18
- require('whatwg-fetch');
17
+ // Make sure we're in a Browser-like environment before importing polyfills
18
+ // This prevents `fetch()` from being imported in a Node test environment
19
+ if (typeof window !== 'undefined') {
20
+ // fetch() polyfill for making API calls.
21
+ require('whatwg-fetch');
22
+ }
19
23
 
20
24
  // Object.assign() is commonly used with React.
21
25
  // It will use the native implementation if it's present and isn't buggy.
package/ie9.js CHANGED
@@ -14,8 +14,12 @@ if (typeof Promise === 'undefined') {
14
14
  window.Promise = require('promise/lib/es6-extensions.js');
15
15
  }
16
16
 
17
- // fetch() polyfill for making API calls.
18
- require('whatwg-fetch');
17
+ // Make sure we're in a Browser-like environment before importing polyfills
18
+ // This prevents `fetch()` from being imported in a Node test environment
19
+ if (typeof window !== 'undefined') {
20
+ // fetch() polyfill for making API calls.
21
+ require('whatwg-fetch');
22
+ }
19
23
 
20
24
  // Object.assign() is commonly used with React.
21
25
  // It will use the native implementation if it's present and isn't buggy.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-app-polyfill",
3
- "version": "0.1.4-next.c662dfb0",
3
+ "version": "0.2.2",
4
4
  "description": "Polyfills for various browsers including commonly used language features",
5
5
  "repository": "facebook/create-react-app",
6
6
  "license": "MIT",
@@ -16,10 +16,10 @@
16
16
  "jsdom.js"
17
17
  ],
18
18
  "dependencies": {
19
- "core-js": "2.5.7",
19
+ "core-js": "2.6.4",
20
20
  "object-assign": "4.1.1",
21
21
  "promise": "8.0.2",
22
- "raf": "3.4.0",
22
+ "raf": "3.4.1",
23
23
  "whatwg-fetch": "3.0.0"
24
24
  }
25
25
  }