MCPcopy
hub / github.com/react/react / outlineModelWithFormatContext

Function outlineModelWithFormatContext

packages/react-server/src/ReactFlightServer.js:2861–2883  ·  view source on GitHub ↗
(
  request: Request,
  value: ReactClientValue,
  formatContext: FormatContext,
)

Source from the content-addressed store, hash-verified

2859}
2860
2861function outlineModelWithFormatContext(
2862 request: Request,
2863 value: ReactClientValue,
2864 formatContext: FormatContext,
2865): number {
2866 const newTask = createTask(
2867 request,
2868 value,
2869 null, // The way we use outlining is for reusing an object.
2870 false, // It makes no sense for that use case to be contextual.
2871 formatContext, // Except for FormatContext we optimistically use it.
2872 request.abortableTasks,
2873 enableProfilerTimer &&
2874 (enableComponentPerformanceTrack || enableAsyncDebugInfo)
2875 ? performance.now() // TODO: This should really inherit the time from the task.
2876 : 0,
2877 null, // TODO: Currently we don't associate any debug information with
2878 null, // this object on the server. If it ends up erroring, it won't
2879 null, // have any context on the server but can on the client.
2880 );
2881 retryTask(request, newTask);
2882 return newTask.id;
2883}
2884
2885function serializeServerReference(
2886 request: Request,

Callers 2

renderElementFunction · 0.85
outlineModelFunction · 0.85

Calls 2

createTaskFunction · 0.85
retryTaskFunction · 0.70

Tested by

no test coverage detected