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(cli): update esbuild #2187

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

wkillerud
Copy link

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 Feb 28, 2025 0:00am

Copy link

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
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.

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
2 participants