Skip to content

Conversation

@Kazimirkas
Copy link
Contributor

IE11 needs a Promise polyfill for React 16.7. (not only Set and Map polyfills)
If you are using Lazy and Suspense feature, IE throws a null error. In 'readLazyComponentType' function implementation.

#1552

@alexkrolick alexkrolick merged commit cda9910 into reactjs:master Jan 14, 2019
@alexkrolick
Copy link
Collaborator

👍thanks

@reactjs-bot
Copy link

Deploy preview for reactjs ready!

Built with commit 8db2e3e

https://deploy-preview-1553--reactjs.netlify.com

@Kazimirkas Kazimirkas deleted the fix/extend_javascript-environment-requirements_description branch January 14, 2019 23:05
@aweary
Copy link
Member

aweary commented Jan 15, 2019

We should probably explain this a bit more, as I don’t think Promise is strictly required unless you’re using React.lazy with dynamic import (or using Promise directly).

Internally React models it as “thenable”, which could be a regular object with a then method.

cc @gaearon

@Kazimirkas
Copy link
Contributor Author

Kazimirkas commented Jan 15, 2019

@aweary @gaearon Would It be correct to add after this sentence
...consider including a global polyfill in your bundled application, such as core-js or babel-polyfill.
a sentence like:
Also, if you’re using React.lazy (that requires a Promise or dynamic import), don't forget to add a polyfilled version of it.
?

@gaearon
Copy link
Member

gaearon commented Jan 15, 2019

I reverted for now to avoid confusion (#1554) but ideally we'd add a small note to the lazy documentation instead so that people who try it actually see it.

gaearon added a commit that referenced this pull request Jan 15, 2019
@gaearon
Copy link
Member

gaearon commented Jan 15, 2019

@alexkrolick for future reference, "JS requirements" can't change without a major version. If we add requirements midway it looks like a breaking change. We should avoid this kind of confusion.

@alexkrolick
Copy link
Collaborator

alexkrolick commented Jan 15, 2019

Definitely need to add a note to the lazy docs. Otherwise technically it is broken without a polyfill. It's also in the IE11 polyfill for CRA: https://github.com/facebook/create-react-app/blob/master/packages/react-app-polyfill/ie11.js

See #1556

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.

6 participants