/
githubmr
/
facebook-react
Обзор
Документация
Войти
/
githubmr
/
facebook-react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetExternalRuntime.js
44 строки
1 KB
Sebastian Markbåge
[Fizz] Wrap revealCompletedBoundaries in a ViewTransitions aware version (#33293)
18 май 2025, 01:18
Не верифицирован
18 май 2025, 01:18
6060367
Код
Авторство
О чём код?
/* eslint-disable dot-notation */ // Instruction set for the Fizz external runtime import { clientRenderBoundary, completeBoundary, completeBoundaryWithStyles, completeSegment, listenToFormSubmissionsForReplaying, revealCompletedBoundaries, revealCompletedBoundariesWithViewTransitions, } from './ReactDOMFizzInstructionSetShared'; // This is a string so Closure's advanced compilation mode doesn't mangle it. // These will be renamed to local references by the external-runtime-plugin. window['$RM'] = new Map(); window['$RB'] = []; window['$RX'] = clientRenderBoundary; window['$RV'] = revealCompletedBoundariesWithViewTransitions.bind( null, revealCompletedBoundaries, ); window['$RC'] = completeBoundary; window['$RR'] = completeBoundaryWithStyles; window['$RS'] = completeSegment; listenToFormSubmissionsForReplaying(); // Track the paint time of the shell. const entries = performance.getEntriesByType ? performance.getEntriesByType('paint') : []; if (entries.length > 0) { // We might have already painted before this external runtime loaded. In that case we // try to get the first paint from the performance metrics to avoid delaying further // than necessary. window['$RT'] = entries[0].startTime; } else { // Otherwise we wait for the next rAF for it. requestAnimationFrame(() => { window['$RT'] = performance.now(); }); }