-
Notifications
You must be signed in to change notification settings - Fork 27.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add EventSource polyfill to hot-middleware-client #3945
Conversation
* Add a nerv example. * Fix for indentation/style * Fix for name
* Use indexOf instead of startsWith This fixes an IE11 regression, see vercel#3755 * Lint the code
Fixes an issue where the dev server crashes in IE11.
Can be done with https://github.com/zeit/next.js/tree/canary/examples/with-polyfills Not sure if we want to do this by default 🤔cc @arunoda |
Since this doesn't affect app code IMHO it should be polyfilled by the framework. Also, it's only included in dev mode, so no overhead is added to production. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides my earlier comment, code looks great.
@herrstucki we haven't tested dev mode a lot with IE11 assuming we use it for production and use Chrome/FF for dev. Anyway, this looks legit to me. |
Thanks @arunoda @timneutkens 🙏 Another thing: I noticed that next.js uses some features in the framework itself that need to be polyfilled for IE (like |
@herrstucki a production Next.js app should work on IE11 without any polyfill. If we use include (or any other ES6 feature), babel will use the correct polyfill when compiling Next.js. |
@arunoda you're right. I looked again and saw this only in dev mode in IE11. I traced it back to react-hot-loader where it was already fixed in this commit: gaearon/react-hot-loader@a429374 So if you upgrade RHL to the latest version this should be fixed! 👍 |
Fixes the dev server not working in IE11.
C.f. https://github.com/glenjamin/webpack-hot-middleware/blob/master/README.md#use-on-browsers-without-eventsource