-
Notifications
You must be signed in to change notification settings - Fork 660
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
Re-add Helmet as a default export #547
Conversation
Codecov Report
@@ Coverage Diff @@
## master #547 +/- ##
=======================================
Coverage 96.91% 96.91%
=======================================
Files 3 3
Lines 292 292
=======================================
Hits 283 283
Misses 9 9
Continue to review full report at Codecov.
|
Thank you for supporting our project. According to #395 removing the default export was necessary as it didn't allow Rollup to work well. I would hope a codemod could be a lighter solve for changing your imports. Sorry for the inconvenience. |
@cwelch5 do you know specifically what the issue is? I've never had a problem with default exports and Rollup. |
Thanks @bdougherty , I suppose if it could be tested, there may not be harm in having both. I'll give it a few sanity checks and perhaps this could work. |
Thank you @okcoker for the contribution! |
This commit updates definition by: - adding support for 6.1 change introducing named and default exports support (this fixes errorrs like ` JSX element type 'Helmet' does not have any construct or call signatures.` - minor version bump - maintainer added nfl/react-helmet#547 https://github.com/nfl/react-helmet/releases/tag/6.1.0 Thanks!
…terblazejewicz This commit updates definition by: - adding support for 6.1 change introducing named and default exports support (this fixes errorrs like ` JSX element type 'Helmet' does not have any construct or call signatures.` - minor version bump - maintainer added nfl/react-helmet#547 https://github.com/nfl/react-helmet/releases/tag/6.1.0 Thanks!
… changes by @peterblazejewicz This commit updates definition by: - adding support for 6.1 change introducing named and default exports support (this fixes errorrs like ` JSX element type 'Helmet' does not have any construct or call signatures.` - minor version bump - maintainer added nfl/react-helmet#547 https://github.com/nfl/react-helmet/releases/tag/6.1.0 Thanks!
FWIW the reason I had removed the default export in my previous PR is related to how ESM modules get converted to CommonJS by Webpack. Both Webpack and rollup will transform an ESM module that has both a named export and a default export to a CommonJS module that exports
Now you have a situation where See this issue for an example of a project where it did end up breaking our build: civiccc/react-waypoint#238 |
Yes this makes sense as you'd probably have to do
You asked if there's any packages here doing es and cjs and my first thought is react-router where they have a Ultimately I feel I'm sure there are some resolution/alias options within both bundlers to make this a bit easier for the CJS environment but going forward, I would think |
This is the strongest argument I've seen mentioned as to keeping the default export. My suggestion when taking a new major is to always review the CHANGELOG first so you don't spend hours debugging in the first place. Unsolicited advice perhaps but worth keeping in mind so you can save yourself some time in the future. |
I was in the process of upgrading some packages related to react-redux and react-redux-router (now connected-react-router) and noticed I was getting an "Uncaught RangeError: Maximum call stack size exceeded" as described here. After many hours of debugging I found it was coming from react-helmet.
It seemed like upgrading to 6.0.0 fixed the issue but I noticed 6.0.0 removed
Helmet
as a default export.This would require me to change all imports within my app or use some magical alias webpack thing to keep the same import statements. I'm not sure why Rollup would necessitate a change to the API at all but I've added the default export back (in addition to the named export) for backwards compatibility for current v6 users and better forwards compatibility from v5 -> v6.