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

Function outlineTask

packages/react-server/src/ReactFlightServer.js:2056–2082  ·  view source on GitHub ↗
(request: Request, task: Task)

Source from the content-addressed store, hash-verified

2054}
2055
2056function outlineTask(request: Request, task: Task): ReactJSONValue {
2057 const newTask = createTask(
2058 request,
2059 task.model, // the currently rendering element
2060 task.keyPath, // unlike outlineModel this one carries along context
2061 task.implicitSlot,
2062 task.formatContext,
2063 request.abortableTasks,
2064 enableProfilerTimer &&
2065 (enableComponentPerformanceTrack || enableAsyncDebugInfo)
2066 ? task.time
2067 : 0,
2068 __DEV__ ? task.debugOwner : null,
2069 __DEV__ ? task.debugStack : null,
2070 __DEV__ ? task.debugTask : null,
2071 );
2072
2073 retryTask(request, newTask);
2074 if (newTask.status === COMPLETED) {
2075 // We completed synchronously so we can refer to this by reference. This
2076 // makes it behaves the same as prod during deserialization.
2077 return serializeByValueID(newTask.id);
2078 }
2079 // This didn't complete synchronously so it wouldn't have even if we didn't
2080 // outline it, so this would reduce to a lazy reference even in prod.
2081 return serializeLazyID(newTask.id);
2082}
2083
2084function outlineHaltedTask(
2085 request: Request,

Callers 3

renderFunctionComponentFunction · 0.85
renderFragmentFunction · 0.85
renderModelDestructiveFunction · 0.85

Calls 4

createTaskFunction · 0.85
serializeLazyIDFunction · 0.85
retryTaskFunction · 0.70
serializeByValueIDFunction · 0.70

Tested by

no test coverage detected