Skip to content

fix(@formatjs/unplugin): strip query/hash in transformInclude#6465

Merged
longlho merged 1 commit intomainfrom
fix/unplugin-transform-include-query-6455
Apr 29, 2026
Merged

fix(@formatjs/unplugin): strip query/hash in transformInclude#6465
longlho merged 1 commit intomainfrom
fix/unplugin-transform-include-query-6455

Conversation

@longlho
Copy link
Copy Markdown
Member

@longlho longlho commented Apr 29, 2026

Summary

  • React Router splits routes that export clientLoader/clientAction into virtual chunk modules with IDs like route.tsx?route-chunk=main. The plain \.[jt]sx?$ test in transformInclude rejected those, so defineMessage calls in those chunks never got their id injected during production builds.
  • Strip ?… and #… off the id before the extension check.
  • Added a regression test covering query-string and hash IDs (and the negative node_modules case with a query).

Fixes #6455

Test plan

  • bazel test //packages/unplugin/... — all tests pass, including the new regression case
  • CI green

🤖 Generated with Claude Code

React Router splits routes that export clientLoader/clientAction into
virtual chunk modules with IDs like `route.tsx?route-chunk=main`. The
plain `\.[jt]sx?$` test rejected those, so defineMessage calls in
those chunks never got their id injected during production builds.

Strip `?…` and `#…` off the id before the extension check.

Fixes #6455

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@longlho longlho enabled auto-merge April 29, 2026 15:21
@longlho longlho added this pull request to the merge queue Apr 29, 2026
Merged via the queue into main with commit 2fcf7f3 Apr 29, 2026
3 checks passed
@longlho longlho deleted the fix/unplugin-transform-include-query-6455 branch April 29, 2026 15:26
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.

transformInclude should ignore query parameters

1 participant