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

chore(bueno): improve exports, externalize dependencies from bundles #4987

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

louis-bompart
Copy link
Collaborator

  • Remove top-level browser export specifier: this was not up to standard; see npm doc
  • Add conditional-exports to provide wide compability.
  • Externalize dependencies from the bundle:
    • It is expected that the final consumers of the package (i.e. those who push the bundles for the browser) do bundles.
    • Bundling in dependencies may create duplicate code in final consumer bundles
  • Move CDN/browser output outside packaged files (logic follow-up)

@louis-bompart louis-bompart force-pushed the chore/bueno-better-exports branch from b1eb26b to 48f0f09 Compare February 19, 2025 06:37
Copy link

github-actions bot commented Feb 19, 2025

Pull Request Report

PR Title

✅ Title follows the conventional commit spec.

Live demo links

Bundle Size

File Old (kb) New (kb) Change (%)
case-assist 243.7 243.7 0
commerce 355 355 0
search 415 415 0
insight 406.2 406.2 0
recommendation 255.9 255.9 0
ssr 408.8 408.8 0
ssr-commerce 372.7 372.7 0

@@ -29,6 +30,7 @@ function nodeEsm() {
return build({
...base,
platform: 'node',
packages: 'external',
Copy link
Contributor

Choose a reason for hiding this comment

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

bueno has no dependencies !

"types": "./dist/definitions/index.d.ts",
"import": "./dist/bueno.esm.js",
"require": "./dist/bueno.js",
"default": "./dist/bueno.js"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we put ESM as default ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought about it, but I think it might be breaking

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.

3 participants