Skip to content

refactor(flight): Centralise logic for generating module manifest keys #78517

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

Open
wants to merge 5 commits into
base: canary
Choose a base branch
from

Conversation

brhx
Copy link
Contributor

@brhx brhx commented Apr 24, 2025

Unifies resource-key generation via a shared getModuleResourceKey() helper, so client, server, and edge compilers reference modules with the same canonical string (path + query + barrel suffix, normalised + relative).

Removes bespoke key logic from the flight loader, client-entry, and manifest plugins; all delegate to the helper to avoid drift. The manifest now retains query strings for named module IDs (enabling userland "use client" virtual modules). This was used inconsistently before. Turbopack’s "use client" proxy also now includes ctx.query_str for parity.

Also a drive-by fix to make sure pluginState.edgeRscModules is actually used for edge RSC mapping.

@ijjk
Copy link
Member

ijjk commented Apr 24, 2025

Allow CI Workflow Run

  • approve CI run for commit: 7e37ae8

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@brhx brhx changed the title fix(flight): Isolate client modules by resource path *and* query fix(flight): Isolate client modules by resource query Apr 24, 2025
@brhx brhx force-pushed the client-module-query branch 22 times, most recently from d27a51d to 8afa648 Compare April 24, 2025 23:16
@brhx brhx changed the title fix(flight): Isolate client modules by resource query refactor(flight): Centralise module manifest key generation logic Apr 24, 2025
@brhx brhx changed the title refactor(flight): Centralise module manifest key generation logic refactor(flight): Centralise logic for generating module manifest keys Apr 24, 2025
@brhx brhx force-pushed the client-module-query branch from 8afa648 to 39521f1 Compare April 24, 2025 23:42
@brhx brhx marked this pull request as ready for review April 24, 2025 23:42
@brhx brhx force-pushed the client-module-query branch from 39521f1 to e6f4858 Compare April 25, 2025 00:05
@brhx brhx force-pushed the client-module-query branch 9 times, most recently from 623737b to f34488b Compare April 25, 2025 17:16
@brhx brhx force-pushed the client-module-query branch from 187f61e to e8562b4 Compare April 26, 2025 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants