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

fix(atomic-react): remove traces of npm imports #4581

Merged
merged 6 commits into from
Oct 28, 2024
Merged

Conversation

alexprudhomme
Copy link
Contributor

@alexprudhomme alexprudhomme commented Oct 22, 2024

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

This PR main goal is to fix the ESM output in the CDN by removing the traces of npm imports.

This is achieved by two things.

  1. Bundle all of atomic-react (both esm and cjs module) in rollup. Before esm was bundled with tsc and cjs with rollup.

before 😆

graph TD;
    rollup-->CJS;
    tsc-->ESM;
    tsc-->types;
Loading

after 😆

graph TD;
    rollup-->CJS;
    rollup-->ESM;
    tsc-->types;
Loading

This is the current state of the dist folder.

dist/
├── cjs/
│   ├── atomic-react.cjs
│   ├── recommendation/
│   │   └── atomic-react.cjs
│   └── commerce/
│       └── atomic-react.cjs
├── esm/
│   ├── atomic-react.mjs
│   ├── recommendation/
│   │   └── atomic-react.mjs
│   └── commerce/
│       └── atomic-react.mjs
└── types/
    ├── index.d.ts
    ├── recommendation.index.d.ts
    ├── commerce.index.d.ts
    └── components/
        └── ...
  1. Add @coveo/atomic/loader to the list of cdn externalizations. https://github.com/coveo/ui-kit/pull/4581/files#r1812922022

  2. Fix the ouptput in the CDN it now looks something like this for the proper files :

image

@alexprudhomme alexprudhomme marked this pull request as ready for review October 23, 2024 14:44
@alexprudhomme alexprudhomme requested a review from a team as a code owner October 23, 2024 14:44
Copy link

github-actions bot commented Oct 23, 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 236.6 236.6 0
commerce 341.5 341.5 0
search 412.3 412.3 0
insight 401.6 401.6 0
recommendation 248.8 248.8 0
ssr 406 406 0
ssr-commerce 353.6 353.6 0

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

Base automatically changed from KIT-3666 to master October 24, 2024 00:02
Copy link
Collaborator

@louis-bompart louis-bompart left a comment

Choose a reason for hiding this comment

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

VG PR 👍

Copy link
Contributor

@fpbrault fpbrault left a comment

Choose a reason for hiding this comment

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

Nice job!

Merged via the queue into master with commit 599b36f Oct 28, 2024
100 checks passed
@alexprudhomme alexprudhomme deleted the KIT-3659 branch October 28, 2024 15:20
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