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

[colors] fix: output legacy ESM #6166

Closed
wants to merge 3 commits into from

Conversation

shim-flounce
Copy link
Contributor

@shim-flounce shim-flounce commented May 19, 2023

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

This PR adds the module field to package.json for legacy ESM (instead of exports which would potentially be a breaking change). To ensure backwards compatibility (e.g. someone importing from the lib directory), the CommonJS build will still go in the lib folder, although in the rest of the repo it goes in lib/cjs. Similarly, the ESM build will go into esm instead of lib/esm (because lib is already “taken”).

Reviewers should focus on:

Screenshot

shim-flounce

This comment was marked as resolved.

@adidahiya
Copy link
Contributor

@shim-flounce when did this break / regression occur?

@shim-flounce
Copy link
Contributor Author

@shim-flounce when did this break / regression occur?

Sorry, what do you mean? I think this package has never had an ESM output despite the fact that the script in package.json says compile:esm. The fact that it’s CommonJS can cause some bundling issues in Vite/Rollup when you use chunking (code splitting) - these tools are ESM-first and don’t handle CJS as well as they do ESM.

@adidahiya
Copy link
Contributor

If it was always broken, then let's just fix it for Blueprint v5 so we can ignore backcompat. Can you send a PR to the next branch and make the output folders match the other packages (lib/esm, lib/cjs, etc.)?

@shim-flounce
Copy link
Contributor Author

If it was always broken, then let's just fix it for Blueprint v5 so we can ignore backcompat. Can you send a PR to the next branch and make the output folders match the other packages (lib/esm, lib/cjs, etc.)?

I can do, but is there any chance this can be fixed in v4 as well?

@adidahiya
Copy link
Contributor

@shim-flounce ok, yeah, we should fix this in v4. I decided to do it with a change in file paths. Submodule paths of @blueprintjs/ packages are not part of the public API, so it's not a semantic breaking change. Closing in favor of #6179

@adidahiya adidahiya closed this May 24, 2023
@shim-flounce shim-flounce deleted the patch-2 branch May 24, 2023 22:43
@shim-flounce
Copy link
Contributor Author

Thank you @adidahiya!

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