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(atomic, headless): make bueno external #4433

Merged
merged 17 commits into from
Sep 24, 2024
Merged

chore(atomic, headless): make bueno external #4433

merged 17 commits into from
Sep 24, 2024

Conversation

fpbrault
Copy link
Contributor

This PR makes bueno external in atomic and headless.

https://coveord.atlassian.net/browse/KIT-3551

Copy link

github-actions bot commented Sep 18, 2024

Pull Request Report

PR Title

✅ Title follows the conventional commit spec.

Live demo links

Bundle Size

File Old (kb) New (kb) Change (%)
case-assist 239.2 235.9 -1.4
commerce 338.1 339.1 0.3
search 407.7 409.5 0.4
insight 394.2 395.4 0.3
recommendation 250.1 248.5 -0.6
ssr 401.7 403.5 0.5
ssr-commerce 350.3 351.4 0.3

SSR Progress

Use case SSR (#) CSR (#) Progress (%)
search 39 44 89
recommendation 0 4 0
case-assist 0 6 0
insight 0 27 0
commerce 0 15 0
Detailed logs search : buildInteractiveResult
search : buildInteractiveInstantResult
search : buildInteractiveRecentResult
search : buildInteractiveCitation
search : buildGeneratedAnswer
recommendation : missing SSR support
case-assist : missing SSR support
insight : missing SSR support
commerce : missing SSR support

@louis-bompart louis-bompart added this to the V3 GA milestone Sep 18, 2024
@fpbrault fpbrault marked this pull request as ready for review September 19, 2024 20:19
@fpbrault fpbrault requested a review from a team as a code owner September 19, 2024 20:19
packages/atomic/scripts/externalPackageMappings.ts Outdated Show resolved Hide resolved
packages/atomic/.storybook/main.mts Outdated Show resolved Hide resolved
packages/atomic/scripts/externalPackageMappings.ts Outdated Show resolved Hide resolved
packages/atomic/.storybook/main.mts Outdated Show resolved Hide resolved
packages/atomic/.storybook/main.mts Outdated Show resolved Hide resolved
packages/atomic/package.json Outdated Show resolved Hide resolved
packages/atomic/stencil.config.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@alexprudhomme alexprudhomme left a comment

Choose a reason for hiding this comment

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

why is this needed again ? I don't see the point of externalizing bueno. If I were to make a library that uses zod for schema validation, I feel like I would bundle those validation functions with my library. This is not a framework headless and atomic depend on to work. This is a library for utility functions.

@fpbrault
Copy link
Contributor Author

why is this needed again ? I don't see the point of externalizing bueno. If I were to make a library that uses zod for schema validation, I feel like I would bundle those validation functions with my library. This is not a framework headless and atomic depend on to work. This is a library for utility functions.

The main reason to externalize Bueno was to avoid code duplication when a end-user bundles Atomic or Headless in their own project: https://coveord.atlassian.net/browse/KIT-3181 I dont know if there was other reasons @louis-bompart ?

@alexprudhomme
Copy link
Contributor

alexprudhomme commented Sep 23, 2024

why is this needed again ? I don't see the point of externalizing bueno. If I were to make a library that uses zod for schema validation, I feel like I would bundle those validation functions with my library. This is not a framework headless and atomic depend on to work. This is a library for utility functions.

The main reason to externalize Bueno was to avoid code duplication when a end-user bundles Atomic or Headless in their own project: https://coveord.atlassian.net/browse/KIT-3181 I dont know if there was other reasons @louis-bompart ?

But do users really install bueno ? If they don't, they should not have duplication right? I feel like bueno is more an internal package for us that we made before there were popular schema validation libraries like zod.

@fpbrault
Copy link
Contributor Author

why is this needed again ? I don't see the point of externalizing bueno. If I were to make a library that uses zod for schema validation, I feel like I would bundle those validation functions with my library. This is not a framework headless and atomic depend on to work. This is a library for utility functions.

The main reason to externalize Bueno was to avoid code duplication when a end-user bundles Atomic or Headless in their own project: https://coveord.atlassian.net/browse/KIT-3181 I dont know if there was other reasons @louis-bompart ?

But do users really install bueno ? If they don't, they should not have duplication right? I feel like bueno is more an internal package for us that we made before there were popular schema validation libraries like zod.

Thats a good point, I see ~20k weekly downloads on npmjs.org, but I would not be surprised if these are all from us/our CI...

@louis-bompart
Copy link
Collaborator

why is this needed again ? I don't see the point of externalizing bueno. If I were to make a library that uses zod for schema validation, I feel like I would bundle those validation functions with my library. This is not a framework headless and atomic depend on to work. This is a library for utility functions.

The main reason to externalize Bueno was to avoid code duplication when a end-user bundles Atomic or Headless in their own project: https://coveord.atlassian.net/browse/KIT-3181 I dont know if there was other reasons @louis-bompart ?

But do users really install bueno ? If they don't, they should not have duplication right? I feel like bueno is more an internal package for us that we made before there were popular schema validation libraries like zod.

Thats a good point, I see ~20k weekly downloads on npmjs.org, but I would not be surprised if these are all from us/our CI...

It is very unlikely that we have that many users for Bueno (, one of these days, we might want to consider putting the 🪓 into Bueno in favour of another mainstream library like Zod.

However, the concept/philosophy here still applies:

  • We want to externalize our dependencies for CDN users to facilitate chunking wherever possible and allow loading dependencies twice. In the present case, we see that Bueno is used by both Headless & Atomic, which means that if we don't externalize Bueno, CDN users will load it twice (is that a big deal, not much 'cause Bueno is very, very, very light)
  • We want to externalize our dependencies for NPM users to avoid them bundling the dependencies twice or more. Granted, in the case of Bueno, the chances are minimal, and the gains are abysmal.

@louis-bompart
Copy link
Collaborator

I took the liberty of fixing those poor tests (& removing a few cats from the code 😿). I peppered my changes with comments to explain the gist of it, can talk you thru tmrw if you want!
d2aa4e5

@fpbrault fpbrault enabled auto-merge (squash) September 24, 2024 15:07
@fpbrault fpbrault merged commit e1f7f2d into master Sep 24, 2024
117 checks passed
@fpbrault fpbrault deleted the KIT-3551 branch September 24, 2024 16:06
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.

4 participants