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

QA improve checks #1969

Merged
merged 8 commits into from Oct 20, 2022
Merged

QA improve checks #1969

merged 8 commits into from Oct 20, 2022

Conversation

belgattitude
Copy link
Contributor

@belgattitude belgattitude commented Oct 20, 2022

I'd like to rework the (dual) packaging if possible. That is a continuation of #1966 (comment).

But before of that, I would like to ensure I have a correct baseline. So I introduced few things

  • a github action
  • a size-limit script (with webpack to follow possible tree-shakability regressions)
  • an ecmascript check (to prevent regressions in the build)

The size-limit might obsolete in bundlesize, I might remove later on.

Locally

npm install
npm run build
npm run check-size
npm run check-dist

Want to analyze the differences in bundles (esm, cjs):

npm run analyze-size

Will open the

image

We can already see that cjs does not tree-shake. Big opportunity cause by default nextjs will use it rather than esm.

@belgattitude belgattitude marked this pull request as draft October 20, 2022 14:51
@belgattitude
Copy link
Contributor Author

belgattitude commented Oct 20, 2022

this is a draft, I'll focus on this first:

image

import is es2021.

@belgattitude belgattitude marked this pull request as ready for review October 20, 2022 15:23
@adrai adrai merged commit 0c93b0e into i18next:master Oct 20, 2022
@belgattitude
Copy link
Contributor Author

belgattitude commented Oct 20, 2022

@adrai

I would like to merge this P/R and continue in a short time on different PR's

  • Improve exports (esm/cjs) to allow nextjs to actually use the esm one (will reduce bundle size).
  • Remove the unused './dist/es' build.

I found out some bugs in the code as well, I'll keep on my todo

@belgattitude
Copy link
Contributor Author

Ah thanks, you're faster than light 😄

@adrai
Copy link
Member

adrai commented Oct 20, 2022

fyi: github actions are failing

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.

None yet

2 participants