Skip to content

Commit

Permalink
refactor inline runtime for style insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
gnoff committed Jan 16, 2023
1 parent 0c2c4a3 commit 8be28e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2556,13 +2556,11 @@ const styleInsertionFunction = stringToPrecomputedChunk(
);

const completeBoundaryScript1 = stringToPrecomputedChunk('$RC("');
const completeBoundaryWithStylesScript1 = stringToPrecomputedChunk(
'$RR(false,"',
);
const completeBoundaryWithStylesScript1 = stringToPrecomputedChunk('$RR($RC,"');

const completeContainerScript1 = stringToPrecomputedChunk('$RK("');
const completeContainerWithStylesScript1 = stringToPrecomputedChunk(
'$RR(true,"',
'$RR($RK,"',
);
const completeBoundaryOrContainerScript2 = stringToPrecomputedChunk('","');
const completeBoundaryOrContainerScript2a = stringToPrecomputedChunk('",');
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ export {clientRenderBoundary, completeBoundary, completeSegment};
// runtime (ReactDOMFizzInstructionSetExternalRuntime), with the exception of
// how we read completeBoundaryImpl and resourceMap
export function completeBoundaryWithStyles(
isContainer,
completionFn,
suspenseBoundaryID,
contentID,
styles,
) {
const completeBoundaryImpl = window[isContainer ? '$RK' : '$RC'];
const resourceMap = window['$RM'];

const precedences = new Map();
Expand Down Expand Up @@ -106,12 +105,12 @@ export function completeBoundaryWithStyles(
}

Promise.all(dependencies).then(
completeBoundaryImpl.bind(null, suspenseBoundaryID, contentID, ''),
completeBoundaryImpl.bind(
completionFn.bind(null, suspenseBoundaryID, contentID, ''),
completionFn.bind(
null,
suspenseBoundaryID,
contentID,
'Stylesheet failed to load',
'Stylesheet failed to load.',
),
);
}
Expand Down

0 comments on commit 8be28e5

Please sign in to comment.