Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
This change transitions the package to be distributed as an ESM (ECMAScript Module) instead of CommonJS. The main change is the output of ESM-compatible code by the TypeScript compiler and the modification of the module type in
package.json
.Given that most bundlers now support ESM-distributed packages, I decided to forgo adding backward compatibility for CommonJS.
BREAKING CHANGE: The package is now distributed as an ESM module
Why
The combination of CommonJS and Vite caused problems when introducing rxbeach in surveys (see: https://github.com/ardoq/ardoq-packages/pull/6393). Changing to ESM seems to have fixed the problem.
Test
I've tested the changes in both
ardoq-surveys
andardoq-front
with the help of https://github.com/mweststrate/relative-deps. Will deploy and test in the test environment once released.