Remove CJS exports, go full ESM only#902
Open
daniel-heppner-ibigroup wants to merge 13 commits into
Open
Conversation
BREAKING CHANGE: This build removes CJS packages, OTP-UI is now ESM only. If you were importing from subdirectories like /lib/ or /esm/, you must now use /dist/, following Javascript packaging convention.
Contributor
Author
|
So what's going on with the snapshot changes? From what I can tell the changes are 100% styled component classnames. Styled components is super annoying because the classnames are generated by a babel plugin that uses a hashing function on a bunch of inputs, including the file path that is given to it by vite. Apparently Vite does some optimization step in a random directory, and although it's not supposed to happen on monorepo packages, it doesn't correctly exclude ours since pnpm symlinks them into node_modules. So manually adding all our monorepo packages to the exclude list in storybook's main.js ensures that these files have a constant path for styled components. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a major breaking change, it removes CJS exports and goes full ESM only.
I also moved the export to /dist, which is the standard output directory for build artifacts in npm. This could cause problems for anyone using a hack to import files from inside the packages.