Skip to content
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

Compile ESM bundle to CJS using Babel instead of Rollup. #4911

Merged
merged 3 commits into from
Jun 4, 2019

Conversation

benjamn
Copy link
Member

@benjamn benjamn commented Jun 4, 2019

Background: #4843 (comment)

Closes my previous PR #4864, which attempted a similar ESM-to-CJS transformation using TypeScript instead of Babel.

I was tempted to use @babel/plugin-transform-runtime here, but that would have required adding a runtime dependency on @babel/runtime to all Apollo Client packages. Also, since we're only running the modules transform, the set of runtime helpers is effectively limited to interopRequireDefault and interopRequireWildcard, whose implementations can be inlined safely without increasing bundle sizes very much.

Fixes #4843.

@benjamn benjamn self-assigned this Jun 4, 2019
@benjamn benjamn force-pushed the compile-esm-to-cjs-with-babel-instead-of-rollup branch from 9e8538d to 98ac2da Compare June 4, 2019 01:34
Copy link
Member

@hwillson hwillson left a comment

Choose a reason for hiding this comment

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

A big 👍 from me @benjamn - this is great! I'll get similar changes implemented in react-apollo. Thanks!

@benjamn benjamn merged commit 5048b1b into master Jun 4, 2019
@benjamn benjamn deleted the compile-esm-to-cjs-with-babel-instead-of-rollup branch June 4, 2019 02:10
hwillson added a commit to apollographql/react-apollo that referenced this pull request Jun 11, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot set property default of #<Object> which has only a getter
2 participants