Skip to content

fix(macro): recrawl scope only if useLingui was used#2370

Merged
andrii-bodnar merged 1 commit intomainfrom
fix/rebuild-bindings-performance
Nov 25, 2025
Merged

fix(macro): recrawl scope only if useLingui was used#2370
andrii-bodnar merged 1 commit intomainfrom
fix/rebuild-bindings-performance

Conversation

@timofei-iatsenko
Copy link
Copy Markdown
Collaborator

Description

Probably i introduced a huge performance regression when added scope recrawling in #2356

The scope recrawling happened for all CallExpression|TaggedTemplateExpression despite was it a macro or not, or was it a useLingui hook which actually need a recrawling a bindnings.

This PR fixes that by moving scope recrawling to only when useLingui hook was transpiled.

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

Potentially fixes #2369

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)

@vercel
Copy link
Copy Markdown

vercel bot commented Nov 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
js-lingui Ready Ready Preview Nov 25, 2025 8:13am

@github-actions
Copy link
Copy Markdown

size-limit report 📦

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

Copy link
Copy Markdown
Contributor

@andrii-bodnar andrii-bodnar left a comment

Choose a reason for hiding this comment

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

@timofei-iatsenko thank you!

@andrii-bodnar andrii-bodnar merged commit 9fd8b84 into main Nov 25, 2025
9 checks passed
@andrii-bodnar andrii-bodnar deleted the fix/rebuild-bindings-performance branch November 25, 2025 09:12
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.

Performance regression in @lingui/cli version 5.5.2

2 participants