Skip to content

Commit

Permalink
feat(Storybook): add polyfill and babel-polyfill to support IE/Edge
Browse files Browse the repository at this point in the history
  • Loading branch information
Rendez committed Oct 11, 2017
1 parent 5003921 commit 17ffe55
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,11 @@ Single React component or element that is used as the target (observable).

### Notes

* According to the spec, a first callback invocation occurs when the target is first attached to the observer.
* According to the spec, an initial event is being fired when starting to observe a non-intersecting element as well.
* _Edge's implementation seems to [miss the initial event](https://github.com/w3c/IntersectionObserver/issues/222#issuecomment-311539591), although Edge 16 behavior aligns with the spec._
* Changes happen asynchronously, similar to the way `requestIdleCallback` works.
* Although you can consider callbacks immediate - always below 1 second - you can also get an immediate response on an element's visibility with `observer.takeRecords()`.
* Support for _Map_, _Symbol_ and other native features and primitives is required. Consider using a polyfill for IE < 11 and older browsers. If you're using babel include `"babel-polyfill"` somewhere to your codebase.

## Polyfill

Expand Down
2 changes: 2 additions & 0 deletions docs/docs/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'babel-polyfill';
import 'intersection-observer';
import { storiesOf } from '@storybook/react';
import WindowRoot from './components/WindowRoot';
import WindowFrame from './components/WindowFrame';
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"babel-cli": "^6.24.1",
"babel-eslint": "^8.0.0",
"babel-jest": "^21.0.0",
"babel-polyfill": "^6.26.0",
"conventional-github-releaser": "^1.1.12",
"cross-env": "^5.0.5",
"css-loader": "^0.28.4",
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5840,9 +5840,9 @@ range-parser@^1.0.3, range-parser@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e"

raw-loader@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-0.5.1.tgz#0c3d0beaed8a01c966d9787bf778281252a979aa"
raw-loader@^1.0.0-beta.0:
version "1.0.0-beta.0"
resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-1.0.0-beta.0.tgz#617853ce8314d1166c06758d9302d24faf08d44c"

rc@^1.1.7:
version "1.2.1"
Expand Down Expand Up @@ -6751,9 +6751,9 @@ style-loader@^0.17.0:
dependencies:
loader-utils "^1.0.2"

style-loader@^0.18.2:
version "0.18.2"
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.18.2.tgz#cc31459afbcd6d80b7220ee54b291a9fd66ff5eb"
style-loader@^0.19.0:
version "0.19.0"
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.19.0.tgz#7258e788f0fee6a42d710eaf7d6c2412a4c50759"
dependencies:
loader-utils "^1.0.2"
schema-utils "^0.3.0"
Expand Down

0 comments on commit 17ffe55

Please sign in to comment.