/
githubmr
/
facebook-react
Обзор
Документация
Войти
/
githubmr
/
facebook-react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-server-dom-esm/src/client/ReactFlightClientConfigTargetESMServer.js
35 строк
851 B
Josh Story
[Flight] reorganize code for forked entrypoints (#30702)
15 авг 2024, 04:10
Не верифицирован
15 авг 2024, 04:10
8b08ee0
Код
Авторство
О чём код?
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow */ import {preinitModuleForSSR} from 'react-client/src/ReactFlightClientConfig'; export type ModuleLoading = | null | string | { prefix: string, crossOrigin?: string, }; export function prepareDestinationForModuleImpl( moduleLoading: ModuleLoading, // Chunks are double-indexed [..., idx, filenamex, idy, filenamey, ...] mod: string, nonce: ?string, ) { if (typeof moduleLoading === 'string') { preinitModuleForSSR(moduleLoading + mod, nonce, undefined); } else if (moduleLoading !== null) { preinitModuleForSSR( moduleLoading.prefix + mod, nonce, moduleLoading.crossOrigin, ); } }