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(size-limit): test esm packages and update size-limit dep #1338

Merged
merged 1 commit into from
Jan 17, 2023

Conversation

timofei-iatsenko
Copy link
Collaborator

All bundlers actually consume ESM version of packages. CJS version is usually used by nodejs. So it's make more sense to test ESM versions for the size because it will bundled and shipped to the browser.

I had to rise the limit for @lingui/core package to 5.5kb. It's not related to CJS/ESM change, it's related to size-limit dependecy update. It uses fresher bundlers which generate a slightly bigger results for both targets (CJS/ESM) i've tested it both with esbuild and webpack bundlers.

@vercel
Copy link

vercel bot commented Jan 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
js-lingui ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 16, 2023 at 2:33PM (UTC)

@Martin005
Copy link
Contributor

@thekip What does the upgrading of size-limit bring us? The "import" config works in also in the previous version.
The only change I see is that our package has grown over 5 kB. And if that's the only impact it has, I think we should not update the size-limit package.

@timofei-iatsenko
Copy link
Collaborator Author

@Martin005 do you really understand how this package works? Please read the docs, and improve your understanding what exactly size-limit doing and where exactly this 5kb appeared.

@andrii-bodnar
Copy link
Contributor

@thekip please briefly explain it here

@timofei-iatsenko
Copy link
Collaborator Author

This change did not increase actual size of the package. This affects only reporting of the size by size-limit lib. It becomes more accurate because now uses fresher versions of bundlers to calculate a size.

@timofei-iatsenko
Copy link
Collaborator Author

Rebased to main and add "react" as "external". Because we assume every app which going to use @lingui/react would already have react in the bundle, so we should not take it into account in budget calculation.

@andrii-bodnar andrii-bodnar merged commit 9248f9c into lingui:main Jan 17, 2023
@timofei-iatsenko timofei-iatsenko deleted the chore/update-size-limit branch January 17, 2023 09:29
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