Skip to content

Commit

Permalink
react-server entries may not exist in the bundles config but we want …
Browse files Browse the repository at this point in the history
…to treat them as existing for packaging purposes
  • Loading branch information
gnoff committed Apr 9, 2024
1 parent d50323e commit b6fa74f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 0 additions & 4 deletions packages/react-dom/src/ReactDOMSharedInternals.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,4 @@ const Internals: ReactDOMInternals = {
usingClientEntryPoint: false,
};

// if (__DEV__) {
// (Internals: any).usingClientEntryPoint = false;
// }

export default Internals;
12 changes: 12 additions & 0 deletions scripts/rollup/packaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,18 @@ function filterOutEntrypoints(name) {
hasBundle =
entryPointsToHasBundle.get(entry + '.node') ||
entryPointsToHasBundle.get(entry + '.browser');

// The .react-server and .rsc suffixes may not have a bundle representation but
// should infer their bundle status from the non-suffixed entry point.
if (entry.endsWith('.react-server')) {
hasBundle = entryPointsToHasBundle.get(
entry.slice(0, '.react-server'.length * -1)
);
} else if (entry.endsWith('.rsc')) {
hasBundle = entryPointsToHasBundle.get(
entry.slice(0, '.rsc'.length * -1)
);
}
}
if (hasBundle === undefined) {
// This doesn't exist in the bundles. It's an extra file.
Expand Down

0 comments on commit b6fa74f

Please sign in to comment.