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

Remove support for non-standard module field in package.json #2339

Merged
merged 3 commits into from
May 5, 2021

Conversation

mrtnzlml
Copy link
Member

@mrtnzlml mrtnzlml commented May 5, 2021

This commit removes support for non-standard "module" field in package.json. Purpose of this field was to implement support for ES modules in its early days. This used to be a common way how to do it in bundlers, see:

However, seems like the whole system around ES modules evolved a bit differently (top level field "type": "module" + field "exports"), see:

This change is essentially a cleanup of our quirky and non-standard solution in order to be able to implement this modern approach.

This commit removes support for non-standard `"module"` field in `package.json`. Purpose of this field was to implement support for ES modules in its early days. This used to be a common way how to do it in bundlers, see:

- Webpack: https://webpack.js.org/guides/author-libraries/#final-steps
- Rollup: https://github.com/rollup/rollup/wiki/pkg.module
- https://stackoverflow.com/questions/42708484/what-is-the-module-package-json-field-for

However, seems like the whole system around ES modules evolved a bit differently (top level field `"type": "module"` + field `"exports"`), see:

- https://nodejs.org/api/packages.html
- https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
- https://babeljs.io/blog/2021/02/22/7.13.0#automatic-es-modules-in-babelruntime-12632httpsgithubcombabelbabelpull12632

This change is essentially a cleanup of our quirky and non-standard solution in order to be able to implement this modern approach.
@mrtnzlml mrtnzlml requested a review from a team as a code owner May 5, 2021 14:39
@vercel vercel bot temporarily deployed to Preview – universe-example-relay May 5, 2021 14:39 Inactive
@vercel vercel bot temporarily deployed to Preview – universe-example-relay May 5, 2021 14:39 Inactive
@mrtnzlml mrtnzlml mentioned this pull request May 5, 2021
11 tasks
@vercel vercel bot temporarily deployed to Preview – universe-sx-tailwind-website May 5, 2021 15:22 Inactive
@vercel vercel bot temporarily deployed to Preview – universe-example-relay May 5, 2021 15:22 Inactive
@vercel vercel bot temporarily deployed to Preview – universe-sx-tailwind-website May 5, 2021 15:58 Inactive
@vercel vercel bot temporarily deployed to Preview – universe-example-relay May 5, 2021 15:58 Inactive
@kodiakhq kodiakhq bot merged commit 4644aba into master May 5, 2021
@kodiakhq kodiakhq bot deleted the monorepo_npm_publisher_remove_module branch May 5, 2021 16:10
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 this pull request may close these issues.

2 participants