-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix client reference keys of barrel-optimized files (#60685)
As Barrel Optimization might split one file into multiple different modules, i.e. when you import different values from it, the target file might be transformed differently, we can no longer rely on the file path as the identifier of the client reference. This fix adds a suffix (`'@' + this._module.matchResource`) to the identifier so it looks like `/filepath/file.js@__barrel_optimize__?names=Foo`. Here's also a quick diagram to explain: ![CleanShot-2024-01-16-QzlxzMKy@2x](https://github.com/vercel/next.js/assets/3676859/99f25975-b965-4ae0-91f2-269a6a0d7458) Closes #59804. Closes NEXT-2108. --------- Co-authored-by: Jiachi Liu <inbox@huozhi.im>
- Loading branch information
Showing
6 changed files
with
73 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 9 additions & 1 deletion
10
test/development/basic/barrel-optimization/fixture/app/mui/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
import { Button } from '@mui/material' | ||
import { Typography } from '@mui/material' | ||
|
||
export default function Page() { | ||
return <Button>test_mui</Button> | ||
return ( | ||
<div> | ||
<Button id="button">button</Button> | ||
<Typography id="typography" variant="h1"> | ||
typography | ||
</Typography> | ||
</div> | ||
) | ||
} |