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

Publish ESM (.mjs) entry point to npm #208

Closed
motiz88 opened this issue Apr 15, 2018 · 2 comments
Closed

Publish ESM (.mjs) entry point to npm #208

motiz88 opened this issue Apr 15, 2018 · 2 comments

Comments

@motiz88
Copy link
Contributor

motiz88 commented Apr 15, 2018

While working on optimising the bundling of https://github.com/graphql/swapi-graphql — for reasons1 — I discovered that it was importing things from graphql-relay-js, but that the latter, unlike graphql-js, only had a CommonJS entry point published to npm.

It might be desirable to add an ES module build target to this package, modeled on what graphql-js is already doing.


1 See https://twitter.com/motiz88/status/985110696668131328 - I'm investigating the claim that schema execution on the front-end is impractical due to graphql-js's footprint in terms of bundle size. swapi-graphql simply happens to be a good, accessible testbed for just that (thanks @IvanGoncharov for the tip! 🙏)

motiz88 added a commit to motiz88/swapi-graphql that referenced this issue Apr 15, 2018
This is to allow Webpack to see through this module and correctly
eliminate unused parts of graphql-js.

See also graphql/graphql-relay-js#208
motiz88 added a commit to motiz88/swapi-graphql that referenced this issue Apr 15, 2018
This is to allow Webpack to see through this module and correctly
eliminate unused parts of graphql-js.

See also graphql/graphql-relay-js#208
@motiz88
Copy link
Contributor Author

motiz88 commented Apr 19, 2018

I've pretty much completed this on my publish-mjs branch but hit webpack/webpack#7032 due to the use of Buffer in utils/base64.js. Looking for viable workarounds. UPDATE: I think I've found one, see #209.

@IvanGoncharov
Copy link
Member

Sorry for the long delay.
We plan to merge this lib into graphql-js to provide the better maintenance and attention it deserves.
This should happen over the next few months and so closing this since graphql-js already provides mjs files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants