Skip to content

Warn on missing Set/Map polyfills#10356

Merged
gaearon merged 4 commits into
react:masterfrom
gaearon:crash-polyfills
Aug 2, 2017
Merged

Warn on missing Set/Map polyfills#10356
gaearon merged 4 commits into
react:masterfrom
gaearon:crash-polyfills

Conversation

@gaearon

@gaearon gaearon commented Aug 2, 2017

Copy link
Copy Markdown
Collaborator

Adding an early check with a URL currently pointing to a gist.
We’ll move this to docs as part of 16 release.

We could do a warning instead, which would save some bytes. I opted for invariant for consistency with what we do for rAFs. Changed this to be a warning per feedback.

I check for specific methods we use. There’s some earlier versions of Firefox that added support gradually.

@sebmarkbage

Copy link
Copy Markdown
Contributor

@gaearon

gaearon commented Aug 2, 2017

Copy link
Copy Markdown
Collaborator Author

See above:

We could do a warning instead, which would save some bytes. I opted for invariant for consistency with what we do for rAFs.

Wanna change this for rAF to also be a warning?

@gaearon gaearon changed the title Crash on missing Set/Map polyfills Warn on missing Set/Map polyfills Aug 2, 2017
@gaearon

gaearon commented Aug 2, 2017

Copy link
Copy Markdown
Collaborator Author

I changed Map/Set to be a warning but left requestAnimationFrame an invariant. Can change this to warning as well (not sure if you intended that).

@gaearon

gaearon commented Aug 2, 2017

Copy link
Copy Markdown
Collaborator Author

Changed rAF check to also be a warning in last commit.

@@ -25,6 +25,21 @@ import type {Deadline} from 'ReactFiberReconciler';
var invariant = require('fbjs/lib/invariant');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now unused. rm to fix lint.

@gaearon gaearon merged commit 4e6cc2f into react:master Aug 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants