-
-
Notifications
You must be signed in to change notification settings - Fork 727
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
IE11: Update babel config to use the runtime #404
Conversation
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.
Thanks a lot for helping with this! I've added some comments to your changes.
@@ -63,9 +63,6 @@ | |||
"url": "https://github.com/gpbl/react-day-picker/issues" | |||
}, | |||
"homepage": "https://react-day-picker.js.org", | |||
"peerDependencies": { | |||
"react": "~0.13.x || ~0.14.x || ^15.0.0" |
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.
Any reason why you are removing react from peerDependencies
?
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.
Mentioned in the PR description, but I'll copy/paste here:
I also had issues testing changes to the library. When I ran npm link to test my changes, I kept getting errors saying that webpack could not find the "react" library. I looked and saw that React is listed as a peerDependency. However, since React is imported by the library's code and is required in order for this library to compile properly, I'm thinking it should be a dependency.
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.
Sorry I missed that part 😄
React is included in the devDependencies
, which should be installed when developing the module. So definitely react must stay as peerDependency
here.
@@ -113,7 +111,9 @@ | |||
"webpack": "^2.6.1" | |||
}, | |||
"dependencies": { | |||
"prop-types": "^15.5.10" | |||
"babel-runtime": "^6.23.0", |
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.
Do you know the impact this is having to the final bundle size? I'd rather remove the stuff not supported by IE11.
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.
The bundle size did go up a noticeable amount. I did some investigation on what would need to be done. The Array.from
references are actually introduced by a babel plugin, so it's affects aren't quite easy to see.
I'll close this PR and open another one as soon as I'm capable of testing my changes.
|
Yup. New PR: #406 |
Bug:
Fixes #403
As mentioned in the issue, this library breaks in IE11 due to missing polyfills. You could just document the polyfill requirements for this library, but since IE 11 is still over 2% of browser usage and this is a library, I think it'd be a good idea to set up babel to use polyfills and helpers.
I also had issues testing changes to the library. When I ran
npm link
to test my changes, I kept getting errors saying that webpack could not find the "react" library. I looked and saw that React is listed as a peerDependency. However, since React is imported by the library's code and is required in order for this library to compile properly, I'm thinking it should be a dependency.Notes:
Babel documentation on the plugins I'm using and dependencies I added.
Changes:
cc: @gpbl