MCPcopy
hub / github.com/facebook/react / safelyEmitEarlyPreloads

Function safelyEmitEarlyPreloads

packages/react-server/src/ReactFizzServer.js:4898–4913  ·  view source on GitHub ↗
(
  request: Request,
  shellComplete: boolean,
)

Source from the content-addressed store, hash-verified

4896}
4897
4898function safelyEmitEarlyPreloads(
4899 request: Request,
4900 shellComplete: boolean,
4901): void {
4902 try {
4903 emitEarlyPreloads(
4904 request.renderState,
4905 request.resumableState,
4906 shellComplete,
4907 );
4908 } catch (error) {
4909 // We assume preloads are optimistic and thus non-fatal if errored.
4910 const errorInfo: ThrownInfo = {};
4911 logRecoverableError(request, error, errorInfo, null);
4912 }
4913}
4914
4915// I extracted this function out because we want to ensure we consistently emit preloads before
4916// transitioning to the next request stage and this transition can happen in multiple places in this

Callers 4

completeShellFunction · 0.85
completeAllFunction · 0.85

Calls 2

emitEarlyPreloadsFunction · 0.90
logRecoverableErrorFunction · 0.70

Tested by

no test coverage detected