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

ESM distribution #2296

Merged
merged 2 commits into from
Mar 21, 2024
Merged

ESM distribution #2296

merged 2 commits into from
Mar 21, 2024

Conversation

Desplandis
Copy link
Contributor

@Desplandis Desplandis commented Mar 15, 2024

Description

Follow-up of #2256, this PR drops the CJS (CommonJS modules) distribution is favor of a standard ESM (ECMAScript) distribution.

Fixes #2256

Motivation and Context

#2252 bumped the web browser requirements. This guarantees that we now only support ESM-compatible browsers. Moreover, three.js is currently migrating to a pure ESM package.

TODOs

  • add the type: module field to the package.json
  • webpack config file.
  • eslint config files (loaded with require(), shall be .cjs)
  • unit tests.
  • functional tests (CJS to ESM syntax).
  • coverage tests (incompatibility with nyc, change to c8). Change coverage tool from nyc to c8 #2299
  • transpilation with babel.
  • documentation scripts (JSDoc publish.js is loaded with require() and shall be commonJS).
  • prepare script (already .mjs)
  • replace script (already .mjs)
  • changelog script (loaded with require(), shall be .cjs)
  • bump script (loaded with require(), shall be .cjs)

@Desplandis Desplandis changed the title feat: distribute itowns as ecmascript modules ESM Distribution Mar 21, 2024
@Desplandis Desplandis changed the title ESM Distribution ESM distribution Mar 21, 2024
@Desplandis Desplandis self-assigned this Mar 21, 2024
@Desplandis Desplandis force-pushed the migrate/esm branch 3 times, most recently from 0f7b8eb to 9bc5763 Compare March 21, 2024 15:43
@Desplandis Desplandis marked this pull request as ready for review March 21, 2024 15:52
Copy link
Contributor

@jailln jailln left a comment

Choose a reason for hiding this comment

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

Thanks!! 🚀

This includes:
- all scripts under the docs repository (publish.js is loaded with
  require())
- all eslintrc config scripts (loaded with require())
- grunt/bump script (loaded with require())
- conventional changelog script (loaded with require())
- webpack.config
BREAKING CHANGE: The itowns library drops the CommonJS distribution in favor of
a standard ECMAScript module (ESM) distribution.
@Desplandis Desplandis merged commit ab36885 into iTowns:master Mar 21, 2024
9 checks passed
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.

[Proposal - Requirements] Formalize web browsers requirements for iTowns
2 participants