mirror of
https://github.com/facebook/react.git
synced 2026-02-24 04:33:04 +00:00
The idea here is that host dispatchers are not bound to renders so we need to be able to dispatch to them at any time. This updates the implementation to chain these dispatchers so that each renderer can respond to the dispatch. Semantically we don't always want every renderer to do this for instance if Fizz handles a float method we don't want Fiber to as well so each dispatcher implementation can decide if it makes sense to forward the call or not. For float methods server disaptchers will handle the call if they can resolve a Request otherwise they will forward. For client dispatchers they will handle the call and always forward. The choice needs to be made for each dispatcher method and may have implications on correct renderer import order. For now we just live with the restriction that if you want to use server and client together (such as renderToString in the browser) you need to import the server renderer after the client renderer.
26 lines
1.0 KiB
JavaScript
26 lines
1.0 KiB
JavaScript
/**
|
|
* 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
|
|
*/
|
|
|
|
declare var $$$config: any;
|
|
|
|
export opaque type ClientManifest = mixed;
|
|
export opaque type ClientReference<T> = mixed; // eslint-disable-line no-unused-vars
|
|
export opaque type ServerReference<T> = mixed; // eslint-disable-line no-unused-vars
|
|
export opaque type ClientReferenceMetadata: any = mixed;
|
|
export opaque type ServerReferenceId: any = mixed;
|
|
export opaque type ClientReferenceKey: any = mixed;
|
|
export const isClientReference = $$$config.isClientReference;
|
|
export const isServerReference = $$$config.isServerReference;
|
|
export const getClientReferenceKey = $$$config.getClientReferenceKey;
|
|
export const resolveClientReferenceMetadata =
|
|
$$$config.resolveClientReferenceMetadata;
|
|
export const getServerReferenceId = $$$config.getServerReferenceId;
|
|
export const getServerReferenceBoundArguments =
|
|
$$$config.getServerReferenceBoundArguments;
|