Skip to content

fix(cli): update esbuild #2187

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

Merged
merged 1 commit into from
Mar 24, 2025
Merged

fix(cli): update esbuild #2187

merged 1 commit into from
Mar 24, 2025

Conversation

wkillerud
Copy link
Contributor

Description

Opening this PR as a draft to track a fix for #2181

It seems the CLI is affected by evanw/esbuild#4070

The source map at babel.ts with earlier versions of esbuild includes the path, but at 0.25.0 it only includes the file name. This breaks the mapping from the built bundle to the source in the experimental extractor, leading to the wrong file name in the extracted .po files.

const t = fromSource(code).toObject()
sourceMapsConsumer = await new SourceMapConsumer(t)

2025-02-28 at 12 52 01@2x
2025-02-28 at 12 53 14@2x

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Examples update

Fixes #2181

Checklist

  • I have read the CONTRIBUTING and CODE_OF_CONDUCT docs
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

Copy link

vercel bot commented Feb 28, 2025

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

Name Status Preview Updated (UTC)
js-lingui ✅ Ready (Inspect) Visit Preview Mar 21, 2025 8:37pm

Copy link

github-actions bot commented Feb 28, 2025

size-limit report 📦

Path Size
packages/core/dist/index.mjs 2.91 KB (0%)
packages/detect-locale/dist/index.mjs 618 B (0%)
packages/react/dist/index.mjs 1.35 KB (0%)

@timofei-iatsenko
Copy link
Collaborator

Thanks for digging into this. Let's wait for the fix from the esbuild side.

Meanwhile, do you use this extractor on production? I want to gather more real-life feedback about it. Would appreciate if you share your experience, what was good or bad, what configuration you might want to change, etc.

@wkillerud
Copy link
Contributor Author

Meanwhile, do you use this extractor on production?

I don't, no. I didn't really know about it until I started investigating for this version bump 😅 I see now that it's mentioned on a couple of pages in the docs (and a blogpost), but not on the CLI reference.

At my employer's we typically split smaller collections of routes in completely separate apps. Multi-page, but multi-app, if you will. So our translation file sizes have been manageable with the current extractor.

Still, I might give the experimental one a go now that I know about it.

@wkillerud wkillerud marked this pull request as ready for review March 21, 2025 20:36
@wkillerud
Copy link
Contributor Author

The regression with source maps got patched in 0.25.1. Tests pass on localhost 👍

Copy link

codecov bot commented Mar 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.79%. Comparing base (6bb8983) to head (436da13).
Report is 181 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2187      +/-   ##
==========================================
- Coverage   77.05%   76.79%   -0.27%     
==========================================
  Files          84       88       +4     
  Lines        2157     2486     +329     
  Branches      555      647      +92     
==========================================
+ Hits         1662     1909     +247     
- Misses        382      462      +80     
- Partials      113      115       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@timofei-iatsenko timofei-iatsenko self-requested a review March 24, 2025 14:03
@timofei-iatsenko
Copy link
Collaborator

@andrii-bodnar this PR is approved

@andrii-bodnar andrii-bodnar merged commit 643a604 into lingui:main Mar 24, 2025
11 checks passed
@wkillerud wkillerud deleted the 2181-esbuild branch March 25, 2025 07:48
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.

Update esbuild dependency in lingui/cli to ^0.25.0
3 participants