test-renderer 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Universal Test Renderer for React
1
+ # Test Renderer for React
2
2
 
3
3
  A lightweight, JavaScript-only replacement for the deprecated React Test Renderer.
4
4
 
package/dist/index.cjs CHANGED
@@ -318,10 +318,12 @@ var hostConfig = {
318
318
  * throw here.
319
319
  */
320
320
  createTextInstance(text, rootContainer, hostContext, _internalHandle) {
321
- if (rootContainer.config.textComponents && !hostContext.isInsideText) {
321
+ var _a;
322
+ if (rootContainer.config.textComponentTypes && !hostContext.isInsideText) {
323
+ const componentTypes = (_a = rootContainer.config.publicTextComponentTypes) != null ? _a : rootContainer.config.textComponentTypes;
322
324
  throw new Error(
323
325
  `Invariant Violation: Text strings must be rendered within a ${formatComponentList(
324
- rootContainer.config.textComponents
326
+ componentTypes
325
327
  )} component. Detected attempt to render "${text}" string within a <${hostContext.type}> component.`
326
328
  );
327
329
  }
@@ -426,7 +428,7 @@ var hostConfig = {
426
428
  */
427
429
  getChildHostContext(parentHostContext, type) {
428
430
  var _a;
429
- const isInsideText = Boolean((_a = parentHostContext.config.textComponents) == null ? void 0 : _a.includes(type));
431
+ const isInsideText = Boolean((_a = parentHostContext.config.textComponentTypes) == null ? void 0 : _a.includes(type));
430
432
  return __spreadProps(__spreadValues({}, parentHostContext), { type, isInsideText });
431
433
  },
432
434
  /**
@@ -814,7 +816,8 @@ function createRoot(options) {
814
816
  children: [],
815
817
  isHidden: false,
816
818
  config: {
817
- textComponents: options == null ? void 0 : options.textComponents,
819
+ textComponentTypes: options == null ? void 0 : options.textComponentTypes,
820
+ publicTextComponentTypes: options == null ? void 0 : options.publicTextComponentTypes,
818
821
  createNodeMock: (_a = options == null ? void 0 : options.createNodeMock) != null ? _a : defaultCreateMockNode
819
822
  }
820
823
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/renderer.ts","../src/constants.ts","../src/query-all.ts","../src/render-to-json.ts","../src/host-element.ts","../src/reconciler.ts","../src/utils.ts"],"sourcesContent":["export { createRoot } from \"./renderer\";\n\nexport type { Root, RootOptions, ErrorHandler, ErrorInfo } from \"./renderer\";\nexport type { HostElement, HostElementProps, HostNode } from \"./host-element\";\nexport type { JsonElement, JsonNode } from \"./render-to-json\";\nexport type { QueryOptions } from \"./query-all\";\n\n/**\n * React Fiber type from react-reconciler. Exported for advanced use cases only.\n * This type represents internal React structures that may change without warning.\n * Prefer using the stable HostElement API instead.\n */\nexport type { Fiber } from \"react-reconciler\";\n","import type { ReactElement } from \"react\";\nimport { ConcurrentRoot } from \"react-reconciler/constants\";\n\nimport { Tag } from \"./constants\";\nimport { HostElement } from \"./host-element\";\nimport type { Container } from \"./reconciler\";\nimport { TestReconciler } from \"./reconciler\";\n\n// Refs:\n// https://github.com/facebook/react/blob/main/packages/react-test-renderer/src/ReactFiberConfigTestHost.js\n// https://github.com/facebook/react/blob/main/packages/react-noop-renderer/src/createReactNoop.js\n// https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactFiberConfigFabric.js\n\nconst defaultCreateMockNode = () => ({});\n\nconst defaultOnUncaughtError = (error: unknown, errorInfo: ErrorInfo) => {\n console.error(\"Uncaught error:\", error, errorInfo);\n};\nconst defaultOnCaughtError = (error: unknown, errorInfo: ErrorInfo) => {\n console.error(\"Caught error:\", error, errorInfo);\n};\nconst defaultOnRecoverableError = (error: unknown, errorInfo: ErrorInfo) => {\n console.error(\"Recoverable error:\", error, errorInfo);\n};\n\n/**\n * Options for configuring the test renderer root.\n */\nexport type RootOptions = {\n /** Types of valid text components. */\n textComponents?: string[];\n\n /** Function to create mock nodes for refs. */\n createNodeMock?: (element: ReactElement) => object;\n\n /** Callback called when React catches an error in an Error Boundary. Called with the error caught by the Error Boundary, and an errorInfo object containing the componentStack. */\n onCaughtError?: ErrorHandler;\n\n /** Callback called when an error is thrown and not caught by an Error Boundary. Called with the error that was thrown, and an errorInfo object containing the componentStack. */\n onUncaughtError?: ErrorHandler;\n\n /** Callback called when React automatically recovers from errors. Called with an error React throws, and an errorInfo object containing the componentStack. Some recoverable errors may include the original error cause as error.cause. */\n onRecoverableError?: ErrorHandler;\n\n /** A string prefix React uses for IDs generated by useId. Useful to avoid conflicts when using multiple roots on the same page. */\n identifierPrefix?: string;\n\n /** Enable React Strict Mode. */\n isStrictMode?: boolean;\n};\n\n/** Callback for handling React errors. */\nexport type ErrorHandler = (error: unknown, errorInfo: ErrorInfo) => void;\n\n/** Error information provided to error handlers. */\nexport type ErrorInfo = {\n componentStack: string;\n};\n\n/**\n * Root instance returned by createRoot. Provides methods to render and unmount components.\n */\nexport type Root = {\n /** Render a React element into the root. Must be called within act(). */\n render: (element: ReactElement) => void;\n /** Unmount the root and clean up. Must be called within act(). */\n unmount: () => void;\n /** The root container element. */\n container: HostElement;\n};\n\n/**\n * Create a new test renderer root instance.\n *\n * @param options - Optional configuration for the renderer.\n * @returns A Root instance with render, unmount, and container properties.\n */\nexport function createRoot(options?: RootOptions): Root {\n let container: Container | null = {\n tag: Tag.Container,\n parent: null,\n children: [],\n isHidden: false,\n config: {\n textComponents: options?.textComponents,\n createNodeMock: options?.createNodeMock ?? defaultCreateMockNode,\n },\n };\n\n // @types/react-reconciler types don't fully match react-reconciler's actual Flow types.\n // The return type is correct at runtime but TypeScript can't verify it statically.\n // Correctness is verified through tests.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n let containerFiber = TestReconciler.createContainer(\n container,\n ConcurrentRoot,\n null, // hydrationCallbacks\n options?.isStrictMode ?? false,\n false, // concurrentUpdatesByDefaultOverride\n options?.identifierPrefix ?? \"\",\n options?.onUncaughtError ?? defaultOnUncaughtError,\n options?.onCaughtError ?? defaultOnCaughtError,\n // @ts-expect-error @types/react-reconciler types don't include onRecoverableError parameter\n // in the createContainer signature, but react-reconciler's actual Flow types do.\n // Correctness is verified through tests.\n options?.onRecoverableError ?? defaultOnRecoverableError,\n null, // transitionCallbacks\n );\n\n const render = (element: ReactElement) => {\n if (containerFiber == null) {\n throw new Error(\"Cannot render after unmount\");\n }\n\n TestReconciler.updateContainer(element, containerFiber, null, null);\n };\n\n const unmount = () => {\n if (container == null) {\n return;\n }\n\n TestReconciler.updateContainer(null, containerFiber, null, null);\n\n containerFiber = null;\n container = null;\n };\n\n return {\n render,\n unmount,\n get container(): HostElement {\n if (container == null) {\n throw new Error(\"Cannot access .container on unmounted test renderer\");\n }\n\n return HostElement.fromInstance(container);\n },\n };\n}\n","export const Tag = {\n Container: \"CONTAINER\",\n Instance: \"INSTANCE\",\n Text: \"TEXT\",\n} as const;\n\n// Container should render as <>{...}</>\nexport const CONTAINER_TYPE = \"\";\n","import type { HostElement } from \"./host-element\";\n\n/**\n * Options for querying elements in the rendered tree.\n */\nexport interface QueryOptions {\n /** Include the element itself in the results if it matches the predicate. Defaults to false. */\n includeSelf?: boolean;\n\n /** Exclude any ancestors of deepest matched elements even if they match the predicate. Defaults to false. */\n matchDeepestOnly?: boolean;\n}\n\n/**\n * Find all descendant elements matching the predicate.\n *\n * @param element - Root element to search from.\n * @param predicate - Function that returns true for matching elements.\n * @param options - Optional query configuration.\n * @returns Array of matching elements in tree order.\n */\nexport function queryAll(\n element: HostElement,\n predicate: (element: HostElement) => boolean,\n options?: QueryOptions,\n): HostElement[] {\n const includeSelf = options?.includeSelf ?? false;\n const matchDeepestOnly = options?.matchDeepestOnly ?? false;\n\n const results: HostElement[] = [];\n\n // Match descendants first but do not add them to results yet.\n const matchingDescendants: HostElement[] = [];\n\n element.children.forEach((child) => {\n if (typeof child === \"string\") {\n return;\n }\n\n matchingDescendants.push(...queryAll(child, predicate, { ...options, includeSelf: true }));\n });\n\n if (\n includeSelf &&\n // When matchDeepestOnly = true: add current element only if no descendants match\n (matchingDescendants.length === 0 || !matchDeepestOnly) &&\n predicate(element)\n ) {\n results.push(element);\n }\n\n // Add matching descendants after element to preserve original tree walk order.\n results.push(...matchingDescendants);\n\n return results;\n}\n","import { CONTAINER_TYPE, Tag } from \"./constants\";\nimport type { Container, Instance, TextInstance } from \"./reconciler\";\n\n/** A node in the JSON representation - either a JsonElement or a text string. */\nexport type JsonNode = JsonElement | string;\n\n/**\n * JSON representation of a rendered element, compatible with react-test-renderer format.\n */\nexport type JsonElement = {\n type: string;\n props: object;\n children: Array<JsonNode> | null;\n $$typeof: symbol;\n};\n\nexport function renderContainerToJson(instance: Container): JsonElement {\n return {\n type: CONTAINER_TYPE,\n props: {},\n children: renderChildrenToJson(instance.children),\n $$typeof: Symbol.for(\"react.test.json\"),\n };\n}\n\nexport function renderInstanceToJson(instance: Instance): JsonElement | null {\n if (instance.isHidden) {\n return null;\n }\n\n // We don't include the `children` prop in JSON.\n // Instead, we will include the actual rendered children.\n const { children: _children, ...restProps } = instance.props;\n\n return {\n type: instance.type,\n props: restProps,\n children: renderChildrenToJson(instance.children),\n $$typeof: Symbol.for(\"react.test.json\"),\n };\n}\n\nexport function renderTextInstanceToJson(instance: TextInstance): string | null {\n if (instance.isHidden) {\n return null;\n }\n\n return instance.text;\n}\n\nexport function renderChildrenToJson(children: Array<Instance | TextInstance>): JsonNode[] {\n const result = [];\n\n for (const child of children) {\n if (child.tag === Tag.Instance) {\n const renderedChild = renderInstanceToJson(child);\n if (renderedChild !== null) {\n result.push(renderedChild);\n }\n } else {\n const renderedChild = renderTextInstanceToJson(child);\n if (renderedChild !== null) {\n result.push(renderedChild);\n }\n }\n }\n\n return result;\n}\n","import type { Fiber } from \"react-reconciler\";\n\nimport { CONTAINER_TYPE, Tag } from \"./constants\";\nimport type { QueryOptions } from \"./query-all\";\nimport { queryAll } from \"./query-all\";\nimport type { Container, Instance, TextInstance } from \"./reconciler\";\nimport type { JsonElement } from \"./render-to-json\";\nimport { renderContainerToJson, renderInstanceToJson } from \"./render-to-json\";\n\n/** A node in the rendered tree - either a HostElement or a text string. */\nexport type HostNode = HostElement | string;\n\n/** Props object for a host element. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type HostElementProps = Record<string, any>;\n\nconst instanceMap = new WeakMap<Instance | Container, HostElement>();\n\n/**\n * Represents a rendered host element in the test renderer tree.\n * Provides a DOM-like API for querying and inspecting rendered components.\n */\nexport class HostElement {\n private instance: Instance | Container;\n\n private constructor(instance: Instance | Container) {\n this.instance = instance;\n }\n\n /** The element type (e.g., \"div\", \"span\"). Empty string for container. */\n get type(): string {\n return this.instance.tag === Tag.Instance ? this.instance.type : CONTAINER_TYPE;\n }\n\n /** The element's props object. */\n get props(): HostElementProps {\n return this.instance.tag === Tag.Instance ? this.instance.props : {};\n }\n\n /** The parent element, or null if this is the root container. */\n get parent(): HostElement | null {\n const parentInstance = this.instance.parent;\n if (parentInstance == null) {\n return null;\n }\n\n return HostElement.fromInstance(parentInstance);\n }\n\n /** Array of child nodes (elements and text strings). Hidden children are excluded. */\n get children(): HostNode[] {\n const result = this.instance.children\n .filter((child) => !child.isHidden)\n .map((child) => getHostNodeForInstance(child));\n return result;\n }\n\n /**\n * Access to the underlying React Fiber node. This is an unstable API that exposes\n * internal react-reconciler structures which may change without warning in future\n * React versions. Use with caution and only when absolutely necessary.\n *\n * @returns The Fiber node for this instance, or null if this is a container.\n */\n get unstable_fiber(): Fiber | null {\n return this.instance.tag === Tag.Instance ? this.instance.unstable_fiber : null;\n }\n\n /**\n * Convert this element to a JSON representation suitable for snapshots.\n *\n * @returns JSON element or null if the element is hidden.\n */\n toJSON(): JsonElement | null {\n return this.instance.tag === Tag.Container\n ? renderContainerToJson(this.instance)\n : renderInstanceToJson(this.instance);\n }\n\n /**\n * Find all descendant elements matching the predicate.\n *\n * @param predicate - Function that returns true for matching elements.\n * @param options - Optional query configuration.\n * @returns Array of matching elements.\n */\n queryAll(\n predicate: (element: HostElement, options?: QueryOptions) => boolean,\n options?: QueryOptions,\n ): HostElement[] {\n return queryAll(this, predicate, options);\n }\n\n /** @internal */\n static fromInstance(instance: Instance | Container): HostElement {\n const hostElement = instanceMap.get(instance);\n if (hostElement) {\n return hostElement;\n }\n\n const result = new HostElement(instance);\n instanceMap.set(instance, result);\n return result;\n }\n}\n\nfunction getHostNodeForInstance(instance: Instance | TextInstance): HostNode {\n switch (instance.tag) {\n case Tag.Text:\n return instance.text;\n\n case Tag.Instance:\n return HostElement.fromInstance(instance);\n }\n}\n","import type { ReactElement } from \"react\";\nimport type { Fiber } from \"react-reconciler\";\nimport ReactReconciler from \"react-reconciler\";\nimport { DefaultEventPriority, NoEventPriority } from \"react-reconciler/constants\";\n\nimport { Tag } from \"./constants\";\nimport { formatComponentList } from \"./utils\";\n\nexport type Type = string;\nexport type Props = Record<string, unknown>;\n\ntype ReconcilerConfig = {\n textComponents?: string[];\n createNodeMock: (element: ReactElement) => object;\n};\n\nexport type Container = {\n tag: typeof Tag.Container;\n parent: null;\n children: Array<Instance | TextInstance>;\n isHidden: false;\n config: ReconcilerConfig;\n};\n\nexport type Instance = {\n tag: typeof Tag.Instance;\n type: string;\n props: Props;\n children: Array<Instance | TextInstance>;\n parent: Container | Instance | null;\n rootContainer: Container;\n isHidden: boolean;\n unstable_fiber: Fiber;\n};\n\nexport type TextInstance = {\n tag: typeof Tag.Text;\n text: string;\n parent: Container | Instance | null;\n isHidden: boolean;\n};\n\nexport type SuspenseInstance = object;\nexport type HydratableInstance = object;\nexport type PublicInstance = object | TextInstance;\nexport type UpdatePayload = unknown;\nexport type ChildSet = unknown;\nexport type TimeoutHandle = unknown;\nexport type NoTimeout = unknown;\n\ntype HostContext = {\n type: string;\n isInsideText: boolean;\n config: ReconcilerConfig;\n};\n\nconst nodeToInstanceMap = new WeakMap<object, Instance>();\n\nlet currentUpdatePriority: number = NoEventPriority;\n\nconst hostConfig: ReactReconciler.HostConfig<\n Type,\n Props,\n Container,\n Instance,\n TextInstance,\n SuspenseInstance,\n HydratableInstance,\n PublicInstance,\n HostContext,\n UpdatePayload,\n ChildSet,\n TimeoutHandle,\n NoTimeout\n> = {\n /**\n * The reconciler has two modes: mutation mode and persistent mode. You must specify one of them.\n *\n * If your target platform is similar to the DOM and has methods similar to `appendChild`, `removeChild`,\n * and so on, you'll want to use the **mutation mode**. This is the same mode used by React DOM, React ART,\n * and the classic React Native renderer.\n *\n * ```js\n * const HostConfig = {\n * // ...\n * supportsMutation: true,\n * // ...\n * }\n * ```\n *\n * Depending on the mode, the reconciler will call different methods on your host config.\n * If you're not sure which one you want, you likely need the mutation mode.\n */\n supportsMutation: true,\n\n /**\n * The reconciler has two modes: mutation mode and persistent mode. You must specify one of them.\n *\n * If your target platform has immutable trees, you'll want the **persistent mode** instead. In that mode,\n * existing nodes are never mutated, and instead every change clones the parent tree and then replaces\n * the whole parent tree at the root. This is the node used by the new React Native renderer, codenamed \"Fabric\".\n *\n * ```js\n * const HostConfig = {\n * // ...\n * supportsPersistence: true,\n * // ...\n * }\n * ```\n *\n * Depending on the mode, the reconciler will call different methods on your host config.\n * If you're not sure which one you want, you likely need the mutation mode.\n */\n supportsPersistence: false,\n\n /**\n * #### `createInstance(type, props, rootContainer, hostContext, internalHandle)`\n *\n * This method should return a newly created node. For example, the DOM renderer would call\n * `document.createElement(type)` here and then set the properties from `props`.\n *\n * You can use `rootContainer` to access the root container associated with that tree. For example,\n * in the DOM renderer, this is useful to get the correct `document` reference that the root belongs to.\n *\n * The `hostContext` parameter lets you keep track of some information about your current place in\n * the tree. To learn more about it, see `getChildHostContext` below.\n *\n * The `internalHandle` data structure is meant to be opaque. If you bend the rules and rely on its\n * internal fields, be aware that it may change significantly between versions. You're taking on additional\n * maintenance risk by reading from it, and giving up all guarantees if you write something to it.\n *\n * This method happens **in the render phase**. It can (and usually should) mutate the node it has\n * just created before returning it, but it must not modify any other nodes. It must not register\n * any event handlers on the parent tree. This is because an instance being created doesn't guarantee\n * it would be placed in the tree — it could be left unused and later collected by GC. If you need to do\n * something when an instance is definitely in the tree, look at `commitMount` instead.\n */\n createInstance(\n type: Type,\n props: Props,\n rootContainer: Container,\n _hostContext: HostContext,\n internalHandle: Fiber,\n ) {\n return {\n tag: Tag.Instance,\n type,\n props,\n isHidden: false,\n children: [],\n parent: null,\n rootContainer,\n unstable_fiber: internalHandle,\n };\n },\n\n /**\n * #### `createTextInstance(text, rootContainer, hostContext, internalHandle)`\n *\n * Same as `createInstance`, but for text nodes. If your renderer doesn't support text nodes, you can\n * throw here.\n */\n createTextInstance(\n text: string,\n rootContainer: Container,\n hostContext: HostContext,\n _internalHandle: Fiber,\n ): TextInstance {\n if (rootContainer.config.textComponents && !hostContext.isInsideText) {\n throw new Error(\n `Invariant Violation: Text strings must be rendered within a ${formatComponentList(\n rootContainer.config.textComponents,\n )} component. Detected attempt to render \"${text}\" string within a <${\n hostContext.type\n }> component.`,\n );\n }\n\n return {\n tag: Tag.Text,\n text,\n parent: null,\n isHidden: false,\n };\n },\n\n /**\n * #### `appendInitialChild(parentInstance, child)`\n *\n * This method should mutate the `parentInstance` and add the child to its list of children.\n * For example, in the DOM this would translate to a `parentInstance.appendChild(child)` call.\n *\n * This method happens **in the render phase**. It can mutate `parentInstance` and `child`, but it\n * must not modify any other nodes. It's called while the tree is still being built up and not connected\n * to the actual tree on the screen.\n */\n appendInitialChild: appendChild,\n\n /**\n * #### `finalizeInitialChildren(instance, type, props, rootContainer, hostContext)`\n *\n * In this method, you can perform some final mutations on the `instance`. Unlike with `createInstance`,\n * by the time `finalizeInitialChildren` is called, all the initial children have already been added to\n * the `instance`, but the instance itself has not yet been connected to the tree on the screen.\n *\n * This method happens **in the render phase**. It can mutate `instance`, but it must not modify any other\n * nodes. It's called while the tree is still being built up and not connected to the actual tree on the screen.\n *\n * There is a second purpose to this method. It lets you specify whether there is some work that needs to\n * happen when the node is connected to the tree on the screen. If you return `true`, the instance will\n * receive a `commitMount` call later. See its documentation below.\n *\n * If you don't want to do anything here, you should return `false`.\n */\n finalizeInitialChildren(\n _instance: Instance,\n _type: Type,\n _props: Props,\n _rootContainer: Container,\n _hostContext: HostContext,\n ): boolean {\n return false;\n },\n\n /**\n * #### `shouldSetTextContent(type, props)`\n *\n * Some target platforms support setting an instance's text content without manually creating a text node.\n * For example, in the DOM, you can set `node.textContent` instead of creating a text node and appending it.\n *\n * If you return `true` from this method, React will assume that this node's children are text, and will\n * not create nodes for them. It will instead rely on you to have filled that text during `createInstance`.\n * This is a performance optimization. For example, the DOM renderer returns `true` only if `type` is a\n * known text-only parent (like `'textarea'`) or if `props.children` has a `'string'` type. If you return `true`,\n * you will need to implement `resetTextContent` too.\n *\n * If you don't want to do anything here, you should return `false`.\n * This method happens **in the render phase**. Do not mutate the tree from it.\n */\n shouldSetTextContent(_type: Type, _props: Props): boolean {\n return false;\n },\n\n setCurrentUpdatePriority(newPriority: number) {\n currentUpdatePriority = newPriority;\n },\n\n getCurrentUpdatePriority() {\n return currentUpdatePriority;\n },\n\n resolveUpdatePriority(): number {\n return currentUpdatePriority || DefaultEventPriority;\n },\n\n shouldAttemptEagerTransition() {\n return false;\n },\n\n /**\n * #### `getRootHostContext(rootContainer)`\n *\n * This method lets you return the initial host context from the root of the tree. See `getChildHostContext`\n * for the explanation of host context.\n *\n * If you don't intend to use host context, you can return `null`.\n * This method happens **in the render phase**. Do not mutate the tree from it.\n */\n getRootHostContext(rootContainer: Container): HostContext | null {\n return {\n type: \"ROOT\",\n config: rootContainer.config,\n isInsideText: false,\n };\n },\n\n /**\n * #### `getChildHostContext(parentHostContext, type, rootContainer)`\n *\n * Host context lets you track some information about where you are in the tree so that it's available\n * inside `createInstance` as the `hostContext` parameter. For example, the DOM renderer uses it to track\n * whether it's inside an HTML or an SVG tree, because `createInstance` implementation needs to be\n * different for them.\n *\n * If the node of this `type` does not influence the context you want to pass down, you can return\n * `parentHostContext`. Alternatively, you can return any custom object representing the information\n * you want to pass down.\n *\n * If you don't want to do anything here, return `parentHostContext`.\n *\n * This method happens **in the render phase**. Do not mutate the tree from it.\n */\n getChildHostContext(parentHostContext: HostContext, type: Type): HostContext {\n const isInsideText = Boolean(parentHostContext.config.textComponents?.includes(type));\n return { ...parentHostContext, type: type, isInsideText };\n },\n\n /**\n * #### `getPublicInstance(instance)`\n *\n * Determines what object gets exposed as a ref. You'll likely want to return the `instance` itself. But\n * in some cases it might make sense to only expose some part of it.\n *\n * If you don't want to do anything here, return `instance`.\n */\n getPublicInstance(instance: Instance | TextInstance): PublicInstance {\n switch (instance.tag) {\n case Tag.Instance: {\n const createNodeMock = instance.rootContainer.config.createNodeMock;\n const mockNode = createNodeMock({\n type: instance.type,\n props: instance.props,\n key: null,\n });\n\n nodeToInstanceMap.set(mockNode, instance);\n\n return mockNode;\n }\n\n default:\n return instance;\n }\n },\n\n /**\n * #### `prepareForCommit(containerInfo)`\n *\n * This method lets you store some information before React starts making changes to the tree on\n * the screen. For example, the DOM renderer stores the current text selection so that it can later\n * restore it. This method is mirrored by `resetAfterCommit`.\n *\n * Even if you don't want to do anything here, you need to return `null` from it.\n */\n prepareForCommit(_containerInfo: Container) {\n return null; // noop\n },\n\n /**\n * #### `resetAfterCommit(containerInfo)`\n *\n * This method is called right after React has performed the tree mutations. You can use it to restore\n * something you've stored in `prepareForCommit` — for example, text selection.\n *\n * You can leave it empty.\n */\n resetAfterCommit(_containerInfo: Container): void {\n // noop\n },\n\n /**\n * #### `preparePortalMount(containerInfo)`\n *\n * This method is called for a container that's used as a portal target. Usually you can leave it empty.\n */\n preparePortalMount(_containerInfo: Container): void {\n // noop\n },\n\n /**\n * #### `scheduleTimeout(fn, delay)`\n *\n * You can proxy this to `setTimeout` or its equivalent in your environment.\n */\n scheduleTimeout: setTimeout,\n\n /**\n * #### `cancelTimeout(id)`\n *\n * You can proxy this to `clearTimeout` or its equivalent in your environment.\n */\n cancelTimeout: clearTimeout,\n\n /**\n * #### `noTimeout`\n *\n * This is a property (not a function) that should be set to something that can never be a valid timeout ID.\n * For example, you can set it to `-1`.\n */\n noTimeout: -1,\n\n /**\n * #### `supportsMicrotasks`\n *\n * Set this to `true` to indicate that your renderer supports `scheduleMicrotask`. We use microtasks as part\n * of our discrete event implementation in React DOM. If you're not sure if your renderer should support this,\n * you probably should. The option to not implement `scheduleMicrotask` exists so that platforms with more control\n * over user events, like React Native, can choose to use a different mechanism.\n */\n supportsMicrotasks: true,\n\n /**\n * #### `scheduleMicrotask(fn)`\n *\n * Optional. You can proxy this to `queueMicrotask` or its equivalent in your environment.\n */\n scheduleMicrotask: queueMicrotask,\n\n /**\n * #### `isPrimaryRenderer`\n *\n * This is a property (not a function) that should be set to `true` if your renderer is the main one on the\n * page. For example, if you're writing a renderer for the Terminal, it makes sense to set it to `true`, but\n * if your renderer is used *on top of* React DOM or some other existing renderer, set it to `false`.\n */\n isPrimaryRenderer: true,\n\n /**\n * Whether the renderer shouldn't trigger missing `act()` warnings\n */\n warnsIfNotActing: true,\n\n getInstanceFromNode(node: object): Fiber | null | undefined {\n const instance = nodeToInstanceMap.get(node);\n if (instance !== undefined) {\n return instance.unstable_fiber;\n }\n\n return null;\n },\n\n beforeActiveInstanceBlur(): void {\n // noop\n },\n\n afterActiveInstanceBlur(): void {\n // noop\n },\n\n prepareScopeUpdate(scopeInstance: object, instance: Instance): void {\n nodeToInstanceMap.set(scopeInstance, instance);\n },\n\n getInstanceFromScope(scopeInstance: object): Instance | null {\n return nodeToInstanceMap.get(scopeInstance) ?? null;\n },\n\n detachDeletedInstance(_node: Instance): void {},\n\n /**\n * #### `appendChild(parentInstance, child)`\n *\n * This method should mutate the `parentInstance` and add the child to its list of children. For example,\n * in the DOM this would translate to a `parentInstance.appendChild(child)` call.\n *\n * Although this method currently runs in the commit phase, you still should not mutate any other nodes\n * in it. If you need to do some additional work when a node is definitely connected to the visible tree, look at `commitMount`.\n */\n appendChild: appendChild,\n\n /**\n * #### `appendChildToContainer(container, child)`\n *\n * Same as `appendChild`, but for when a node is attached to the root container. This is useful if attaching\n * to the root has a slightly different implementation, or if the root container nodes are of a different\n * type than the rest of the tree.\n */\n appendChildToContainer: appendChild,\n\n /**\n * #### `insertBefore(parentInstance, child, beforeChild)`\n *\n * This method should mutate the `parentInstance` and place the `child` before `beforeChild` in the list of\n * its children. For example, in the DOM this would translate to a `parentInstance.insertBefore(child, beforeChild)` call.\n *\n * Note that React uses this method both for insertions and for reordering nodes. Similar to DOM, it is expected\n * that you can call `insertBefore` to reposition an existing child. Do not mutate any other parts of the tree from it.\n */\n insertBefore: insertBefore,\n\n /**\n * #### `insertInContainerBefore(container, child, beforeChild)\n *\n * Same as `insertBefore`, but for when a node is attached to the root container. This is useful if attaching\n * to the root has a slightly different implementation, or if the root container nodes are of a different type\n * than the rest of the tree.\n */\n insertInContainerBefore: insertBefore,\n\n /**\n * #### `removeChild(parentInstance, child)`\n *\n * This method should mutate the `parentInstance` to remove the `child` from the list of its children.\n *\n * React will only call it for the top-level node that is being removed. It is expected that garbage collection\n * would take care of the whole subtree. You are not expected to traverse the child tree in it.\n */\n removeChild: removeChild,\n\n /**\n * #### `removeChildFromContainer(container, child)`\n *\n * Same as `removeChild`, but for when a node is detached from the root container. This is useful if attaching\n * to the root has a slightly different implementation, or if the root container nodes are of a different type\n * than the rest of the tree.\n */\n removeChildFromContainer: removeChild,\n\n /**\n * #### `resetTextContent(instance)`\n *\n * If you returned `true` from `shouldSetTextContent` for the previous props, but returned `false` from\n * `shouldSetTextContent` for the next props, React will call this method so that you can clear the text\n * content you were managing manually. For example, in the DOM you could set `node.textContent = ''`.\n *\n * If you never return `true` from `shouldSetTextContent`, you can leave it empty.\n */\n resetTextContent(_instance: Instance): void {\n // noop\n },\n\n /**\n * #### `commitTextUpdate(textInstance, prevText, nextText)`\n *\n * This method should mutate the `textInstance` and update its text content to `nextText`.\n *\n * Here, `textInstance` is a node created by `createTextInstance`.\n */\n commitTextUpdate(textInstance: TextInstance, _oldText: string, newText: string): void {\n textInstance.text = newText;\n },\n\n /**\n * #### `commitMount(instance, type, props, internalHandle)`\n *\n * This method is only called if you returned `true` from `finalizeInitialChildren` for this instance.\n *\n * It lets you do some additional work after the node is actually attached to the tree on the screen for\n * the first time. For example, the DOM renderer uses it to trigger focus on nodes with the `autoFocus` attribute.\n *\n * Note that `commitMount` does not mirror `removeChild` one to one because `removeChild` is only called for\n * the top-level removed node. This is why ideally `commitMount` should not mutate any nodes other than the\n * `instance` itself. For example, if it registers some events on some node above, it will be your responsibility\n * to traverse the tree in `removeChild` and clean them up, which is not ideal.\n *\n * The `internalHandle` data structure is meant to be opaque. If you bend the rules and rely on its internal\n * fields, be aware that it may change significantly between versions. You're taking on additional maintenance\n * risk by reading from it, and giving up all guarantees if you write something to it.\n *\n * If you never return `true` from `finalizeInitialChildren`, you can leave it empty.\n */\n commitMount(_instance: Instance, _type: Type, _props: Props, _internalHandle: Fiber): void {\n // noop\n },\n\n /**\n * #### `commitUpdate(instance, type, prevProps, nextProps, internalHandle)`\n *\n * This method should mutate the `instance` according to the set of changes in `updatePayload`. Here, `updatePayload`\n * is the object that you've returned from `prepareUpdate` and has an arbitrary structure that makes sense for your\n * renderer. For example, the DOM renderer returns an update payload like `[prop1, value1, prop2, value2, ...]` from\n * `prepareUpdate`, and that structure gets passed into `commitUpdate`. Ideally, all the diffing and calculation\n * should happen inside `prepareUpdate` so that `commitUpdate` can be fast and straightforward.\n *\n * The `internalHandle` data structure is meant to be opaque. If you bend the rules and rely on its internal fields,\n * be aware that it may change significantly between versions. You're taking on additional maintenance risk by\n * reading from it, and giving up all guarantees if you write something to it.\n */\n // @ts-expect-error @types/react-reconciler types don't fully match react-reconciler's actual Flow types.\n // Correctness is verified through tests.\n commitUpdate(\n instance: Instance,\n type: Type,\n _prevProps: Props,\n nextProps: Props,\n internalHandle: Fiber,\n ): void {\n instance.type = type;\n instance.props = nextProps;\n instance.unstable_fiber = internalHandle;\n },\n\n /**\n * #### `hideInstance(instance)`\n *\n * This method should make the `instance` invisible without removing it from the tree. For example, it can apply\n * visual styling to hide it. It is used by Suspense to hide the tree while the fallback is visible.\n */\n hideInstance(instance: Instance): void {\n instance.isHidden = true;\n },\n\n /**\n * #### `hideTextInstance(textInstance)`\n *\n * Same as `hideInstance`, but for nodes created by `createTextInstance`.\n */\n hideTextInstance(textInstance: TextInstance): void {\n textInstance.isHidden = true;\n },\n\n /**\n * #### `unhideInstance(instance, props)`\n *\n * This method should make the `instance` visible, undoing what `hideInstance` did.\n */\n unhideInstance(instance: Instance, _props: Props): void {\n instance.isHidden = false;\n },\n\n /**\n * #### `unhideTextInstance(textInstance, text)`\n *\n * Same as `unhideInstance`, but for nodes created by `createTextInstance`.\n */\n unhideTextInstance(textInstance: TextInstance, _text: string): void {\n textInstance.isHidden = false;\n },\n\n /**\n * #### `clearContainer(container)`\n *\n * This method should mutate the `container` root node and remove all children from it.\n */\n clearContainer(container: Container): void {\n container.children.forEach((child) => {\n child.parent = null;\n });\n\n container.children.splice(0);\n },\n\n /**\n * #### `maySuspendCommit(type, props)`\n *\n * This method is called during render to determine if the Host Component type and props require\n * some kind of loading process to complete before committing an update.\n */\n maySuspendCommit(_type: Type, _props: Props): boolean {\n return false;\n },\n\n /**\n * #### `preloadInstance(type, props)`\n *\n * This method may be called during render if the Host Component type and props might suspend a commit.\n * It can be used to initiate any work that might shorten the duration of a suspended commit.\n */\n preloadInstance(_type: Type, _props: Props): boolean {\n return true;\n },\n\n /**\n * #### `startSuspendingCommit()`\n *\n * This method is called just before the commit phase. Use it to set up any necessary state while any Host\n * Components that might suspend this commit are evaluated to determine if the commit must be suspended.\n */\n startSuspendingCommit() {},\n\n /**\n * #### `suspendInstance(type, props)`\n *\n * This method is called after `startSuspendingCommit` for each Host Component that indicated it might\n * suspend a commit.\n */\n suspendInstance() {},\n\n /**\n * #### `waitForCommitToBeReady()`\n *\n * This method is called after all `suspendInstance` calls are complete.\n *\n * Return `null` if the commit can happen immediately.\n * Return `(initiateCommit: Function) => Function` if the commit must be suspended. The argument to this\n * callback will initiate the commit when called. The return value is a cancellation function that the\n * Reconciler can use to abort the commit.\n */\n waitForCommitToBeReady() {\n return null;\n },\n\n // -------------------\n // Hydration Methods\n // (optional)\n // You can optionally implement hydration to \"attach\" to the existing tree during the initial render instead\n // of creating it from scratch. For example, the DOM renderer uses this to attach to an HTML markup.\n //\n // To support hydration, you need to declare `supportsHydration: true` and then implement the methods in\n // the \"Hydration\" section [listed in this file](https://github.com/facebook/react/blob/master/packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js).\n // File an issue if you need help.\n // -------------------\n supportsHydration: false,\n\n NotPendingTransition: null,\n\n resetFormInstance(_form: Instance) {},\n\n requestPostPaintCallback(_callback: (endTime: number) => void) {},\n};\n\nexport const TestReconciler = ReactReconciler(hostConfig);\n\n/**\n * This method should mutate the `parentInstance` and add the child to its list of children. For example,\n * in the DOM this would translate to a `parentInstance.appendChild(child)` call.\n *\n * Although this method currently runs in the commit phase, you still should not mutate any other nodes\n * in it. If you need to do some additional work when a node is definitely connected to the visible tree,\n * look at `commitMount`.\n */\nfunction appendChild(parentInstance: Container | Instance, child: Instance | TextInstance): void {\n const index = parentInstance.children.indexOf(child);\n if (index !== -1) {\n parentInstance.children.splice(index, 1);\n }\n\n child.parent = parentInstance;\n parentInstance.children.push(child);\n}\n\n/**\n * This method should mutate the `parentInstance` and place the `child` before `beforeChild` in the list\n * of its children. For example, in the DOM this would translate to a\n * `parentInstance.insertBefore(child, beforeChild)` call.\n *\n * Note that React uses this method both for insertions and for reordering nodes. Similar to DOM, it is\n * expected that you can call `insertBefore` to reposition an existing child. Do not mutate any other parts\n * of the tree from it.\n */\nfunction insertBefore(\n parentInstance: Container | Instance,\n child: Instance | TextInstance,\n beforeChild: Instance | TextInstance,\n): void {\n const index = parentInstance.children.indexOf(child);\n if (index !== -1) {\n parentInstance.children.splice(index, 1);\n }\n\n child.parent = parentInstance;\n const beforeIndex = parentInstance.children.indexOf(beforeChild);\n parentInstance.children.splice(beforeIndex, 0, child);\n}\n\n/**\n * This method should mutate the `parentInstance` to remove the `child` from the list of its children.\n *\n * React will only call it for the top-level node that is being removed. It is expected that garbage\n * collection would take care of the whole subtree. You are not expected to traverse the child tree in it.\n */\nfunction removeChild(parentInstance: Container | Instance, child: Instance | TextInstance): void {\n const index = parentInstance.children.indexOf(child);\n parentInstance.children.splice(index, 1);\n child.parent = null;\n}\n","export function formatComponentList(names: string[]): string {\n if (names.length === 0) {\n return \"\";\n }\n\n if (names.length === 1) {\n return `<${names[0]}>`;\n }\n\n if (names.length === 2) {\n return `<${names[0]}> or <${names[1]}>`;\n }\n\n const allButLast = names.slice(0, -1);\n const last = names[names.length - 1];\n\n return `${allButLast.map((name) => `<${name}>`).join(\", \")}, or <${last}>`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,IAAAA,oBAA+B;;;ACDxB,IAAM,MAAM;AAAA,EACjB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,MAAM;AACR;AAGO,IAAM,iBAAiB;;;ACcvB,SAAS,SACd,SACA,WACA,SACe;AAzBjB;AA0BE,QAAM,eAAc,wCAAS,gBAAT,YAAwB;AAC5C,QAAM,oBAAmB,wCAAS,qBAAT,YAA6B;AAEtD,QAAM,UAAyB,CAAC;AAGhC,QAAM,sBAAqC,CAAC;AAE5C,UAAQ,SAAS,QAAQ,CAAC,UAAU;AAClC,QAAI,OAAO,UAAU,UAAU;AAC7B;AAAA,IACF;AAEA,wBAAoB,KAAK,GAAG,SAAS,OAAO,WAAW,iCAAK,UAAL,EAAc,aAAa,KAAK,EAAC,CAAC;AAAA,EAC3F,CAAC;AAED,MACE;AAAA,GAEC,oBAAoB,WAAW,KAAK,CAAC,qBACtC,UAAU,OAAO,GACjB;AACA,YAAQ,KAAK,OAAO;AAAA,EACtB;AAGA,UAAQ,KAAK,GAAG,mBAAmB;AAEnC,SAAO;AACT;;;ACvCO,SAAS,sBAAsB,UAAkC;AACtE,SAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO,CAAC;AAAA,IACR,UAAU,qBAAqB,SAAS,QAAQ;AAAA,IAChD,UAAU,uBAAO,IAAI,iBAAiB;AAAA,EACxC;AACF;AAE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B;AAAA,IAC/B;AAAA;AAAA,EACF;AAEA,QAAM,SAAS,CAAC,YAA0B;AACxC,QAAI,kBAAkB,MAAM;AAC1B,YAAM,IAAI,MAAM,6BAA6B;AAAA,IAC/C;AAEA,mBAAe,gBAAgB,SAAS,gBAAgB,MAAM,IAAI;AAAA,EACpE;AAEA,QAAM,UAAU,MAAM;AACpB,QAAI,aAAa,MAAM;AACrB;AAAA,IACF;AAEA,mBAAe,gBAAgB,MAAM,gBAAgB,MAAM,IAAI;AAE/D,qBAAiB;AACjB,gBAAY;AAAA,EACd;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,IAAI,YAAyB;AAC3B,UAAI,aAAa,MAAM;AACrB,cAAM,IAAI,MAAM,qDAAqD;AAAA,MACvE;AAEA,aAAO,YAAY,aAAa,SAAS;AAAA,IAC3C;AAAA,EACF;AACF;","names":["import_constants","import_constants","ReactReconciler"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/renderer.ts","../src/constants.ts","../src/query-all.ts","../src/render-to-json.ts","../src/host-element.ts","../src/reconciler.ts","../src/utils.ts"],"sourcesContent":["export { createRoot } from \"./renderer\";\n\nexport type { Root, RootOptions, ErrorHandler, ErrorInfo } from \"./renderer\";\nexport type { HostElement, HostElementProps, HostNode } from \"./host-element\";\nexport type { JsonElement, JsonNode } from \"./render-to-json\";\nexport type { QueryOptions } from \"./query-all\";\n\n/**\n * React Fiber type from react-reconciler. Exported for advanced use cases only.\n * This type represents internal React structures that may change without warning.\n * Prefer using the stable HostElement API instead.\n */\nexport type { Fiber } from \"react-reconciler\";\n","import type { ReactElement } from \"react\";\nimport { ConcurrentRoot } from \"react-reconciler/constants\";\n\nimport { Tag } from \"./constants\";\nimport { HostElement } from \"./host-element\";\nimport type { Container } from \"./reconciler\";\nimport { TestReconciler } from \"./reconciler\";\n\n// Refs:\n// https://github.com/facebook/react/blob/main/packages/react-test-renderer/src/ReactFiberConfigTestHost.js\n// https://github.com/facebook/react/blob/main/packages/react-noop-renderer/src/createReactNoop.js\n// https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactFiberConfigFabric.js\n\nconst defaultCreateMockNode = () => ({});\n\nconst defaultOnUncaughtError = (error: unknown, errorInfo: ErrorInfo) => {\n console.error(\"Uncaught error:\", error, errorInfo);\n};\nconst defaultOnCaughtError = (error: unknown, errorInfo: ErrorInfo) => {\n console.error(\"Caught error:\", error, errorInfo);\n};\nconst defaultOnRecoverableError = (error: unknown, errorInfo: ErrorInfo) => {\n console.error(\"Recoverable error:\", error, errorInfo);\n};\n\n/**\n * Options for configuring the test renderer root.\n */\nexport type RootOptions = {\n /** Types of host components that are allowed to contain text nodes. Trying to render text outside of these components will throw an error. */\n textComponentTypes?: string[];\n\n /**\n * Host component types to display to users in the error message when they try to render text outside of `textComponentTypes`.\n * Defaults to `textComponentTypes`, but you may want to override the components mentioned in the error message.\n */\n publicTextComponentTypes?: string[];\n\n /** Function to create mock nodes for refs. */\n createNodeMock?: (element: ReactElement) => object;\n\n /** Callback called when React catches an error in an Error Boundary. Called with the error caught by the Error Boundary, and an errorInfo object containing the componentStack. */\n onCaughtError?: ErrorHandler;\n\n /** Callback called when an error is thrown and not caught by an Error Boundary. Called with the error that was thrown, and an errorInfo object containing the componentStack. */\n onUncaughtError?: ErrorHandler;\n\n /** Callback called when React automatically recovers from errors. Called with an error React throws, and an errorInfo object containing the componentStack. Some recoverable errors may include the original error cause as error.cause. */\n onRecoverableError?: ErrorHandler;\n\n /** A string prefix React uses for IDs generated by useId. Useful to avoid conflicts when using multiple roots on the same page. */\n identifierPrefix?: string;\n\n /** Enable React Strict Mode. */\n isStrictMode?: boolean;\n};\n\n/** Callback for handling React errors. */\nexport type ErrorHandler = (error: unknown, errorInfo: ErrorInfo) => void;\n\n/** Error information provided to error handlers. */\nexport type ErrorInfo = {\n componentStack: string;\n};\n\n/**\n * Root instance returned by createRoot. Provides methods to render and unmount components.\n */\nexport type Root = {\n /** Render a React element into the root. Must be called within act(). */\n render: (element: ReactElement) => void;\n /** Unmount the root and clean up. Must be called within act(). */\n unmount: () => void;\n /** The root container element. */\n container: HostElement;\n};\n\n/**\n * Create a new test renderer root instance.\n *\n * @param options - Optional configuration for the renderer.\n * @returns A Root instance with render, unmount, and container properties.\n */\nexport function createRoot(options?: RootOptions): Root {\n let container: Container | null = {\n tag: Tag.Container,\n parent: null,\n children: [],\n isHidden: false,\n config: {\n textComponentTypes: options?.textComponentTypes,\n publicTextComponentTypes: options?.publicTextComponentTypes,\n createNodeMock: options?.createNodeMock ?? defaultCreateMockNode,\n },\n };\n\n // @types/react-reconciler types don't fully match react-reconciler's actual Flow types.\n // The return type is correct at runtime but TypeScript can't verify it statically.\n // Correctness is verified through tests.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n let containerFiber = TestReconciler.createContainer(\n container,\n ConcurrentRoot,\n null, // hydrationCallbacks\n options?.isStrictMode ?? false,\n false, // concurrentUpdatesByDefaultOverride\n options?.identifierPrefix ?? \"\",\n options?.onUncaughtError ?? defaultOnUncaughtError,\n options?.onCaughtError ?? defaultOnCaughtError,\n // @ts-expect-error @types/react-reconciler types don't include onRecoverableError parameter\n // in the createContainer signature, but react-reconciler's actual Flow types do.\n // Correctness is verified through tests.\n options?.onRecoverableError ?? defaultOnRecoverableError,\n null, // transitionCallbacks\n );\n\n const render = (element: ReactElement) => {\n if (containerFiber == null) {\n throw new Error(\"Cannot render after unmount\");\n }\n\n TestReconciler.updateContainer(element, containerFiber, null, null);\n };\n\n const unmount = () => {\n if (container == null) {\n return;\n }\n\n TestReconciler.updateContainer(null, containerFiber, null, null);\n\n containerFiber = null;\n container = null;\n };\n\n return {\n render,\n unmount,\n get container(): HostElement {\n if (container == null) {\n throw new Error(\"Cannot access .container on unmounted test renderer\");\n }\n\n return HostElement.fromInstance(container);\n },\n };\n}\n","export const Tag = {\n Container: \"CONTAINER\",\n Instance: \"INSTANCE\",\n Text: \"TEXT\",\n} as const;\n\n// Container should render as <>{...}</>\nexport const CONTAINER_TYPE = \"\";\n","import type { HostElement } from \"./host-element\";\n\n/**\n * Options for querying elements in the rendered tree.\n */\nexport interface QueryOptions {\n /** Include the element itself in the results if it matches the predicate. Defaults to false. */\n includeSelf?: boolean;\n\n /** Exclude any ancestors of deepest matched elements even if they match the predicate. Defaults to false. */\n matchDeepestOnly?: boolean;\n}\n\n/**\n * Find all descendant elements matching the predicate.\n *\n * @param element - Root element to search from.\n * @param predicate - Function that returns true for matching elements.\n * @param options - Optional query configuration.\n * @returns Array of matching elements in tree order.\n */\nexport function queryAll(\n element: HostElement,\n predicate: (element: HostElement) => boolean,\n options?: QueryOptions,\n): HostElement[] {\n const includeSelf = options?.includeSelf ?? false;\n const matchDeepestOnly = options?.matchDeepestOnly ?? false;\n\n const results: HostElement[] = [];\n\n // Match descendants first but do not add them to results yet.\n const matchingDescendants: HostElement[] = [];\n\n element.children.forEach((child) => {\n if (typeof child === \"string\") {\n return;\n }\n\n matchingDescendants.push(...queryAll(child, predicate, { ...options, includeSelf: true }));\n });\n\n if (\n includeSelf &&\n // When matchDeepestOnly = true: add current element only if no descendants match\n (matchingDescendants.length === 0 || !matchDeepestOnly) &&\n predicate(element)\n ) {\n results.push(element);\n }\n\n // Add matching descendants after element to preserve original tree walk order.\n results.push(...matchingDescendants);\n\n return results;\n}\n","import { CONTAINER_TYPE, Tag } from \"./constants\";\nimport type { Container, Instance, TextInstance } from \"./reconciler\";\n\n/** A node in the JSON representation - either a JsonElement or a text string. */\nexport type JsonNode = JsonElement | string;\n\n/**\n * JSON representation of a rendered element, compatible with react-test-renderer format.\n */\nexport type JsonElement = {\n type: string;\n props: object;\n children: Array<JsonNode> | null;\n $$typeof: symbol;\n};\n\nexport function renderContainerToJson(instance: Container): JsonElement {\n return {\n type: CONTAINER_TYPE,\n props: {},\n children: renderChildrenToJson(instance.children),\n $$typeof: Symbol.for(\"react.test.json\"),\n };\n}\n\nexport function renderInstanceToJson(instance: Instance): JsonElement | null {\n if (instance.isHidden) {\n return null;\n }\n\n // We don't include the `children` prop in JSON.\n // Instead, we will include the actual rendered children.\n const { children: _children, ...restProps } = instance.props;\n\n return {\n type: instance.type,\n props: restProps,\n children: renderChildrenToJson(instance.children),\n $$typeof: Symbol.for(\"react.test.json\"),\n };\n}\n\nexport function renderTextInstanceToJson(instance: TextInstance): string | null {\n if (instance.isHidden) {\n return null;\n }\n\n return instance.text;\n}\n\nexport function renderChildrenToJson(children: Array<Instance | TextInstance>): JsonNode[] {\n const result = [];\n\n for (const child of children) {\n if (child.tag === Tag.Instance) {\n const renderedChild = renderInstanceToJson(child);\n if (renderedChild !== null) {\n result.push(renderedChild);\n }\n } else {\n const renderedChild = renderTextInstanceToJson(child);\n if (renderedChild !== null) {\n result.push(renderedChild);\n }\n }\n }\n\n return result;\n}\n","import type { Fiber } from \"react-reconciler\";\n\nimport { CONTAINER_TYPE, Tag } from \"./constants\";\nimport type { QueryOptions } from \"./query-all\";\nimport { queryAll } from \"./query-all\";\nimport type { Container, Instance, TextInstance } from \"./reconciler\";\nimport type { JsonElement } from \"./render-to-json\";\nimport { renderContainerToJson, renderInstanceToJson } from \"./render-to-json\";\n\n/** A node in the rendered tree - either a HostElement or a text string. */\nexport type HostNode = HostElement | string;\n\n/** Props object for a host element. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type HostElementProps = Record<string, any>;\n\nconst instanceMap = new WeakMap<Instance | Container, HostElement>();\n\n/**\n * Represents a rendered host element in the test renderer tree.\n * Provides a DOM-like API for querying and inspecting rendered components.\n */\nexport class HostElement {\n private instance: Instance | Container;\n\n private constructor(instance: Instance | Container) {\n this.instance = instance;\n }\n\n /** The element type (e.g., \"div\", \"span\"). Empty string for container. */\n get type(): string {\n return this.instance.tag === Tag.Instance ? this.instance.type : CONTAINER_TYPE;\n }\n\n /** The element's props object. */\n get props(): HostElementProps {\n return this.instance.tag === Tag.Instance ? this.instance.props : {};\n }\n\n /** The parent element, or null if this is the root container. */\n get parent(): HostElement | null {\n const parentInstance = this.instance.parent;\n if (parentInstance == null) {\n return null;\n }\n\n return HostElement.fromInstance(parentInstance);\n }\n\n /** Array of child nodes (elements and text strings). Hidden children are excluded. */\n get children(): HostNode[] {\n const result = this.instance.children\n .filter((child) => !child.isHidden)\n .map((child) => getHostNodeForInstance(child));\n return result;\n }\n\n /**\n * Access to the underlying React Fiber node. This is an unstable API that exposes\n * internal react-reconciler structures which may change without warning in future\n * React versions. Use with caution and only when absolutely necessary.\n *\n * @returns The Fiber node for this instance, or null if this is a container.\n */\n get unstable_fiber(): Fiber | null {\n return this.instance.tag === Tag.Instance ? this.instance.unstable_fiber : null;\n }\n\n /**\n * Convert this element to a JSON representation suitable for snapshots.\n *\n * @returns JSON element or null if the element is hidden.\n */\n toJSON(): JsonElement | null {\n return this.instance.tag === Tag.Container\n ? renderContainerToJson(this.instance)\n : renderInstanceToJson(this.instance);\n }\n\n /**\n * Find all descendant elements matching the predicate.\n *\n * @param predicate - Function that returns true for matching elements.\n * @param options - Optional query configuration.\n * @returns Array of matching elements.\n */\n queryAll(\n predicate: (element: HostElement, options?: QueryOptions) => boolean,\n options?: QueryOptions,\n ): HostElement[] {\n return queryAll(this, predicate, options);\n }\n\n /** @internal */\n static fromInstance(instance: Instance | Container): HostElement {\n const hostElement = instanceMap.get(instance);\n if (hostElement) {\n return hostElement;\n }\n\n const result = new HostElement(instance);\n instanceMap.set(instance, result);\n return result;\n }\n}\n\nfunction getHostNodeForInstance(instance: Instance | TextInstance): HostNode {\n switch (instance.tag) {\n case Tag.Text:\n return instance.text;\n\n case Tag.Instance:\n return HostElement.fromInstance(instance);\n }\n}\n","import type { ReactElement } from \"react\";\nimport type { Fiber } from \"react-reconciler\";\nimport ReactReconciler from \"react-reconciler\";\nimport { DefaultEventPriority, NoEventPriority } from \"react-reconciler/constants\";\n\nimport { Tag } from \"./constants\";\nimport { formatComponentList } from \"./utils\";\n\nexport type Type = string;\nexport type Props = Record<string, unknown>;\n\ntype ReconcilerConfig = {\n textComponentTypes?: string[];\n publicTextComponentTypes?: string[];\n createNodeMock: (element: ReactElement) => object;\n};\n\nexport type Container = {\n tag: typeof Tag.Container;\n parent: null;\n children: Array<Instance | TextInstance>;\n isHidden: false;\n config: ReconcilerConfig;\n};\n\nexport type Instance = {\n tag: typeof Tag.Instance;\n type: string;\n props: Props;\n children: Array<Instance | TextInstance>;\n parent: Container | Instance | null;\n rootContainer: Container;\n isHidden: boolean;\n unstable_fiber: Fiber;\n};\n\nexport type TextInstance = {\n tag: typeof Tag.Text;\n text: string;\n parent: Container | Instance | null;\n isHidden: boolean;\n};\n\nexport type SuspenseInstance = object;\nexport type HydratableInstance = object;\nexport type PublicInstance = object | TextInstance;\nexport type UpdatePayload = unknown;\nexport type ChildSet = unknown;\nexport type TimeoutHandle = unknown;\nexport type NoTimeout = unknown;\n\ntype HostContext = {\n type: string;\n isInsideText: boolean;\n config: ReconcilerConfig;\n};\n\nconst nodeToInstanceMap = new WeakMap<object, Instance>();\n\nlet currentUpdatePriority: number = NoEventPriority;\n\nconst hostConfig: ReactReconciler.HostConfig<\n Type,\n Props,\n Container,\n Instance,\n TextInstance,\n SuspenseInstance,\n HydratableInstance,\n PublicInstance,\n HostContext,\n UpdatePayload,\n ChildSet,\n TimeoutHandle,\n NoTimeout\n> = {\n /**\n * The reconciler has two modes: mutation mode and persistent mode. You must specify one of them.\n *\n * If your target platform is similar to the DOM and has methods similar to `appendChild`, `removeChild`,\n * and so on, you'll want to use the **mutation mode**. This is the same mode used by React DOM, React ART,\n * and the classic React Native renderer.\n *\n * ```js\n * const HostConfig = {\n * // ...\n * supportsMutation: true,\n * // ...\n * }\n * ```\n *\n * Depending on the mode, the reconciler will call different methods on your host config.\n * If you're not sure which one you want, you likely need the mutation mode.\n */\n supportsMutation: true,\n\n /**\n * The reconciler has two modes: mutation mode and persistent mode. You must specify one of them.\n *\n * If your target platform has immutable trees, you'll want the **persistent mode** instead. In that mode,\n * existing nodes are never mutated, and instead every change clones the parent tree and then replaces\n * the whole parent tree at the root. This is the node used by the new React Native renderer, codenamed \"Fabric\".\n *\n * ```js\n * const HostConfig = {\n * // ...\n * supportsPersistence: true,\n * // ...\n * }\n * ```\n *\n * Depending on the mode, the reconciler will call different methods on your host config.\n * If you're not sure which one you want, you likely need the mutation mode.\n */\n supportsPersistence: false,\n\n /**\n * #### `createInstance(type, props, rootContainer, hostContext, internalHandle)`\n *\n * This method should return a newly created node. For example, the DOM renderer would call\n * `document.createElement(type)` here and then set the properties from `props`.\n *\n * You can use `rootContainer` to access the root container associated with that tree. For example,\n * in the DOM renderer, this is useful to get the correct `document` reference that the root belongs to.\n *\n * The `hostContext` parameter lets you keep track of some information about your current place in\n * the tree. To learn more about it, see `getChildHostContext` below.\n *\n * The `internalHandle` data structure is meant to be opaque. If you bend the rules and rely on its\n * internal fields, be aware that it may change significantly between versions. You're taking on additional\n * maintenance risk by reading from it, and giving up all guarantees if you write something to it.\n *\n * This method happens **in the render phase**. It can (and usually should) mutate the node it has\n * just created before returning it, but it must not modify any other nodes. It must not register\n * any event handlers on the parent tree. This is because an instance being created doesn't guarantee\n * it would be placed in the tree — it could be left unused and later collected by GC. If you need to do\n * something when an instance is definitely in the tree, look at `commitMount` instead.\n */\n createInstance(\n type: Type,\n props: Props,\n rootContainer: Container,\n _hostContext: HostContext,\n internalHandle: Fiber,\n ) {\n return {\n tag: Tag.Instance,\n type,\n props,\n isHidden: false,\n children: [],\n parent: null,\n rootContainer,\n unstable_fiber: internalHandle,\n };\n },\n\n /**\n * #### `createTextInstance(text, rootContainer, hostContext, internalHandle)`\n *\n * Same as `createInstance`, but for text nodes. If your renderer doesn't support text nodes, you can\n * throw here.\n */\n createTextInstance(\n text: string,\n rootContainer: Container,\n hostContext: HostContext,\n _internalHandle: Fiber,\n ): TextInstance {\n if (rootContainer.config.textComponentTypes && !hostContext.isInsideText) {\n const componentTypes =\n rootContainer.config.publicTextComponentTypes ?? rootContainer.config.textComponentTypes;\n\n throw new Error(\n `Invariant Violation: Text strings must be rendered within a ${formatComponentList(\n componentTypes,\n )} component. Detected attempt to render \"${text}\" string within a <${\n hostContext.type\n }> component.`,\n );\n }\n\n return {\n tag: Tag.Text,\n text,\n parent: null,\n isHidden: false,\n };\n },\n\n /**\n * #### `appendInitialChild(parentInstance, child)`\n *\n * This method should mutate the `parentInstance` and add the child to its list of children.\n * For example, in the DOM this would translate to a `parentInstance.appendChild(child)` call.\n *\n * This method happens **in the render phase**. It can mutate `parentInstance` and `child`, but it\n * must not modify any other nodes. It's called while the tree is still being built up and not connected\n * to the actual tree on the screen.\n */\n appendInitialChild: appendChild,\n\n /**\n * #### `finalizeInitialChildren(instance, type, props, rootContainer, hostContext)`\n *\n * In this method, you can perform some final mutations on the `instance`. Unlike with `createInstance`,\n * by the time `finalizeInitialChildren` is called, all the initial children have already been added to\n * the `instance`, but the instance itself has not yet been connected to the tree on the screen.\n *\n * This method happens **in the render phase**. It can mutate `instance`, but it must not modify any other\n * nodes. It's called while the tree is still being built up and not connected to the actual tree on the screen.\n *\n * There is a second purpose to this method. It lets you specify whether there is some work that needs to\n * happen when the node is connected to the tree on the screen. If you return `true`, the instance will\n * receive a `commitMount` call later. See its documentation below.\n *\n * If you don't want to do anything here, you should return `false`.\n */\n finalizeInitialChildren(\n _instance: Instance,\n _type: Type,\n _props: Props,\n _rootContainer: Container,\n _hostContext: HostContext,\n ): boolean {\n return false;\n },\n\n /**\n * #### `shouldSetTextContent(type, props)`\n *\n * Some target platforms support setting an instance's text content without manually creating a text node.\n * For example, in the DOM, you can set `node.textContent` instead of creating a text node and appending it.\n *\n * If you return `true` from this method, React will assume that this node's children are text, and will\n * not create nodes for them. It will instead rely on you to have filled that text during `createInstance`.\n * This is a performance optimization. For example, the DOM renderer returns `true` only if `type` is a\n * known text-only parent (like `'textarea'`) or if `props.children` has a `'string'` type. If you return `true`,\n * you will need to implement `resetTextContent` too.\n *\n * If you don't want to do anything here, you should return `false`.\n * This method happens **in the render phase**. Do not mutate the tree from it.\n */\n shouldSetTextContent(_type: Type, _props: Props): boolean {\n return false;\n },\n\n setCurrentUpdatePriority(newPriority: number) {\n currentUpdatePriority = newPriority;\n },\n\n getCurrentUpdatePriority() {\n return currentUpdatePriority;\n },\n\n resolveUpdatePriority(): number {\n return currentUpdatePriority || DefaultEventPriority;\n },\n\n shouldAttemptEagerTransition() {\n return false;\n },\n\n /**\n * #### `getRootHostContext(rootContainer)`\n *\n * This method lets you return the initial host context from the root of the tree. See `getChildHostContext`\n * for the explanation of host context.\n *\n * If you don't intend to use host context, you can return `null`.\n * This method happens **in the render phase**. Do not mutate the tree from it.\n */\n getRootHostContext(rootContainer: Container): HostContext | null {\n return {\n type: \"ROOT\",\n config: rootContainer.config,\n isInsideText: false,\n };\n },\n\n /**\n * #### `getChildHostContext(parentHostContext, type, rootContainer)`\n *\n * Host context lets you track some information about where you are in the tree so that it's available\n * inside `createInstance` as the `hostContext` parameter. For example, the DOM renderer uses it to track\n * whether it's inside an HTML or an SVG tree, because `createInstance` implementation needs to be\n * different for them.\n *\n * If the node of this `type` does not influence the context you want to pass down, you can return\n * `parentHostContext`. Alternatively, you can return any custom object representing the information\n * you want to pass down.\n *\n * If you don't want to do anything here, return `parentHostContext`.\n *\n * This method happens **in the render phase**. Do not mutate the tree from it.\n */\n getChildHostContext(parentHostContext: HostContext, type: Type): HostContext {\n const isInsideText = Boolean(parentHostContext.config.textComponentTypes?.includes(type));\n return { ...parentHostContext, type: type, isInsideText };\n },\n\n /**\n * #### `getPublicInstance(instance)`\n *\n * Determines what object gets exposed as a ref. You'll likely want to return the `instance` itself. But\n * in some cases it might make sense to only expose some part of it.\n *\n * If you don't want to do anything here, return `instance`.\n */\n getPublicInstance(instance: Instance | TextInstance): PublicInstance {\n switch (instance.tag) {\n case Tag.Instance: {\n const createNodeMock = instance.rootContainer.config.createNodeMock;\n const mockNode = createNodeMock({\n type: instance.type,\n props: instance.props,\n key: null,\n });\n\n nodeToInstanceMap.set(mockNode, instance);\n\n return mockNode;\n }\n\n default:\n return instance;\n }\n },\n\n /**\n * #### `prepareForCommit(containerInfo)`\n *\n * This method lets you store some information before React starts making changes to the tree on\n * the screen. For example, the DOM renderer stores the current text selection so that it can later\n * restore it. This method is mirrored by `resetAfterCommit`.\n *\n * Even if you don't want to do anything here, you need to return `null` from it.\n */\n prepareForCommit(_containerInfo: Container) {\n return null; // noop\n },\n\n /**\n * #### `resetAfterCommit(containerInfo)`\n *\n * This method is called right after React has performed the tree mutations. You can use it to restore\n * something you've stored in `prepareForCommit` — for example, text selection.\n *\n * You can leave it empty.\n */\n resetAfterCommit(_containerInfo: Container): void {\n // noop\n },\n\n /**\n * #### `preparePortalMount(containerInfo)`\n *\n * This method is called for a container that's used as a portal target. Usually you can leave it empty.\n */\n preparePortalMount(_containerInfo: Container): void {\n // noop\n },\n\n /**\n * #### `scheduleTimeout(fn, delay)`\n *\n * You can proxy this to `setTimeout` or its equivalent in your environment.\n */\n scheduleTimeout: setTimeout,\n\n /**\n * #### `cancelTimeout(id)`\n *\n * You can proxy this to `clearTimeout` or its equivalent in your environment.\n */\n cancelTimeout: clearTimeout,\n\n /**\n * #### `noTimeout`\n *\n * This is a property (not a function) that should be set to something that can never be a valid timeout ID.\n * For example, you can set it to `-1`.\n */\n noTimeout: -1,\n\n /**\n * #### `supportsMicrotasks`\n *\n * Set this to `true` to indicate that your renderer supports `scheduleMicrotask`. We use microtasks as part\n * of our discrete event implementation in React DOM. If you're not sure if your renderer should support this,\n * you probably should. The option to not implement `scheduleMicrotask` exists so that platforms with more control\n * over user events, like React Native, can choose to use a different mechanism.\n */\n supportsMicrotasks: true,\n\n /**\n * #### `scheduleMicrotask(fn)`\n *\n * Optional. You can proxy this to `queueMicrotask` or its equivalent in your environment.\n */\n scheduleMicrotask: queueMicrotask,\n\n /**\n * #### `isPrimaryRenderer`\n *\n * This is a property (not a function) that should be set to `true` if your renderer is the main one on the\n * page. For example, if you're writing a renderer for the Terminal, it makes sense to set it to `true`, but\n * if your renderer is used *on top of* React DOM or some other existing renderer, set it to `false`.\n */\n isPrimaryRenderer: true,\n\n /**\n * Whether the renderer shouldn't trigger missing `act()` warnings\n */\n warnsIfNotActing: true,\n\n getInstanceFromNode(node: object): Fiber | null | undefined {\n const instance = nodeToInstanceMap.get(node);\n if (instance !== undefined) {\n return instance.unstable_fiber;\n }\n\n return null;\n },\n\n beforeActiveInstanceBlur(): void {\n // noop\n },\n\n afterActiveInstanceBlur(): void {\n // noop\n },\n\n prepareScopeUpdate(scopeInstance: object, instance: Instance): void {\n nodeToInstanceMap.set(scopeInstance, instance);\n },\n\n getInstanceFromScope(scopeInstance: object): Instance | null {\n return nodeToInstanceMap.get(scopeInstance) ?? null;\n },\n\n detachDeletedInstance(_node: Instance): void {},\n\n /**\n * #### `appendChild(parentInstance, child)`\n *\n * This method should mutate the `parentInstance` and add the child to its list of children. For example,\n * in the DOM this would translate to a `parentInstance.appendChild(child)` call.\n *\n * Although this method currently runs in the commit phase, you still should not mutate any other nodes\n * in it. If you need to do some additional work when a node is definitely connected to the visible tree, look at `commitMount`.\n */\n appendChild: appendChild,\n\n /**\n * #### `appendChildToContainer(container, child)`\n *\n * Same as `appendChild`, but for when a node is attached to the root container. This is useful if attaching\n * to the root has a slightly different implementation, or if the root container nodes are of a different\n * type than the rest of the tree.\n */\n appendChildToContainer: appendChild,\n\n /**\n * #### `insertBefore(parentInstance, child, beforeChild)`\n *\n * This method should mutate the `parentInstance` and place the `child` before `beforeChild` in the list of\n * its children. For example, in the DOM this would translate to a `parentInstance.insertBefore(child, beforeChild)` call.\n *\n * Note that React uses this method both for insertions and for reordering nodes. Similar to DOM, it is expected\n * that you can call `insertBefore` to reposition an existing child. Do not mutate any other parts of the tree from it.\n */\n insertBefore: insertBefore,\n\n /**\n * #### `insertInContainerBefore(container, child, beforeChild)\n *\n * Same as `insertBefore`, but for when a node is attached to the root container. This is useful if attaching\n * to the root has a slightly different implementation, or if the root container nodes are of a different type\n * than the rest of the tree.\n */\n insertInContainerBefore: insertBefore,\n\n /**\n * #### `removeChild(parentInstance, child)`\n *\n * This method should mutate the `parentInstance` to remove the `child` from the list of its children.\n *\n * React will only call it for the top-level node that is being removed. It is expected that garbage collection\n * would take care of the whole subtree. You are not expected to traverse the child tree in it.\n */\n removeChild: removeChild,\n\n /**\n * #### `removeChildFromContainer(container, child)`\n *\n * Same as `removeChild`, but for when a node is detached from the root container. This is useful if attaching\n * to the root has a slightly different implementation, or if the root container nodes are of a different type\n * than the rest of the tree.\n */\n removeChildFromContainer: removeChild,\n\n /**\n * #### `resetTextContent(instance)`\n *\n * If you returned `true` from `shouldSetTextContent` for the previous props, but returned `false` from\n * `shouldSetTextContent` for the next props, React will call this method so that you can clear the text\n * content you were managing manually. For example, in the DOM you could set `node.textContent = ''`.\n *\n * If you never return `true` from `shouldSetTextContent`, you can leave it empty.\n */\n resetTextContent(_instance: Instance): void {\n // noop\n },\n\n /**\n * #### `commitTextUpdate(textInstance, prevText, nextText)`\n *\n * This method should mutate the `textInstance` and update its text content to `nextText`.\n *\n * Here, `textInstance` is a node created by `createTextInstance`.\n */\n commitTextUpdate(textInstance: TextInstance, _oldText: string, newText: string): void {\n textInstance.text = newText;\n },\n\n /**\n * #### `commitMount(instance, type, props, internalHandle)`\n *\n * This method is only called if you returned `true` from `finalizeInitialChildren` for this instance.\n *\n * It lets you do some additional work after the node is actually attached to the tree on the screen for\n * the first time. For example, the DOM renderer uses it to trigger focus on nodes with the `autoFocus` attribute.\n *\n * Note that `commitMount` does not mirror `removeChild` one to one because `removeChild` is only called for\n * the top-level removed node. This is why ideally `commitMount` should not mutate any nodes other than the\n * `instance` itself. For example, if it registers some events on some node above, it will be your responsibility\n * to traverse the tree in `removeChild` and clean them up, which is not ideal.\n *\n * The `internalHandle` data structure is meant to be opaque. If you bend the rules and rely on its internal\n * fields, be aware that it may change significantly between versions. You're taking on additional maintenance\n * risk by reading from it, and giving up all guarantees if you write something to it.\n *\n * If you never return `true` from `finalizeInitialChildren`, you can leave it empty.\n */\n commitMount(_instance: Instance, _type: Type, _props: Props, _internalHandle: Fiber): void {\n // noop\n },\n\n /**\n * #### `commitUpdate(instance, type, prevProps, nextProps, internalHandle)`\n *\n * This method should mutate the `instance` according to the set of changes in `updatePayload`. Here, `updatePayload`\n * is the object that you've returned from `prepareUpdate` and has an arbitrary structure that makes sense for your\n * renderer. For example, the DOM renderer returns an update payload like `[prop1, value1, prop2, value2, ...]` from\n * `prepareUpdate`, and that structure gets passed into `commitUpdate`. Ideally, all the diffing and calculation\n * should happen inside `prepareUpdate` so that `commitUpdate` can be fast and straightforward.\n *\n * The `internalHandle` data structure is meant to be opaque. If you bend the rules and rely on its internal fields,\n * be aware that it may change significantly between versions. You're taking on additional maintenance risk by\n * reading from it, and giving up all guarantees if you write something to it.\n */\n // @ts-expect-error @types/react-reconciler types don't fully match react-reconciler's actual Flow types.\n // Correctness is verified through tests.\n commitUpdate(\n instance: Instance,\n type: Type,\n _prevProps: Props,\n nextProps: Props,\n internalHandle: Fiber,\n ): void {\n instance.type = type;\n instance.props = nextProps;\n instance.unstable_fiber = internalHandle;\n },\n\n /**\n * #### `hideInstance(instance)`\n *\n * This method should make the `instance` invisible without removing it from the tree. For example, it can apply\n * visual styling to hide it. It is used by Suspense to hide the tree while the fallback is visible.\n */\n hideInstance(instance: Instance): void {\n instance.isHidden = true;\n },\n\n /**\n * #### `hideTextInstance(textInstance)`\n *\n * Same as `hideInstance`, but for nodes created by `createTextInstance`.\n */\n hideTextInstance(textInstance: TextInstance): void {\n textInstance.isHidden = true;\n },\n\n /**\n * #### `unhideInstance(instance, props)`\n *\n * This method should make the `instance` visible, undoing what `hideInstance` did.\n */\n unhideInstance(instance: Instance, _props: Props): void {\n instance.isHidden = false;\n },\n\n /**\n * #### `unhideTextInstance(textInstance, text)`\n *\n * Same as `unhideInstance`, but for nodes created by `createTextInstance`.\n */\n unhideTextInstance(textInstance: TextInstance, _text: string): void {\n textInstance.isHidden = false;\n },\n\n /**\n * #### `clearContainer(container)`\n *\n * This method should mutate the `container` root node and remove all children from it.\n */\n clearContainer(container: Container): void {\n container.children.forEach((child) => {\n child.parent = null;\n });\n\n container.children.splice(0);\n },\n\n /**\n * #### `maySuspendCommit(type, props)`\n *\n * This method is called during render to determine if the Host Component type and props require\n * some kind of loading process to complete before committing an update.\n */\n maySuspendCommit(_type: Type, _props: Props): boolean {\n return false;\n },\n\n /**\n * #### `preloadInstance(type, props)`\n *\n * This method may be called during render if the Host Component type and props might suspend a commit.\n * It can be used to initiate any work that might shorten the duration of a suspended commit.\n */\n preloadInstance(_type: Type, _props: Props): boolean {\n return true;\n },\n\n /**\n * #### `startSuspendingCommit()`\n *\n * This method is called just before the commit phase. Use it to set up any necessary state while any Host\n * Components that might suspend this commit are evaluated to determine if the commit must be suspended.\n */\n startSuspendingCommit() {},\n\n /**\n * #### `suspendInstance(type, props)`\n *\n * This method is called after `startSuspendingCommit` for each Host Component that indicated it might\n * suspend a commit.\n */\n suspendInstance() {},\n\n /**\n * #### `waitForCommitToBeReady()`\n *\n * This method is called after all `suspendInstance` calls are complete.\n *\n * Return `null` if the commit can happen immediately.\n * Return `(initiateCommit: Function) => Function` if the commit must be suspended. The argument to this\n * callback will initiate the commit when called. The return value is a cancellation function that the\n * Reconciler can use to abort the commit.\n */\n waitForCommitToBeReady() {\n return null;\n },\n\n // -------------------\n // Hydration Methods\n // (optional)\n // You can optionally implement hydration to \"attach\" to the existing tree during the initial render instead\n // of creating it from scratch. For example, the DOM renderer uses this to attach to an HTML markup.\n //\n // To support hydration, you need to declare `supportsHydration: true` and then implement the methods in\n // the \"Hydration\" section [listed in this file](https://github.com/facebook/react/blob/master/packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js).\n // File an issue if you need help.\n // -------------------\n supportsHydration: false,\n\n NotPendingTransition: null,\n\n resetFormInstance(_form: Instance) {},\n\n requestPostPaintCallback(_callback: (endTime: number) => void) {},\n};\n\nexport const TestReconciler = ReactReconciler(hostConfig);\n\n/**\n * This method should mutate the `parentInstance` and add the child to its list of children. For example,\n * in the DOM this would translate to a `parentInstance.appendChild(child)` call.\n *\n * Although this method currently runs in the commit phase, you still should not mutate any other nodes\n * in it. If you need to do some additional work when a node is definitely connected to the visible tree,\n * look at `commitMount`.\n */\nfunction appendChild(parentInstance: Container | Instance, child: Instance | TextInstance): void {\n const index = parentInstance.children.indexOf(child);\n if (index !== -1) {\n parentInstance.children.splice(index, 1);\n }\n\n child.parent = parentInstance;\n parentInstance.children.push(child);\n}\n\n/**\n * This method should mutate the `parentInstance` and place the `child` before `beforeChild` in the list\n * of its children. For example, in the DOM this would translate to a\n * `parentInstance.insertBefore(child, beforeChild)` call.\n *\n * Note that React uses this method both for insertions and for reordering nodes. Similar to DOM, it is\n * expected that you can call `insertBefore` to reposition an existing child. Do not mutate any other parts\n * of the tree from it.\n */\nfunction insertBefore(\n parentInstance: Container | Instance,\n child: Instance | TextInstance,\n beforeChild: Instance | TextInstance,\n): void {\n const index = parentInstance.children.indexOf(child);\n if (index !== -1) {\n parentInstance.children.splice(index, 1);\n }\n\n child.parent = parentInstance;\n const beforeIndex = parentInstance.children.indexOf(beforeChild);\n parentInstance.children.splice(beforeIndex, 0, child);\n}\n\n/**\n * This method should mutate the `parentInstance` to remove the `child` from the list of its children.\n *\n * React will only call it for the top-level node that is being removed. It is expected that garbage\n * collection would take care of the whole subtree. You are not expected to traverse the child tree in it.\n */\nfunction removeChild(parentInstance: Container | Instance, child: Instance | TextInstance): void {\n const index = parentInstance.children.indexOf(child);\n parentInstance.children.splice(index, 1);\n child.parent = null;\n}\n","export function formatComponentList(names: string[]): string {\n if (names.length === 0) {\n return \"\";\n }\n\n if (names.length === 1) {\n return `<${names[0]}>`;\n }\n\n if (names.length === 2) {\n return `<${names[0]}> or <${names[1]}>`;\n }\n\n const allButLast = names.slice(0, -1);\n const last = names[names.length - 1];\n\n return `${allButLast.map((name) => `<${name}>`).join(\", \")}, or <${last}>`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA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AM,gBAAgB,MAAM,IAAI;AAE/D,qBAAiB;AACjB,gBAAY;AAAA,EACd;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,IAAI,YAAyB;AAC3B,UAAI,aAAa,MAAM;AACrB,cAAM,IAAI,MAAM,qDAAqD;AAAA,MACvE;AAEA,aAAO,YAAY,aAAa,SAAS;AAAA,IAC3C;AAAA,EACF;AACF;","names":["import_constants","import_constants","ReactReconciler"]}
package/dist/index.d.cts CHANGED
@@ -71,8 +71,13 @@ declare class HostElement {
71
71
  * Options for configuring the test renderer root.
72
72
  */
73
73
  type RootOptions = {
74
- /** Types of valid text components. */
75
- textComponents?: string[];
74
+ /** Types of host components that are allowed to contain text nodes. Trying to render text outside of these components will throw an error. */
75
+ textComponentTypes?: string[];
76
+ /**
77
+ * Host component types to display to users in the error message when they try to render text outside of `textComponentTypes`.
78
+ * Defaults to `textComponentTypes`, but you may want to override the components mentioned in the error message.
79
+ */
80
+ publicTextComponentTypes?: string[];
76
81
  /** Function to create mock nodes for refs. */
77
82
  createNodeMock?: (element: ReactElement) => object;
78
83
  /** Callback called when React catches an error in an Error Boundary. Called with the error caught by the Error Boundary, and an errorInfo object containing the componentStack. */
package/dist/index.d.ts CHANGED
@@ -71,8 +71,13 @@ declare class HostElement {
71
71
  * Options for configuring the test renderer root.
72
72
  */
73
73
  type RootOptions = {
74
- /** Types of valid text components. */
75
- textComponents?: string[];
74
+ /** Types of host components that are allowed to contain text nodes. Trying to render text outside of these components will throw an error. */
75
+ textComponentTypes?: string[];
76
+ /**
77
+ * Host component types to display to users in the error message when they try to render text outside of `textComponentTypes`.
78
+ * Defaults to `textComponentTypes`, but you may want to override the components mentioned in the error message.
79
+ */
80
+ publicTextComponentTypes?: string[];
76
81
  /** Function to create mock nodes for refs. */
77
82
  createNodeMock?: (element: ReactElement) => object;
78
83
  /** Callback called when React catches an error in an Error Boundary. Called with the error caught by the Error Boundary, and an errorInfo object containing the componentStack. */
package/dist/index.js CHANGED
@@ -285,10 +285,12 @@ var hostConfig = {
285
285
  * throw here.
286
286
  */
287
287
  createTextInstance(text, rootContainer, hostContext, _internalHandle) {
288
- if (rootContainer.config.textComponents && !hostContext.isInsideText) {
288
+ var _a;
289
+ if (rootContainer.config.textComponentTypes && !hostContext.isInsideText) {
290
+ const componentTypes = (_a = rootContainer.config.publicTextComponentTypes) != null ? _a : rootContainer.config.textComponentTypes;
289
291
  throw new Error(
290
292
  `Invariant Violation: Text strings must be rendered within a ${formatComponentList(
291
- rootContainer.config.textComponents
293
+ componentTypes
292
294
  )} component. Detected attempt to render "${text}" string within a <${hostContext.type}> component.`
293
295
  );
294
296
  }
@@ -393,7 +395,7 @@ var hostConfig = {
393
395
  */
394
396
  getChildHostContext(parentHostContext, type) {
395
397
  var _a;
396
- const isInsideText = Boolean((_a = parentHostContext.config.textComponents) == null ? void 0 : _a.includes(type));
398
+ const isInsideText = Boolean((_a = parentHostContext.config.textComponentTypes) == null ? void 0 : _a.includes(type));
397
399
  return __spreadProps(__spreadValues({}, parentHostContext), { type, isInsideText });
398
400
  },
399
401
  /**
@@ -781,7 +783,8 @@ function createRoot(options) {
781
783
  children: [],
782
784
  isHidden: false,
783
785
  config: {
784
- textComponents: options == null ? void 0 : options.textComponents,
786
+ textComponentTypes: options == null ? void 0 : options.textComponentTypes,
787
+ publicTextComponentTypes: options == null ? void 0 : options.publicTextComponentTypes,
785
788
  createNodeMock: (_a = options == null ? void 0 : options.createNodeMock) != null ? _a : defaultCreateMockNode
786
789
  }
787
790
  };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/renderer.ts","../src/constants.ts","../src/query-all.ts","../src/render-to-json.ts","../src/host-element.ts","../src/reconciler.ts","../src/utils.ts"],"sourcesContent":["import type { ReactElement } from \"react\";\nimport { ConcurrentRoot } from \"react-reconciler/constants\";\n\nimport { Tag } from \"./constants\";\nimport { HostElement } from \"./host-element\";\nimport type { Container } from \"./reconciler\";\nimport { TestReconciler } from \"./reconciler\";\n\n// Refs:\n// https://github.com/facebook/react/blob/main/packages/react-test-renderer/src/ReactFiberConfigTestHost.js\n// https://github.com/facebook/react/blob/main/packages/react-noop-renderer/src/createReactNoop.js\n// https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactFiberConfigFabric.js\n\nconst defaultCreateMockNode = () => ({});\n\nconst defaultOnUncaughtError = (error: unknown, errorInfo: ErrorInfo) => {\n console.error(\"Uncaught error:\", error, errorInfo);\n};\nconst defaultOnCaughtError = (error: unknown, errorInfo: ErrorInfo) => {\n console.error(\"Caught error:\", error, errorInfo);\n};\nconst defaultOnRecoverableError = (error: unknown, errorInfo: ErrorInfo) => {\n console.error(\"Recoverable error:\", error, errorInfo);\n};\n\n/**\n * Options for configuring the test renderer root.\n */\nexport type RootOptions = {\n /** Types of valid text components. */\n textComponents?: string[];\n\n /** Function to create mock nodes for refs. */\n createNodeMock?: (element: ReactElement) => object;\n\n /** Callback called when React catches an error in an Error Boundary. Called with the error caught by the Error Boundary, and an errorInfo object containing the componentStack. */\n onCaughtError?: ErrorHandler;\n\n /** Callback called when an error is thrown and not caught by an Error Boundary. Called with the error that was thrown, and an errorInfo object containing the componentStack. */\n onUncaughtError?: ErrorHandler;\n\n /** Callback called when React automatically recovers from errors. Called with an error React throws, and an errorInfo object containing the componentStack. Some recoverable errors may include the original error cause as error.cause. */\n onRecoverableError?: ErrorHandler;\n\n /** A string prefix React uses for IDs generated by useId. Useful to avoid conflicts when using multiple roots on the same page. */\n identifierPrefix?: string;\n\n /** Enable React Strict Mode. */\n isStrictMode?: boolean;\n};\n\n/** Callback for handling React errors. */\nexport type ErrorHandler = (error: unknown, errorInfo: ErrorInfo) => void;\n\n/** Error information provided to error handlers. */\nexport type ErrorInfo = {\n componentStack: string;\n};\n\n/**\n * Root instance returned by createRoot. Provides methods to render and unmount components.\n */\nexport type Root = {\n /** Render a React element into the root. Must be called within act(). */\n render: (element: ReactElement) => void;\n /** Unmount the root and clean up. Must be called within act(). */\n unmount: () => void;\n /** The root container element. */\n container: HostElement;\n};\n\n/**\n * Create a new test renderer root instance.\n *\n * @param options - Optional configuration for the renderer.\n * @returns A Root instance with render, unmount, and container properties.\n */\nexport function createRoot(options?: RootOptions): Root {\n let container: Container | null = {\n tag: Tag.Container,\n parent: null,\n children: [],\n isHidden: false,\n config: {\n textComponents: options?.textComponents,\n createNodeMock: options?.createNodeMock ?? defaultCreateMockNode,\n },\n };\n\n // @types/react-reconciler types don't fully match react-reconciler's actual Flow types.\n // The return type is correct at runtime but TypeScript can't verify it statically.\n // Correctness is verified through tests.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n let containerFiber = TestReconciler.createContainer(\n container,\n ConcurrentRoot,\n null, // hydrationCallbacks\n options?.isStrictMode ?? false,\n false, // concurrentUpdatesByDefaultOverride\n options?.identifierPrefix ?? \"\",\n options?.onUncaughtError ?? defaultOnUncaughtError,\n options?.onCaughtError ?? defaultOnCaughtError,\n // @ts-expect-error @types/react-reconciler types don't include onRecoverableError parameter\n // in the createContainer signature, but react-reconciler's actual Flow types do.\n // Correctness is verified through tests.\n options?.onRecoverableError ?? defaultOnRecoverableError,\n null, // transitionCallbacks\n );\n\n const render = (element: ReactElement) => {\n if (containerFiber == null) {\n throw new Error(\"Cannot render after unmount\");\n }\n\n TestReconciler.updateContainer(element, containerFiber, null, null);\n };\n\n const unmount = () => {\n if (container == null) {\n return;\n }\n\n TestReconciler.updateContainer(null, containerFiber, null, null);\n\n containerFiber = null;\n container = null;\n };\n\n return {\n render,\n unmount,\n get container(): HostElement {\n if (container == null) {\n throw new Error(\"Cannot access .container on unmounted test renderer\");\n }\n\n return HostElement.fromInstance(container);\n },\n };\n}\n","export const Tag = {\n Container: \"CONTAINER\",\n Instance: \"INSTANCE\",\n Text: \"TEXT\",\n} as const;\n\n// Container should render as <>{...}</>\nexport const CONTAINER_TYPE = \"\";\n","import type { HostElement } from \"./host-element\";\n\n/**\n * Options for querying elements in the rendered tree.\n */\nexport interface QueryOptions {\n /** Include the element itself in the results if it matches the predicate. Defaults to false. */\n includeSelf?: boolean;\n\n /** Exclude any ancestors of deepest matched elements even if they match the predicate. Defaults to false. */\n matchDeepestOnly?: boolean;\n}\n\n/**\n * Find all descendant elements matching the predicate.\n *\n * @param element - Root element to search from.\n * @param predicate - Function that returns true for matching elements.\n * @param options - Optional query configuration.\n * @returns Array of matching elements in tree order.\n */\nexport function queryAll(\n element: HostElement,\n predicate: (element: HostElement) => boolean,\n options?: QueryOptions,\n): HostElement[] {\n const includeSelf = options?.includeSelf ?? false;\n const matchDeepestOnly = options?.matchDeepestOnly ?? false;\n\n const results: HostElement[] = [];\n\n // Match descendants first but do not add them to results yet.\n const matchingDescendants: HostElement[] = [];\n\n element.children.forEach((child) => {\n if (typeof child === \"string\") {\n return;\n }\n\n matchingDescendants.push(...queryAll(child, predicate, { ...options, includeSelf: true }));\n });\n\n if (\n includeSelf &&\n // When matchDeepestOnly = true: add current element only if no descendants match\n (matchingDescendants.length === 0 || !matchDeepestOnly) &&\n predicate(element)\n ) {\n results.push(element);\n }\n\n // Add matching descendants after element to preserve original tree walk order.\n results.push(...matchingDescendants);\n\n return results;\n}\n","import { CONTAINER_TYPE, Tag } from \"./constants\";\nimport type { Container, Instance, TextInstance } from \"./reconciler\";\n\n/** A node in the JSON representation - either a JsonElement or a text string. */\nexport type JsonNode = JsonElement | string;\n\n/**\n * JSON representation of a rendered element, compatible with react-test-renderer format.\n */\nexport type JsonElement = {\n type: string;\n props: object;\n children: Array<JsonNode> | null;\n $$typeof: symbol;\n};\n\nexport function renderContainerToJson(instance: Container): JsonElement {\n return {\n type: CONTAINER_TYPE,\n props: {},\n children: renderChildrenToJson(instance.children),\n $$typeof: Symbol.for(\"react.test.json\"),\n };\n}\n\nexport function renderInstanceToJson(instance: Instance): JsonElement | null {\n if (instance.isHidden) {\n return null;\n }\n\n // We don't include the `children` prop in JSON.\n // Instead, we will include the actual rendered children.\n const { children: _children, ...restProps } = instance.props;\n\n return {\n type: instance.type,\n props: restProps,\n children: renderChildrenToJson(instance.children),\n $$typeof: Symbol.for(\"react.test.json\"),\n };\n}\n\nexport function renderTextInstanceToJson(instance: TextInstance): string | null {\n if (instance.isHidden) {\n return null;\n }\n\n return instance.text;\n}\n\nexport function renderChildrenToJson(children: Array<Instance | TextInstance>): JsonNode[] {\n const result = [];\n\n for (const child of children) {\n if (child.tag === Tag.Instance) {\n const renderedChild = renderInstanceToJson(child);\n if (renderedChild !== null) {\n result.push(renderedChild);\n }\n } else {\n const renderedChild = renderTextInstanceToJson(child);\n if (renderedChild !== null) {\n result.push(renderedChild);\n }\n }\n }\n\n return result;\n}\n","import type { Fiber } from \"react-reconciler\";\n\nimport { CONTAINER_TYPE, Tag } from \"./constants\";\nimport type { QueryOptions } from \"./query-all\";\nimport { queryAll } from \"./query-all\";\nimport type { Container, Instance, TextInstance } from \"./reconciler\";\nimport type { JsonElement } from \"./render-to-json\";\nimport { renderContainerToJson, renderInstanceToJson } from \"./render-to-json\";\n\n/** A node in the rendered tree - either a HostElement or a text string. */\nexport type HostNode = HostElement | string;\n\n/** Props object for a host element. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type HostElementProps = Record<string, any>;\n\nconst instanceMap = new WeakMap<Instance | Container, HostElement>();\n\n/**\n * Represents a rendered host element in the test renderer tree.\n * Provides a DOM-like API for querying and inspecting rendered components.\n */\nexport class HostElement {\n private instance: Instance | Container;\n\n private constructor(instance: Instance | Container) {\n this.instance = instance;\n }\n\n /** The element type (e.g., \"div\", \"span\"). Empty string for container. */\n get type(): string {\n return this.instance.tag === Tag.Instance ? this.instance.type : CONTAINER_TYPE;\n }\n\n /** The element's props object. */\n get props(): HostElementProps {\n return this.instance.tag === Tag.Instance ? this.instance.props : {};\n }\n\n /** The parent element, or null if this is the root container. */\n get parent(): HostElement | null {\n const parentInstance = this.instance.parent;\n if (parentInstance == null) {\n return null;\n }\n\n return HostElement.fromInstance(parentInstance);\n }\n\n /** Array of child nodes (elements and text strings). Hidden children are excluded. */\n get children(): HostNode[] {\n const result = this.instance.children\n .filter((child) => !child.isHidden)\n .map((child) => getHostNodeForInstance(child));\n return result;\n }\n\n /**\n * Access to the underlying React Fiber node. This is an unstable API that exposes\n * internal react-reconciler structures which may change without warning in future\n * React versions. Use with caution and only when absolutely necessary.\n *\n * @returns The Fiber node for this instance, or null if this is a container.\n */\n get unstable_fiber(): Fiber | null {\n return this.instance.tag === Tag.Instance ? this.instance.unstable_fiber : null;\n }\n\n /**\n * Convert this element to a JSON representation suitable for snapshots.\n *\n * @returns JSON element or null if the element is hidden.\n */\n toJSON(): JsonElement | null {\n return this.instance.tag === Tag.Container\n ? renderContainerToJson(this.instance)\n : renderInstanceToJson(this.instance);\n }\n\n /**\n * Find all descendant elements matching the predicate.\n *\n * @param predicate - Function that returns true for matching elements.\n * @param options - Optional query configuration.\n * @returns Array of matching elements.\n */\n queryAll(\n predicate: (element: HostElement, options?: QueryOptions) => boolean,\n options?: QueryOptions,\n ): HostElement[] {\n return queryAll(this, predicate, options);\n }\n\n /** @internal */\n static fromInstance(instance: Instance | Container): HostElement {\n const hostElement = instanceMap.get(instance);\n if (hostElement) {\n return hostElement;\n }\n\n const result = new HostElement(instance);\n instanceMap.set(instance, result);\n return result;\n }\n}\n\nfunction getHostNodeForInstance(instance: Instance | TextInstance): HostNode {\n switch (instance.tag) {\n case Tag.Text:\n return instance.text;\n\n case Tag.Instance:\n return HostElement.fromInstance(instance);\n }\n}\n","import type { ReactElement } from \"react\";\nimport type { Fiber } from \"react-reconciler\";\nimport ReactReconciler from \"react-reconciler\";\nimport { DefaultEventPriority, NoEventPriority } from \"react-reconciler/constants\";\n\nimport { Tag } from \"./constants\";\nimport { formatComponentList } from \"./utils\";\n\nexport type Type = string;\nexport type Props = Record<string, unknown>;\n\ntype ReconcilerConfig = {\n textComponents?: string[];\n createNodeMock: (element: ReactElement) => object;\n};\n\nexport type Container = {\n tag: typeof Tag.Container;\n parent: null;\n children: Array<Instance | TextInstance>;\n isHidden: false;\n config: ReconcilerConfig;\n};\n\nexport type Instance = {\n tag: typeof Tag.Instance;\n type: string;\n props: Props;\n children: Array<Instance | TextInstance>;\n parent: Container | Instance | null;\n rootContainer: Container;\n isHidden: boolean;\n unstable_fiber: Fiber;\n};\n\nexport type TextInstance = {\n tag: typeof Tag.Text;\n text: string;\n parent: Container | Instance | null;\n isHidden: boolean;\n};\n\nexport type SuspenseInstance = object;\nexport type HydratableInstance = object;\nexport type PublicInstance = object | TextInstance;\nexport type UpdatePayload = unknown;\nexport type ChildSet = unknown;\nexport type TimeoutHandle = unknown;\nexport type NoTimeout = unknown;\n\ntype HostContext = {\n type: string;\n isInsideText: boolean;\n config: ReconcilerConfig;\n};\n\nconst nodeToInstanceMap = new WeakMap<object, Instance>();\n\nlet currentUpdatePriority: number = NoEventPriority;\n\nconst hostConfig: ReactReconciler.HostConfig<\n Type,\n Props,\n Container,\n Instance,\n TextInstance,\n SuspenseInstance,\n HydratableInstance,\n PublicInstance,\n HostContext,\n UpdatePayload,\n ChildSet,\n TimeoutHandle,\n NoTimeout\n> = {\n /**\n * The reconciler has two modes: mutation mode and persistent mode. You must specify one of them.\n *\n * If your target platform is similar to the DOM and has methods similar to `appendChild`, `removeChild`,\n * and so on, you'll want to use the **mutation mode**. This is the same mode used by React DOM, React ART,\n * and the classic React Native renderer.\n *\n * ```js\n * const HostConfig = {\n * // ...\n * supportsMutation: true,\n * // ...\n * }\n * ```\n *\n * Depending on the mode, the reconciler will call different methods on your host config.\n * If you're not sure which one you want, you likely need the mutation mode.\n */\n supportsMutation: true,\n\n /**\n * The reconciler has two modes: mutation mode and persistent mode. You must specify one of them.\n *\n * If your target platform has immutable trees, you'll want the **persistent mode** instead. In that mode,\n * existing nodes are never mutated, and instead every change clones the parent tree and then replaces\n * the whole parent tree at the root. This is the node used by the new React Native renderer, codenamed \"Fabric\".\n *\n * ```js\n * const HostConfig = {\n * // ...\n * supportsPersistence: true,\n * // ...\n * }\n * ```\n *\n * Depending on the mode, the reconciler will call different methods on your host config.\n * If you're not sure which one you want, you likely need the mutation mode.\n */\n supportsPersistence: false,\n\n /**\n * #### `createInstance(type, props, rootContainer, hostContext, internalHandle)`\n *\n * This method should return a newly created node. For example, the DOM renderer would call\n * `document.createElement(type)` here and then set the properties from `props`.\n *\n * You can use `rootContainer` to access the root container associated with that tree. For example,\n * in the DOM renderer, this is useful to get the correct `document` reference that the root belongs to.\n *\n * The `hostContext` parameter lets you keep track of some information about your current place in\n * the tree. To learn more about it, see `getChildHostContext` below.\n *\n * The `internalHandle` data structure is meant to be opaque. If you bend the rules and rely on its\n * internal fields, be aware that it may change significantly between versions. You're taking on additional\n * maintenance risk by reading from it, and giving up all guarantees if you write something to it.\n *\n * This method happens **in the render phase**. It can (and usually should) mutate the node it has\n * just created before returning it, but it must not modify any other nodes. It must not register\n * any event handlers on the parent tree. This is because an instance being created doesn't guarantee\n * it would be placed in the tree — it could be left unused and later collected by GC. If you need to do\n * something when an instance is definitely in the tree, look at `commitMount` instead.\n */\n createInstance(\n type: Type,\n props: Props,\n rootContainer: Container,\n _hostContext: HostContext,\n internalHandle: Fiber,\n ) {\n return {\n tag: Tag.Instance,\n type,\n props,\n isHidden: false,\n children: [],\n parent: null,\n rootContainer,\n unstable_fiber: internalHandle,\n };\n },\n\n /**\n * #### `createTextInstance(text, rootContainer, hostContext, internalHandle)`\n *\n * Same as `createInstance`, but for text nodes. If your renderer doesn't support text nodes, you can\n * throw here.\n */\n createTextInstance(\n text: string,\n rootContainer: Container,\n hostContext: HostContext,\n _internalHandle: Fiber,\n ): TextInstance {\n if (rootContainer.config.textComponents && !hostContext.isInsideText) {\n throw new Error(\n `Invariant Violation: Text strings must be rendered within a ${formatComponentList(\n rootContainer.config.textComponents,\n )} component. Detected attempt to render \"${text}\" string within a <${\n hostContext.type\n }> component.`,\n );\n }\n\n return {\n tag: Tag.Text,\n text,\n parent: null,\n isHidden: false,\n };\n },\n\n /**\n * #### `appendInitialChild(parentInstance, child)`\n *\n * This method should mutate the `parentInstance` and add the child to its list of children.\n * For example, in the DOM this would translate to a `parentInstance.appendChild(child)` call.\n *\n * This method happens **in the render phase**. It can mutate `parentInstance` and `child`, but it\n * must not modify any other nodes. It's called while the tree is still being built up and not connected\n * to the actual tree on the screen.\n */\n appendInitialChild: appendChild,\n\n /**\n * #### `finalizeInitialChildren(instance, type, props, rootContainer, hostContext)`\n *\n * In this method, you can perform some final mutations on the `instance`. Unlike with `createInstance`,\n * by the time `finalizeInitialChildren` is called, all the initial children have already been added to\n * the `instance`, but the instance itself has not yet been connected to the tree on the screen.\n *\n * This method happens **in the render phase**. It can mutate `instance`, but it must not modify any other\n * nodes. It's called while the tree is still being built up and not connected to the actual tree on the screen.\n *\n * There is a second purpose to this method. It lets you specify whether there is some work that needs to\n * happen when the node is connected to the tree on the screen. If you return `true`, the instance will\n * receive a `commitMount` call later. See its documentation below.\n *\n * If you don't want to do anything here, you should return `false`.\n */\n finalizeInitialChildren(\n _instance: Instance,\n _type: Type,\n _props: Props,\n _rootContainer: Container,\n _hostContext: HostContext,\n ): boolean {\n return false;\n },\n\n /**\n * #### `shouldSetTextContent(type, props)`\n *\n * Some target platforms support setting an instance's text content without manually creating a text node.\n * For example, in the DOM, you can set `node.textContent` instead of creating a text node and appending it.\n *\n * If you return `true` from this method, React will assume that this node's children are text, and will\n * not create nodes for them. It will instead rely on you to have filled that text during `createInstance`.\n * This is a performance optimization. For example, the DOM renderer returns `true` only if `type` is a\n * known text-only parent (like `'textarea'`) or if `props.children` has a `'string'` type. If you return `true`,\n * you will need to implement `resetTextContent` too.\n *\n * If you don't want to do anything here, you should return `false`.\n * This method happens **in the render phase**. Do not mutate the tree from it.\n */\n shouldSetTextContent(_type: Type, _props: Props): boolean {\n return false;\n },\n\n setCurrentUpdatePriority(newPriority: number) {\n currentUpdatePriority = newPriority;\n },\n\n getCurrentUpdatePriority() {\n return currentUpdatePriority;\n },\n\n resolveUpdatePriority(): number {\n return currentUpdatePriority || DefaultEventPriority;\n },\n\n shouldAttemptEagerTransition() {\n return false;\n },\n\n /**\n * #### `getRootHostContext(rootContainer)`\n *\n * This method lets you return the initial host context from the root of the tree. See `getChildHostContext`\n * for the explanation of host context.\n *\n * If you don't intend to use host context, you can return `null`.\n * This method happens **in the render phase**. Do not mutate the tree from it.\n */\n getRootHostContext(rootContainer: Container): HostContext | null {\n return {\n type: \"ROOT\",\n config: rootContainer.config,\n isInsideText: false,\n };\n },\n\n /**\n * #### `getChildHostContext(parentHostContext, type, rootContainer)`\n *\n * Host context lets you track some information about where you are in the tree so that it's available\n * inside `createInstance` as the `hostContext` parameter. For example, the DOM renderer uses it to track\n * whether it's inside an HTML or an SVG tree, because `createInstance` implementation needs to be\n * different for them.\n *\n * If the node of this `type` does not influence the context you want to pass down, you can return\n * `parentHostContext`. Alternatively, you can return any custom object representing the information\n * you want to pass down.\n *\n * If you don't want to do anything here, return `parentHostContext`.\n *\n * This method happens **in the render phase**. Do not mutate the tree from it.\n */\n getChildHostContext(parentHostContext: HostContext, type: Type): HostContext {\n const isInsideText = Boolean(parentHostContext.config.textComponents?.includes(type));\n return { ...parentHostContext, type: type, isInsideText };\n },\n\n /**\n * #### `getPublicInstance(instance)`\n *\n * Determines what object gets exposed as a ref. You'll likely want to return the `instance` itself. But\n * in some cases it might make sense to only expose some part of it.\n *\n * If you don't want to do anything here, return `instance`.\n */\n getPublicInstance(instance: Instance | TextInstance): PublicInstance {\n switch (instance.tag) {\n case Tag.Instance: {\n const createNodeMock = instance.rootContainer.config.createNodeMock;\n const mockNode = createNodeMock({\n type: instance.type,\n props: instance.props,\n key: null,\n });\n\n nodeToInstanceMap.set(mockNode, instance);\n\n return mockNode;\n }\n\n default:\n return instance;\n }\n },\n\n /**\n * #### `prepareForCommit(containerInfo)`\n *\n * This method lets you store some information before React starts making changes to the tree on\n * the screen. For example, the DOM renderer stores the current text selection so that it can later\n * restore it. This method is mirrored by `resetAfterCommit`.\n *\n * Even if you don't want to do anything here, you need to return `null` from it.\n */\n prepareForCommit(_containerInfo: Container) {\n return null; // noop\n },\n\n /**\n * #### `resetAfterCommit(containerInfo)`\n *\n * This method is called right after React has performed the tree mutations. You can use it to restore\n * something you've stored in `prepareForCommit` — for example, text selection.\n *\n * You can leave it empty.\n */\n resetAfterCommit(_containerInfo: Container): void {\n // noop\n },\n\n /**\n * #### `preparePortalMount(containerInfo)`\n *\n * This method is called for a container that's used as a portal target. Usually you can leave it empty.\n */\n preparePortalMount(_containerInfo: Container): void {\n // noop\n },\n\n /**\n * #### `scheduleTimeout(fn, delay)`\n *\n * You can proxy this to `setTimeout` or its equivalent in your environment.\n */\n scheduleTimeout: setTimeout,\n\n /**\n * #### `cancelTimeout(id)`\n *\n * You can proxy this to `clearTimeout` or its equivalent in your environment.\n */\n cancelTimeout: clearTimeout,\n\n /**\n * #### `noTimeout`\n *\n * This is a property (not a function) that should be set to something that can never be a valid timeout ID.\n * For example, you can set it to `-1`.\n */\n noTimeout: -1,\n\n /**\n * #### `supportsMicrotasks`\n *\n * Set this to `true` to indicate that your renderer supports `scheduleMicrotask`. We use microtasks as part\n * of our discrete event implementation in React DOM. If you're not sure if your renderer should support this,\n * you probably should. The option to not implement `scheduleMicrotask` exists so that platforms with more control\n * over user events, like React Native, can choose to use a different mechanism.\n */\n supportsMicrotasks: true,\n\n /**\n * #### `scheduleMicrotask(fn)`\n *\n * Optional. You can proxy this to `queueMicrotask` or its equivalent in your environment.\n */\n scheduleMicrotask: queueMicrotask,\n\n /**\n * #### `isPrimaryRenderer`\n *\n * This is a property (not a function) that should be set to `true` if your renderer is the main one on the\n * page. For example, if you're writing a renderer for the Terminal, it makes sense to set it to `true`, but\n * if your renderer is used *on top of* React DOM or some other existing renderer, set it to `false`.\n */\n isPrimaryRenderer: true,\n\n /**\n * Whether the renderer shouldn't trigger missing `act()` warnings\n */\n warnsIfNotActing: true,\n\n getInstanceFromNode(node: object): Fiber | null | undefined {\n const instance = nodeToInstanceMap.get(node);\n if (instance !== undefined) {\n return instance.unstable_fiber;\n }\n\n return null;\n },\n\n beforeActiveInstanceBlur(): void {\n // noop\n },\n\n afterActiveInstanceBlur(): void {\n // noop\n },\n\n prepareScopeUpdate(scopeInstance: object, instance: Instance): void {\n nodeToInstanceMap.set(scopeInstance, instance);\n },\n\n getInstanceFromScope(scopeInstance: object): Instance | null {\n return nodeToInstanceMap.get(scopeInstance) ?? null;\n },\n\n detachDeletedInstance(_node: Instance): void {},\n\n /**\n * #### `appendChild(parentInstance, child)`\n *\n * This method should mutate the `parentInstance` and add the child to its list of children. For example,\n * in the DOM this would translate to a `parentInstance.appendChild(child)` call.\n *\n * Although this method currently runs in the commit phase, you still should not mutate any other nodes\n * in it. If you need to do some additional work when a node is definitely connected to the visible tree, look at `commitMount`.\n */\n appendChild: appendChild,\n\n /**\n * #### `appendChildToContainer(container, child)`\n *\n * Same as `appendChild`, but for when a node is attached to the root container. This is useful if attaching\n * to the root has a slightly different implementation, or if the root container nodes are of a different\n * type than the rest of the tree.\n */\n appendChildToContainer: appendChild,\n\n /**\n * #### `insertBefore(parentInstance, child, beforeChild)`\n *\n * This method should mutate the `parentInstance` and place the `child` before `beforeChild` in the list of\n * its children. For example, in the DOM this would translate to a `parentInstance.insertBefore(child, beforeChild)` call.\n *\n * Note that React uses this method both for insertions and for reordering nodes. Similar to DOM, it is expected\n * that you can call `insertBefore` to reposition an existing child. Do not mutate any other parts of the tree from it.\n */\n insertBefore: insertBefore,\n\n /**\n * #### `insertInContainerBefore(container, child, beforeChild)\n *\n * Same as `insertBefore`, but for when a node is attached to the root container. This is useful if attaching\n * to the root has a slightly different implementation, or if the root container nodes are of a different type\n * than the rest of the tree.\n */\n insertInContainerBefore: insertBefore,\n\n /**\n * #### `removeChild(parentInstance, child)`\n *\n * This method should mutate the `parentInstance` to remove the `child` from the list of its children.\n *\n * React will only call it for the top-level node that is being removed. It is expected that garbage collection\n * would take care of the whole subtree. You are not expected to traverse the child tree in it.\n */\n removeChild: removeChild,\n\n /**\n * #### `removeChildFromContainer(container, child)`\n *\n * Same as `removeChild`, but for when a node is detached from the root container. This is useful if attaching\n * to the root has a slightly different implementation, or if the root container nodes are of a different type\n * than the rest of the tree.\n */\n removeChildFromContainer: removeChild,\n\n /**\n * #### `resetTextContent(instance)`\n *\n * If you returned `true` from `shouldSetTextContent` for the previous props, but returned `false` from\n * `shouldSetTextContent` for the next props, React will call this method so that you can clear the text\n * content you were managing manually. For example, in the DOM you could set `node.textContent = ''`.\n *\n * If you never return `true` from `shouldSetTextContent`, you can leave it empty.\n */\n resetTextContent(_instance: Instance): void {\n // noop\n },\n\n /**\n * #### `commitTextUpdate(textInstance, prevText, nextText)`\n *\n * This method should mutate the `textInstance` and update its text content to `nextText`.\n *\n * Here, `textInstance` is a node created by `createTextInstance`.\n */\n commitTextUpdate(textInstance: TextInstance, _oldText: string, newText: string): void {\n textInstance.text = newText;\n },\n\n /**\n * #### `commitMount(instance, type, props, internalHandle)`\n *\n * This method is only called if you returned `true` from `finalizeInitialChildren` for this instance.\n *\n * It lets you do some additional work after the node is actually attached to the tree on the screen for\n * the first time. For example, the DOM renderer uses it to trigger focus on nodes with the `autoFocus` attribute.\n *\n * Note that `commitMount` does not mirror `removeChild` one to one because `removeChild` is only called for\n * the top-level removed node. This is why ideally `commitMount` should not mutate any nodes other than the\n * `instance` itself. For example, if it registers some events on some node above, it will be your responsibility\n * to traverse the tree in `removeChild` and clean them up, which is not ideal.\n *\n * The `internalHandle` data structure is meant to be opaque. If you bend the rules and rely on its internal\n * fields, be aware that it may change significantly between versions. You're taking on additional maintenance\n * risk by reading from it, and giving up all guarantees if you write something to it.\n *\n * If you never return `true` from `finalizeInitialChildren`, you can leave it empty.\n */\n commitMount(_instance: Instance, _type: Type, _props: Props, _internalHandle: Fiber): void {\n // noop\n },\n\n /**\n * #### `commitUpdate(instance, type, prevProps, nextProps, internalHandle)`\n *\n * This method should mutate the `instance` according to the set of changes in `updatePayload`. Here, `updatePayload`\n * is the object that you've returned from `prepareUpdate` and has an arbitrary structure that makes sense for your\n * renderer. For example, the DOM renderer returns an update payload like `[prop1, value1, prop2, value2, ...]` from\n * `prepareUpdate`, and that structure gets passed into `commitUpdate`. Ideally, all the diffing and calculation\n * should happen inside `prepareUpdate` so that `commitUpdate` can be fast and straightforward.\n *\n * The `internalHandle` data structure is meant to be opaque. If you bend the rules and rely on its internal fields,\n * be aware that it may change significantly between versions. You're taking on additional maintenance risk by\n * reading from it, and giving up all guarantees if you write something to it.\n */\n // @ts-expect-error @types/react-reconciler types don't fully match react-reconciler's actual Flow types.\n // Correctness is verified through tests.\n commitUpdate(\n instance: Instance,\n type: Type,\n _prevProps: Props,\n nextProps: Props,\n internalHandle: Fiber,\n ): void {\n instance.type = type;\n instance.props = nextProps;\n instance.unstable_fiber = internalHandle;\n },\n\n /**\n * #### `hideInstance(instance)`\n *\n * This method should make the `instance` invisible without removing it from the tree. For example, it can apply\n * visual styling to hide it. It is used by Suspense to hide the tree while the fallback is visible.\n */\n hideInstance(instance: Instance): void {\n instance.isHidden = true;\n },\n\n /**\n * #### `hideTextInstance(textInstance)`\n *\n * Same as `hideInstance`, but for nodes created by `createTextInstance`.\n */\n hideTextInstance(textInstance: TextInstance): void {\n textInstance.isHidden = true;\n },\n\n /**\n * #### `unhideInstance(instance, props)`\n *\n * This method should make the `instance` visible, undoing what `hideInstance` did.\n */\n unhideInstance(instance: Instance, _props: Props): void {\n instance.isHidden = false;\n },\n\n /**\n * #### `unhideTextInstance(textInstance, text)`\n *\n * Same as `unhideInstance`, but for nodes created by `createTextInstance`.\n */\n unhideTextInstance(textInstance: TextInstance, _text: string): void {\n textInstance.isHidden = false;\n },\n\n /**\n * #### `clearContainer(container)`\n *\n * This method should mutate the `container` root node and remove all children from it.\n */\n clearContainer(container: Container): void {\n container.children.forEach((child) => {\n child.parent = null;\n });\n\n container.children.splice(0);\n },\n\n /**\n * #### `maySuspendCommit(type, props)`\n *\n * This method is called during render to determine if the Host Component type and props require\n * some kind of loading process to complete before committing an update.\n */\n maySuspendCommit(_type: Type, _props: Props): boolean {\n return false;\n },\n\n /**\n * #### `preloadInstance(type, props)`\n *\n * This method may be called during render if the Host Component type and props might suspend a commit.\n * It can be used to initiate any work that might shorten the duration of a suspended commit.\n */\n preloadInstance(_type: Type, _props: Props): boolean {\n return true;\n },\n\n /**\n * #### `startSuspendingCommit()`\n *\n * This method is called just before the commit phase. Use it to set up any necessary state while any Host\n * Components that might suspend this commit are evaluated to determine if the commit must be suspended.\n */\n startSuspendingCommit() {},\n\n /**\n * #### `suspendInstance(type, props)`\n *\n * This method is called after `startSuspendingCommit` for each Host Component that indicated it might\n * suspend a commit.\n */\n suspendInstance() {},\n\n /**\n * #### `waitForCommitToBeReady()`\n *\n * This method is called after all `suspendInstance` calls are complete.\n *\n * Return `null` if the commit can happen immediately.\n * Return `(initiateCommit: Function) => Function` if the commit must be suspended. The argument to this\n * callback will initiate the commit when called. The return value is a cancellation function that the\n * Reconciler can use to abort the commit.\n */\n waitForCommitToBeReady() {\n return null;\n },\n\n // -------------------\n // Hydration Methods\n // (optional)\n // You can optionally implement hydration to \"attach\" to the existing tree during the initial render instead\n // of creating it from scratch. For example, the DOM renderer uses this to attach to an HTML markup.\n //\n // To support hydration, you need to declare `supportsHydration: true` and then implement the methods in\n // the \"Hydration\" section [listed in this file](https://github.com/facebook/react/blob/master/packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js).\n // File an issue if you need help.\n // -------------------\n supportsHydration: false,\n\n NotPendingTransition: null,\n\n resetFormInstance(_form: Instance) {},\n\n requestPostPaintCallback(_callback: (endTime: number) => void) {},\n};\n\nexport const TestReconciler = ReactReconciler(hostConfig);\n\n/**\n * This method should mutate the `parentInstance` and add the child to its list of children. For example,\n * in the DOM this would translate to a `parentInstance.appendChild(child)` call.\n *\n * Although this method currently runs in the commit phase, you still should not mutate any other nodes\n * in it. If you need to do some additional work when a node is definitely connected to the visible tree,\n * look at `commitMount`.\n */\nfunction appendChild(parentInstance: Container | Instance, child: Instance | TextInstance): void {\n const index = parentInstance.children.indexOf(child);\n if (index !== -1) {\n parentInstance.children.splice(index, 1);\n }\n\n child.parent = parentInstance;\n parentInstance.children.push(child);\n}\n\n/**\n * This method should mutate the `parentInstance` and place the `child` before `beforeChild` in the list\n * of its children. For example, in the DOM this would translate to a\n * `parentInstance.insertBefore(child, beforeChild)` call.\n *\n * Note that React uses this method both for insertions and for reordering nodes. Similar to DOM, it is\n * expected that you can call `insertBefore` to reposition an existing child. Do not mutate any other parts\n * of the tree from it.\n */\nfunction insertBefore(\n parentInstance: Container | Instance,\n child: Instance | TextInstance,\n beforeChild: Instance | TextInstance,\n): void {\n const index = parentInstance.children.indexOf(child);\n if (index !== -1) {\n parentInstance.children.splice(index, 1);\n }\n\n child.parent = parentInstance;\n const beforeIndex = parentInstance.children.indexOf(beforeChild);\n parentInstance.children.splice(beforeIndex, 0, child);\n}\n\n/**\n * This method should mutate the `parentInstance` to remove the `child` from the list of its children.\n *\n * React will only call it for the top-level node that is being removed. It is expected that garbage\n * collection would take care of the whole subtree. You are not expected to traverse the child tree in it.\n */\nfunction removeChild(parentInstance: Container | Instance, child: Instance | TextInstance): void {\n const index = parentInstance.children.indexOf(child);\n parentInstance.children.splice(index, 1);\n child.parent = null;\n}\n","export function formatComponentList(names: string[]): string {\n if (names.length === 0) {\n return \"\";\n }\n\n if (names.length === 1) {\n return `<${names[0]}>`;\n }\n\n if (names.length === 2) {\n return `<${names[0]}> or <${names[1]}>`;\n }\n\n const allButLast = names.slice(0, -1);\n const last = names[names.length - 1];\n\n return `${allButLast.map((name) => `<${name}>`).join(\", \")}, or <${last}>`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,sBAAsB;;;ACDxB,IAAM,MAAM;AAAA,EACjB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,MAAM;AACR;AAGO,IAAM,iBAAiB;;;ACcvB,SAAS,SACd,SACA,WACA,SACe;AAzBjB;AA0BE,QAAM,eAAc,wCAAS,gBAAT,YAAwB;AAC5C,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../src/render-to-json.ts","../src/host-element.ts","../src/reconciler.ts","../src/utils.ts"],"sourcesContent":["import type { ReactElement } from \"react\";\nimport { ConcurrentRoot } from \"react-reconciler/constants\";\n\nimport { Tag } from \"./constants\";\nimport { HostElement } from \"./host-element\";\nimport type { Container } from \"./reconciler\";\nimport { TestReconciler } from \"./reconciler\";\n\n// Refs:\n// https://github.com/facebook/react/blob/main/packages/react-test-renderer/src/ReactFiberConfigTestHost.js\n// https://github.com/facebook/react/blob/main/packages/react-noop-renderer/src/createReactNoop.js\n// https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactFiberConfigFabric.js\n\nconst defaultCreateMockNode = () => ({});\n\nconst defaultOnUncaughtError = (error: unknown, errorInfo: ErrorInfo) => {\n console.error(\"Uncaught error:\", error, errorInfo);\n};\nconst defaultOnCaughtError = (error: unknown, errorInfo: ErrorInfo) => {\n console.error(\"Caught error:\", error, errorInfo);\n};\nconst defaultOnRecoverableError = (error: unknown, errorInfo: ErrorInfo) => {\n console.error(\"Recoverable error:\", error, errorInfo);\n};\n\n/**\n * Options for configuring the test renderer root.\n */\nexport type RootOptions = {\n /** Types of host components that are allowed to contain text nodes. Trying to render text outside of these components will throw an error. */\n textComponentTypes?: string[];\n\n /**\n * Host component types to display to users in the error message when they try to render text outside of `textComponentTypes`.\n * Defaults to `textComponentTypes`, but you may want to override the components mentioned in the error message.\n */\n publicTextComponentTypes?: string[];\n\n /** Function to create mock nodes for refs. */\n createNodeMock?: (element: ReactElement) => object;\n\n /** Callback called when React catches an error in an Error Boundary. Called with the error caught by the Error Boundary, and an errorInfo object containing the componentStack. */\n onCaughtError?: ErrorHandler;\n\n /** Callback called when an error is thrown and not caught by an Error Boundary. Called with the error that was thrown, and an errorInfo object containing the componentStack. */\n onUncaughtError?: ErrorHandler;\n\n /** Callback called when React automatically recovers from errors. Called with an error React throws, and an errorInfo object containing the componentStack. Some recoverable errors may include the original error cause as error.cause. */\n onRecoverableError?: ErrorHandler;\n\n /** A string prefix React uses for IDs generated by useId. Useful to avoid conflicts when using multiple roots on the same page. */\n identifierPrefix?: string;\n\n /** Enable React Strict Mode. */\n isStrictMode?: boolean;\n};\n\n/** Callback for handling React errors. */\nexport type ErrorHandler = (error: unknown, errorInfo: ErrorInfo) => void;\n\n/** Error information provided to error handlers. */\nexport type ErrorInfo = {\n componentStack: string;\n};\n\n/**\n * Root instance returned by createRoot. Provides methods to render and unmount components.\n */\nexport type Root = {\n /** Render a React element into the root. Must be called within act(). */\n render: (element: ReactElement) => void;\n /** Unmount the root and clean up. Must be called within act(). */\n unmount: () => void;\n /** The root container element. */\n container: HostElement;\n};\n\n/**\n * Create a new test renderer root instance.\n *\n * @param options - Optional configuration for the renderer.\n * @returns A Root instance with render, unmount, and container properties.\n */\nexport function createRoot(options?: RootOptions): Root {\n let container: Container | null = {\n tag: Tag.Container,\n parent: null,\n children: [],\n isHidden: false,\n config: {\n textComponentTypes: options?.textComponentTypes,\n publicTextComponentTypes: options?.publicTextComponentTypes,\n createNodeMock: options?.createNodeMock ?? defaultCreateMockNode,\n },\n };\n\n // @types/react-reconciler types don't fully match react-reconciler's actual Flow types.\n // The return type is correct at runtime but TypeScript can't verify it statically.\n // Correctness is verified through tests.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n let containerFiber = TestReconciler.createContainer(\n container,\n ConcurrentRoot,\n null, // hydrationCallbacks\n options?.isStrictMode ?? false,\n false, // concurrentUpdatesByDefaultOverride\n options?.identifierPrefix ?? \"\",\n options?.onUncaughtError ?? defaultOnUncaughtError,\n options?.onCaughtError ?? defaultOnCaughtError,\n // @ts-expect-error @types/react-reconciler types don't include onRecoverableError parameter\n // in the createContainer signature, but react-reconciler's actual Flow types do.\n // Correctness is verified through tests.\n options?.onRecoverableError ?? defaultOnRecoverableError,\n null, // transitionCallbacks\n );\n\n const render = (element: ReactElement) => {\n if (containerFiber == null) {\n throw new Error(\"Cannot render after unmount\");\n }\n\n TestReconciler.updateContainer(element, containerFiber, null, null);\n };\n\n const unmount = () => {\n if (container == null) {\n return;\n }\n\n TestReconciler.updateContainer(null, containerFiber, null, null);\n\n containerFiber = null;\n container = null;\n };\n\n return {\n render,\n unmount,\n get container(): HostElement {\n if (container == null) {\n throw new Error(\"Cannot access .container on unmounted test renderer\");\n }\n\n return HostElement.fromInstance(container);\n },\n };\n}\n","export const Tag = {\n Container: \"CONTAINER\",\n Instance: \"INSTANCE\",\n Text: \"TEXT\",\n} as const;\n\n// Container should render as <>{...}</>\nexport const CONTAINER_TYPE = \"\";\n","import type { HostElement } from \"./host-element\";\n\n/**\n * Options for querying elements in the rendered tree.\n */\nexport interface QueryOptions {\n /** Include the element itself in the results if it matches the predicate. Defaults to false. */\n includeSelf?: boolean;\n\n /** Exclude any ancestors of deepest matched elements even if they match the predicate. Defaults to false. */\n matchDeepestOnly?: boolean;\n}\n\n/**\n * Find all descendant elements matching the predicate.\n *\n * @param element - Root element to search from.\n * @param predicate - Function that returns true for matching elements.\n * @param options - Optional query configuration.\n * @returns Array of matching elements in tree order.\n */\nexport function queryAll(\n element: HostElement,\n predicate: (element: HostElement) => boolean,\n options?: QueryOptions,\n): HostElement[] {\n const includeSelf = options?.includeSelf ?? false;\n const matchDeepestOnly = options?.matchDeepestOnly ?? false;\n\n const results: HostElement[] = [];\n\n // Match descendants first but do not add them to results yet.\n const matchingDescendants: HostElement[] = [];\n\n element.children.forEach((child) => {\n if (typeof child === \"string\") {\n return;\n }\n\n matchingDescendants.push(...queryAll(child, predicate, { ...options, includeSelf: true }));\n });\n\n if (\n includeSelf &&\n // When matchDeepestOnly = true: add current element only if no descendants match\n (matchingDescendants.length === 0 || !matchDeepestOnly) &&\n predicate(element)\n ) {\n results.push(element);\n }\n\n // Add matching descendants after element to preserve original tree walk order.\n results.push(...matchingDescendants);\n\n return results;\n}\n","import { CONTAINER_TYPE, Tag } from \"./constants\";\nimport type { Container, Instance, TextInstance } from \"./reconciler\";\n\n/** A node in the JSON representation - either a JsonElement or a text string. */\nexport type JsonNode = JsonElement | string;\n\n/**\n * JSON representation of a rendered element, compatible with react-test-renderer format.\n */\nexport type JsonElement = {\n type: string;\n props: object;\n children: Array<JsonNode> | null;\n $$typeof: symbol;\n};\n\nexport function renderContainerToJson(instance: Container): JsonElement {\n return {\n type: CONTAINER_TYPE,\n props: {},\n children: renderChildrenToJson(instance.children),\n $$typeof: Symbol.for(\"react.test.json\"),\n };\n}\n\nexport function renderInstanceToJson(instance: Instance): JsonElement | null {\n if (instance.isHidden) {\n return null;\n }\n\n // We don't include the `children` prop in JSON.\n // Instead, we will include the actual rendered children.\n const { children: _children, ...restProps } = instance.props;\n\n return {\n type: instance.type,\n props: restProps,\n children: renderChildrenToJson(instance.children),\n $$typeof: Symbol.for(\"react.test.json\"),\n };\n}\n\nexport function renderTextInstanceToJson(instance: TextInstance): string | null {\n if (instance.isHidden) {\n return null;\n }\n\n return instance.text;\n}\n\nexport function renderChildrenToJson(children: Array<Instance | TextInstance>): JsonNode[] {\n const result = [];\n\n for (const child of children) {\n if (child.tag === Tag.Instance) {\n const renderedChild = renderInstanceToJson(child);\n if (renderedChild !== null) {\n result.push(renderedChild);\n }\n } else {\n const renderedChild = renderTextInstanceToJson(child);\n if (renderedChild !== null) {\n result.push(renderedChild);\n }\n }\n }\n\n return result;\n}\n","import type { Fiber } from \"react-reconciler\";\n\nimport { CONTAINER_TYPE, Tag } from \"./constants\";\nimport type { QueryOptions } from \"./query-all\";\nimport { queryAll } from \"./query-all\";\nimport type { Container, Instance, TextInstance } from \"./reconciler\";\nimport type { JsonElement } from \"./render-to-json\";\nimport { renderContainerToJson, renderInstanceToJson } from \"./render-to-json\";\n\n/** A node in the rendered tree - either a HostElement or a text string. */\nexport type HostNode = HostElement | string;\n\n/** Props object for a host element. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type HostElementProps = Record<string, any>;\n\nconst instanceMap = new WeakMap<Instance | Container, HostElement>();\n\n/**\n * Represents a rendered host element in the test renderer tree.\n * Provides a DOM-like API for querying and inspecting rendered components.\n */\nexport class HostElement {\n private instance: Instance | Container;\n\n private constructor(instance: Instance | Container) {\n this.instance = instance;\n }\n\n /** The element type (e.g., \"div\", \"span\"). Empty string for container. */\n get type(): string {\n return this.instance.tag === Tag.Instance ? this.instance.type : CONTAINER_TYPE;\n }\n\n /** The element's props object. */\n get props(): HostElementProps {\n return this.instance.tag === Tag.Instance ? this.instance.props : {};\n }\n\n /** The parent element, or null if this is the root container. */\n get parent(): HostElement | null {\n const parentInstance = this.instance.parent;\n if (parentInstance == null) {\n return null;\n }\n\n return HostElement.fromInstance(parentInstance);\n }\n\n /** Array of child nodes (elements and text strings). Hidden children are excluded. */\n get children(): HostNode[] {\n const result = this.instance.children\n .filter((child) => !child.isHidden)\n .map((child) => getHostNodeForInstance(child));\n return result;\n }\n\n /**\n * Access to the underlying React Fiber node. This is an unstable API that exposes\n * internal react-reconciler structures which may change without warning in future\n * React versions. Use with caution and only when absolutely necessary.\n *\n * @returns The Fiber node for this instance, or null if this is a container.\n */\n get unstable_fiber(): Fiber | null {\n return this.instance.tag === Tag.Instance ? this.instance.unstable_fiber : null;\n }\n\n /**\n * Convert this element to a JSON representation suitable for snapshots.\n *\n * @returns JSON element or null if the element is hidden.\n */\n toJSON(): JsonElement | null {\n return this.instance.tag === Tag.Container\n ? renderContainerToJson(this.instance)\n : renderInstanceToJson(this.instance);\n }\n\n /**\n * Find all descendant elements matching the predicate.\n *\n * @param predicate - Function that returns true for matching elements.\n * @param options - Optional query configuration.\n * @returns Array of matching elements.\n */\n queryAll(\n predicate: (element: HostElement, options?: QueryOptions) => boolean,\n options?: QueryOptions,\n ): HostElement[] {\n return queryAll(this, predicate, options);\n }\n\n /** @internal */\n static fromInstance(instance: Instance | Container): HostElement {\n const hostElement = instanceMap.get(instance);\n if (hostElement) {\n return hostElement;\n }\n\n const result = new HostElement(instance);\n instanceMap.set(instance, result);\n return result;\n }\n}\n\nfunction getHostNodeForInstance(instance: Instance | TextInstance): HostNode {\n switch (instance.tag) {\n case Tag.Text:\n return instance.text;\n\n case Tag.Instance:\n return HostElement.fromInstance(instance);\n }\n}\n","import type { ReactElement } from \"react\";\nimport type { Fiber } from \"react-reconciler\";\nimport ReactReconciler from \"react-reconciler\";\nimport { DefaultEventPriority, NoEventPriority } from \"react-reconciler/constants\";\n\nimport { Tag } from \"./constants\";\nimport { formatComponentList } from \"./utils\";\n\nexport type Type = string;\nexport type Props = Record<string, unknown>;\n\ntype ReconcilerConfig = {\n textComponentTypes?: string[];\n publicTextComponentTypes?: string[];\n createNodeMock: (element: ReactElement) => object;\n};\n\nexport type Container = {\n tag: typeof Tag.Container;\n parent: null;\n children: Array<Instance | TextInstance>;\n isHidden: false;\n config: ReconcilerConfig;\n};\n\nexport type Instance = {\n tag: typeof Tag.Instance;\n type: string;\n props: Props;\n children: Array<Instance | TextInstance>;\n parent: Container | Instance | null;\n rootContainer: Container;\n isHidden: boolean;\n unstable_fiber: Fiber;\n};\n\nexport type TextInstance = {\n tag: typeof Tag.Text;\n text: string;\n parent: Container | Instance | null;\n isHidden: boolean;\n};\n\nexport type SuspenseInstance = object;\nexport type HydratableInstance = object;\nexport type PublicInstance = object | TextInstance;\nexport type UpdatePayload = unknown;\nexport type ChildSet = unknown;\nexport type TimeoutHandle = unknown;\nexport type NoTimeout = unknown;\n\ntype HostContext = {\n type: string;\n isInsideText: boolean;\n config: ReconcilerConfig;\n};\n\nconst nodeToInstanceMap = new WeakMap<object, Instance>();\n\nlet currentUpdatePriority: number = NoEventPriority;\n\nconst hostConfig: ReactReconciler.HostConfig<\n Type,\n Props,\n Container,\n Instance,\n TextInstance,\n SuspenseInstance,\n HydratableInstance,\n PublicInstance,\n HostContext,\n UpdatePayload,\n ChildSet,\n TimeoutHandle,\n NoTimeout\n> = {\n /**\n * The reconciler has two modes: mutation mode and persistent mode. You must specify one of them.\n *\n * If your target platform is similar to the DOM and has methods similar to `appendChild`, `removeChild`,\n * and so on, you'll want to use the **mutation mode**. This is the same mode used by React DOM, React ART,\n * and the classic React Native renderer.\n *\n * ```js\n * const HostConfig = {\n * // ...\n * supportsMutation: true,\n * // ...\n * }\n * ```\n *\n * Depending on the mode, the reconciler will call different methods on your host config.\n * If you're not sure which one you want, you likely need the mutation mode.\n */\n supportsMutation: true,\n\n /**\n * The reconciler has two modes: mutation mode and persistent mode. You must specify one of them.\n *\n * If your target platform has immutable trees, you'll want the **persistent mode** instead. In that mode,\n * existing nodes are never mutated, and instead every change clones the parent tree and then replaces\n * the whole parent tree at the root. This is the node used by the new React Native renderer, codenamed \"Fabric\".\n *\n * ```js\n * const HostConfig = {\n * // ...\n * supportsPersistence: true,\n * // ...\n * }\n * ```\n *\n * Depending on the mode, the reconciler will call different methods on your host config.\n * If you're not sure which one you want, you likely need the mutation mode.\n */\n supportsPersistence: false,\n\n /**\n * #### `createInstance(type, props, rootContainer, hostContext, internalHandle)`\n *\n * This method should return a newly created node. For example, the DOM renderer would call\n * `document.createElement(type)` here and then set the properties from `props`.\n *\n * You can use `rootContainer` to access the root container associated with that tree. For example,\n * in the DOM renderer, this is useful to get the correct `document` reference that the root belongs to.\n *\n * The `hostContext` parameter lets you keep track of some information about your current place in\n * the tree. To learn more about it, see `getChildHostContext` below.\n *\n * The `internalHandle` data structure is meant to be opaque. If you bend the rules and rely on its\n * internal fields, be aware that it may change significantly between versions. You're taking on additional\n * maintenance risk by reading from it, and giving up all guarantees if you write something to it.\n *\n * This method happens **in the render phase**. It can (and usually should) mutate the node it has\n * just created before returning it, but it must not modify any other nodes. It must not register\n * any event handlers on the parent tree. This is because an instance being created doesn't guarantee\n * it would be placed in the tree — it could be left unused and later collected by GC. If you need to do\n * something when an instance is definitely in the tree, look at `commitMount` instead.\n */\n createInstance(\n type: Type,\n props: Props,\n rootContainer: Container,\n _hostContext: HostContext,\n internalHandle: Fiber,\n ) {\n return {\n tag: Tag.Instance,\n type,\n props,\n isHidden: false,\n children: [],\n parent: null,\n rootContainer,\n unstable_fiber: internalHandle,\n };\n },\n\n /**\n * #### `createTextInstance(text, rootContainer, hostContext, internalHandle)`\n *\n * Same as `createInstance`, but for text nodes. If your renderer doesn't support text nodes, you can\n * throw here.\n */\n createTextInstance(\n text: string,\n rootContainer: Container,\n hostContext: HostContext,\n _internalHandle: Fiber,\n ): TextInstance {\n if (rootContainer.config.textComponentTypes && !hostContext.isInsideText) {\n const componentTypes =\n rootContainer.config.publicTextComponentTypes ?? rootContainer.config.textComponentTypes;\n\n throw new Error(\n `Invariant Violation: Text strings must be rendered within a ${formatComponentList(\n componentTypes,\n )} component. Detected attempt to render \"${text}\" string within a <${\n hostContext.type\n }> component.`,\n );\n }\n\n return {\n tag: Tag.Text,\n text,\n parent: null,\n isHidden: false,\n };\n },\n\n /**\n * #### `appendInitialChild(parentInstance, child)`\n *\n * This method should mutate the `parentInstance` and add the child to its list of children.\n * For example, in the DOM this would translate to a `parentInstance.appendChild(child)` call.\n *\n * This method happens **in the render phase**. It can mutate `parentInstance` and `child`, but it\n * must not modify any other nodes. It's called while the tree is still being built up and not connected\n * to the actual tree on the screen.\n */\n appendInitialChild: appendChild,\n\n /**\n * #### `finalizeInitialChildren(instance, type, props, rootContainer, hostContext)`\n *\n * In this method, you can perform some final mutations on the `instance`. Unlike with `createInstance`,\n * by the time `finalizeInitialChildren` is called, all the initial children have already been added to\n * the `instance`, but the instance itself has not yet been connected to the tree on the screen.\n *\n * This method happens **in the render phase**. It can mutate `instance`, but it must not modify any other\n * nodes. It's called while the tree is still being built up and not connected to the actual tree on the screen.\n *\n * There is a second purpose to this method. It lets you specify whether there is some work that needs to\n * happen when the node is connected to the tree on the screen. If you return `true`, the instance will\n * receive a `commitMount` call later. See its documentation below.\n *\n * If you don't want to do anything here, you should return `false`.\n */\n finalizeInitialChildren(\n _instance: Instance,\n _type: Type,\n _props: Props,\n _rootContainer: Container,\n _hostContext: HostContext,\n ): boolean {\n return false;\n },\n\n /**\n * #### `shouldSetTextContent(type, props)`\n *\n * Some target platforms support setting an instance's text content without manually creating a text node.\n * For example, in the DOM, you can set `node.textContent` instead of creating a text node and appending it.\n *\n * If you return `true` from this method, React will assume that this node's children are text, and will\n * not create nodes for them. It will instead rely on you to have filled that text during `createInstance`.\n * This is a performance optimization. For example, the DOM renderer returns `true` only if `type` is a\n * known text-only parent (like `'textarea'`) or if `props.children` has a `'string'` type. If you return `true`,\n * you will need to implement `resetTextContent` too.\n *\n * If you don't want to do anything here, you should return `false`.\n * This method happens **in the render phase**. Do not mutate the tree from it.\n */\n shouldSetTextContent(_type: Type, _props: Props): boolean {\n return false;\n },\n\n setCurrentUpdatePriority(newPriority: number) {\n currentUpdatePriority = newPriority;\n },\n\n getCurrentUpdatePriority() {\n return currentUpdatePriority;\n },\n\n resolveUpdatePriority(): number {\n return currentUpdatePriority || DefaultEventPriority;\n },\n\n shouldAttemptEagerTransition() {\n return false;\n },\n\n /**\n * #### `getRootHostContext(rootContainer)`\n *\n * This method lets you return the initial host context from the root of the tree. See `getChildHostContext`\n * for the explanation of host context.\n *\n * If you don't intend to use host context, you can return `null`.\n * This method happens **in the render phase**. Do not mutate the tree from it.\n */\n getRootHostContext(rootContainer: Container): HostContext | null {\n return {\n type: \"ROOT\",\n config: rootContainer.config,\n isInsideText: false,\n };\n },\n\n /**\n * #### `getChildHostContext(parentHostContext, type, rootContainer)`\n *\n * Host context lets you track some information about where you are in the tree so that it's available\n * inside `createInstance` as the `hostContext` parameter. For example, the DOM renderer uses it to track\n * whether it's inside an HTML or an SVG tree, because `createInstance` implementation needs to be\n * different for them.\n *\n * If the node of this `type` does not influence the context you want to pass down, you can return\n * `parentHostContext`. Alternatively, you can return any custom object representing the information\n * you want to pass down.\n *\n * If you don't want to do anything here, return `parentHostContext`.\n *\n * This method happens **in the render phase**. Do not mutate the tree from it.\n */\n getChildHostContext(parentHostContext: HostContext, type: Type): HostContext {\n const isInsideText = Boolean(parentHostContext.config.textComponentTypes?.includes(type));\n return { ...parentHostContext, type: type, isInsideText };\n },\n\n /**\n * #### `getPublicInstance(instance)`\n *\n * Determines what object gets exposed as a ref. You'll likely want to return the `instance` itself. But\n * in some cases it might make sense to only expose some part of it.\n *\n * If you don't want to do anything here, return `instance`.\n */\n getPublicInstance(instance: Instance | TextInstance): PublicInstance {\n switch (instance.tag) {\n case Tag.Instance: {\n const createNodeMock = instance.rootContainer.config.createNodeMock;\n const mockNode = createNodeMock({\n type: instance.type,\n props: instance.props,\n key: null,\n });\n\n nodeToInstanceMap.set(mockNode, instance);\n\n return mockNode;\n }\n\n default:\n return instance;\n }\n },\n\n /**\n * #### `prepareForCommit(containerInfo)`\n *\n * This method lets you store some information before React starts making changes to the tree on\n * the screen. For example, the DOM renderer stores the current text selection so that it can later\n * restore it. This method is mirrored by `resetAfterCommit`.\n *\n * Even if you don't want to do anything here, you need to return `null` from it.\n */\n prepareForCommit(_containerInfo: Container) {\n return null; // noop\n },\n\n /**\n * #### `resetAfterCommit(containerInfo)`\n *\n * This method is called right after React has performed the tree mutations. You can use it to restore\n * something you've stored in `prepareForCommit` — for example, text selection.\n *\n * You can leave it empty.\n */\n resetAfterCommit(_containerInfo: Container): void {\n // noop\n },\n\n /**\n * #### `preparePortalMount(containerInfo)`\n *\n * This method is called for a container that's used as a portal target. Usually you can leave it empty.\n */\n preparePortalMount(_containerInfo: Container): void {\n // noop\n },\n\n /**\n * #### `scheduleTimeout(fn, delay)`\n *\n * You can proxy this to `setTimeout` or its equivalent in your environment.\n */\n scheduleTimeout: setTimeout,\n\n /**\n * #### `cancelTimeout(id)`\n *\n * You can proxy this to `clearTimeout` or its equivalent in your environment.\n */\n cancelTimeout: clearTimeout,\n\n /**\n * #### `noTimeout`\n *\n * This is a property (not a function) that should be set to something that can never be a valid timeout ID.\n * For example, you can set it to `-1`.\n */\n noTimeout: -1,\n\n /**\n * #### `supportsMicrotasks`\n *\n * Set this to `true` to indicate that your renderer supports `scheduleMicrotask`. We use microtasks as part\n * of our discrete event implementation in React DOM. If you're not sure if your renderer should support this,\n * you probably should. The option to not implement `scheduleMicrotask` exists so that platforms with more control\n * over user events, like React Native, can choose to use a different mechanism.\n */\n supportsMicrotasks: true,\n\n /**\n * #### `scheduleMicrotask(fn)`\n *\n * Optional. You can proxy this to `queueMicrotask` or its equivalent in your environment.\n */\n scheduleMicrotask: queueMicrotask,\n\n /**\n * #### `isPrimaryRenderer`\n *\n * This is a property (not a function) that should be set to `true` if your renderer is the main one on the\n * page. For example, if you're writing a renderer for the Terminal, it makes sense to set it to `true`, but\n * if your renderer is used *on top of* React DOM or some other existing renderer, set it to `false`.\n */\n isPrimaryRenderer: true,\n\n /**\n * Whether the renderer shouldn't trigger missing `act()` warnings\n */\n warnsIfNotActing: true,\n\n getInstanceFromNode(node: object): Fiber | null | undefined {\n const instance = nodeToInstanceMap.get(node);\n if (instance !== undefined) {\n return instance.unstable_fiber;\n }\n\n return null;\n },\n\n beforeActiveInstanceBlur(): void {\n // noop\n },\n\n afterActiveInstanceBlur(): void {\n // noop\n },\n\n prepareScopeUpdate(scopeInstance: object, instance: Instance): void {\n nodeToInstanceMap.set(scopeInstance, instance);\n },\n\n getInstanceFromScope(scopeInstance: object): Instance | null {\n return nodeToInstanceMap.get(scopeInstance) ?? null;\n },\n\n detachDeletedInstance(_node: Instance): void {},\n\n /**\n * #### `appendChild(parentInstance, child)`\n *\n * This method should mutate the `parentInstance` and add the child to its list of children. For example,\n * in the DOM this would translate to a `parentInstance.appendChild(child)` call.\n *\n * Although this method currently runs in the commit phase, you still should not mutate any other nodes\n * in it. If you need to do some additional work when a node is definitely connected to the visible tree, look at `commitMount`.\n */\n appendChild: appendChild,\n\n /**\n * #### `appendChildToContainer(container, child)`\n *\n * Same as `appendChild`, but for when a node is attached to the root container. This is useful if attaching\n * to the root has a slightly different implementation, or if the root container nodes are of a different\n * type than the rest of the tree.\n */\n appendChildToContainer: appendChild,\n\n /**\n * #### `insertBefore(parentInstance, child, beforeChild)`\n *\n * This method should mutate the `parentInstance` and place the `child` before `beforeChild` in the list of\n * its children. For example, in the DOM this would translate to a `parentInstance.insertBefore(child, beforeChild)` call.\n *\n * Note that React uses this method both for insertions and for reordering nodes. Similar to DOM, it is expected\n * that you can call `insertBefore` to reposition an existing child. Do not mutate any other parts of the tree from it.\n */\n insertBefore: insertBefore,\n\n /**\n * #### `insertInContainerBefore(container, child, beforeChild)\n *\n * Same as `insertBefore`, but for when a node is attached to the root container. This is useful if attaching\n * to the root has a slightly different implementation, or if the root container nodes are of a different type\n * than the rest of the tree.\n */\n insertInContainerBefore: insertBefore,\n\n /**\n * #### `removeChild(parentInstance, child)`\n *\n * This method should mutate the `parentInstance` to remove the `child` from the list of its children.\n *\n * React will only call it for the top-level node that is being removed. It is expected that garbage collection\n * would take care of the whole subtree. You are not expected to traverse the child tree in it.\n */\n removeChild: removeChild,\n\n /**\n * #### `removeChildFromContainer(container, child)`\n *\n * Same as `removeChild`, but for when a node is detached from the root container. This is useful if attaching\n * to the root has a slightly different implementation, or if the root container nodes are of a different type\n * than the rest of the tree.\n */\n removeChildFromContainer: removeChild,\n\n /**\n * #### `resetTextContent(instance)`\n *\n * If you returned `true` from `shouldSetTextContent` for the previous props, but returned `false` from\n * `shouldSetTextContent` for the next props, React will call this method so that you can clear the text\n * content you were managing manually. For example, in the DOM you could set `node.textContent = ''`.\n *\n * If you never return `true` from `shouldSetTextContent`, you can leave it empty.\n */\n resetTextContent(_instance: Instance): void {\n // noop\n },\n\n /**\n * #### `commitTextUpdate(textInstance, prevText, nextText)`\n *\n * This method should mutate the `textInstance` and update its text content to `nextText`.\n *\n * Here, `textInstance` is a node created by `createTextInstance`.\n */\n commitTextUpdate(textInstance: TextInstance, _oldText: string, newText: string): void {\n textInstance.text = newText;\n },\n\n /**\n * #### `commitMount(instance, type, props, internalHandle)`\n *\n * This method is only called if you returned `true` from `finalizeInitialChildren` for this instance.\n *\n * It lets you do some additional work after the node is actually attached to the tree on the screen for\n * the first time. For example, the DOM renderer uses it to trigger focus on nodes with the `autoFocus` attribute.\n *\n * Note that `commitMount` does not mirror `removeChild` one to one because `removeChild` is only called for\n * the top-level removed node. This is why ideally `commitMount` should not mutate any nodes other than the\n * `instance` itself. For example, if it registers some events on some node above, it will be your responsibility\n * to traverse the tree in `removeChild` and clean them up, which is not ideal.\n *\n * The `internalHandle` data structure is meant to be opaque. If you bend the rules and rely on its internal\n * fields, be aware that it may change significantly between versions. You're taking on additional maintenance\n * risk by reading from it, and giving up all guarantees if you write something to it.\n *\n * If you never return `true` from `finalizeInitialChildren`, you can leave it empty.\n */\n commitMount(_instance: Instance, _type: Type, _props: Props, _internalHandle: Fiber): void {\n // noop\n },\n\n /**\n * #### `commitUpdate(instance, type, prevProps, nextProps, internalHandle)`\n *\n * This method should mutate the `instance` according to the set of changes in `updatePayload`. Here, `updatePayload`\n * is the object that you've returned from `prepareUpdate` and has an arbitrary structure that makes sense for your\n * renderer. For example, the DOM renderer returns an update payload like `[prop1, value1, prop2, value2, ...]` from\n * `prepareUpdate`, and that structure gets passed into `commitUpdate`. Ideally, all the diffing and calculation\n * should happen inside `prepareUpdate` so that `commitUpdate` can be fast and straightforward.\n *\n * The `internalHandle` data structure is meant to be opaque. If you bend the rules and rely on its internal fields,\n * be aware that it may change significantly between versions. You're taking on additional maintenance risk by\n * reading from it, and giving up all guarantees if you write something to it.\n */\n // @ts-expect-error @types/react-reconciler types don't fully match react-reconciler's actual Flow types.\n // Correctness is verified through tests.\n commitUpdate(\n instance: Instance,\n type: Type,\n _prevProps: Props,\n nextProps: Props,\n internalHandle: Fiber,\n ): void {\n instance.type = type;\n instance.props = nextProps;\n instance.unstable_fiber = internalHandle;\n },\n\n /**\n * #### `hideInstance(instance)`\n *\n * This method should make the `instance` invisible without removing it from the tree. For example, it can apply\n * visual styling to hide it. It is used by Suspense to hide the tree while the fallback is visible.\n */\n hideInstance(instance: Instance): void {\n instance.isHidden = true;\n },\n\n /**\n * #### `hideTextInstance(textInstance)`\n *\n * Same as `hideInstance`, but for nodes created by `createTextInstance`.\n */\n hideTextInstance(textInstance: TextInstance): void {\n textInstance.isHidden = true;\n },\n\n /**\n * #### `unhideInstance(instance, props)`\n *\n * This method should make the `instance` visible, undoing what `hideInstance` did.\n */\n unhideInstance(instance: Instance, _props: Props): void {\n instance.isHidden = false;\n },\n\n /**\n * #### `unhideTextInstance(textInstance, text)`\n *\n * Same as `unhideInstance`, but for nodes created by `createTextInstance`.\n */\n unhideTextInstance(textInstance: TextInstance, _text: string): void {\n textInstance.isHidden = false;\n },\n\n /**\n * #### `clearContainer(container)`\n *\n * This method should mutate the `container` root node and remove all children from it.\n */\n clearContainer(container: Container): void {\n container.children.forEach((child) => {\n child.parent = null;\n });\n\n container.children.splice(0);\n },\n\n /**\n * #### `maySuspendCommit(type, props)`\n *\n * This method is called during render to determine if the Host Component type and props require\n * some kind of loading process to complete before committing an update.\n */\n maySuspendCommit(_type: Type, _props: Props): boolean {\n return false;\n },\n\n /**\n * #### `preloadInstance(type, props)`\n *\n * This method may be called during render if the Host Component type and props might suspend a commit.\n * It can be used to initiate any work that might shorten the duration of a suspended commit.\n */\n preloadInstance(_type: Type, _props: Props): boolean {\n return true;\n },\n\n /**\n * #### `startSuspendingCommit()`\n *\n * This method is called just before the commit phase. Use it to set up any necessary state while any Host\n * Components that might suspend this commit are evaluated to determine if the commit must be suspended.\n */\n startSuspendingCommit() {},\n\n /**\n * #### `suspendInstance(type, props)`\n *\n * This method is called after `startSuspendingCommit` for each Host Component that indicated it might\n * suspend a commit.\n */\n suspendInstance() {},\n\n /**\n * #### `waitForCommitToBeReady()`\n *\n * This method is called after all `suspendInstance` calls are complete.\n *\n * Return `null` if the commit can happen immediately.\n * Return `(initiateCommit: Function) => Function` if the commit must be suspended. The argument to this\n * callback will initiate the commit when called. The return value is a cancellation function that the\n * Reconciler can use to abort the commit.\n */\n waitForCommitToBeReady() {\n return null;\n },\n\n // -------------------\n // Hydration Methods\n // (optional)\n // You can optionally implement hydration to \"attach\" to the existing tree during the initial render instead\n // of creating it from scratch. For example, the DOM renderer uses this to attach to an HTML markup.\n //\n // To support hydration, you need to declare `supportsHydration: true` and then implement the methods in\n // the \"Hydration\" section [listed in this file](https://github.com/facebook/react/blob/master/packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js).\n // File an issue if you need help.\n // -------------------\n supportsHydration: false,\n\n NotPendingTransition: null,\n\n resetFormInstance(_form: Instance) {},\n\n requestPostPaintCallback(_callback: (endTime: number) => void) {},\n};\n\nexport const TestReconciler = ReactReconciler(hostConfig);\n\n/**\n * This method should mutate the `parentInstance` and add the child to its list of children. For example,\n * in the DOM this would translate to a `parentInstance.appendChild(child)` call.\n *\n * Although this method currently runs in the commit phase, you still should not mutate any other nodes\n * in it. If you need to do some additional work when a node is definitely connected to the visible tree,\n * look at `commitMount`.\n */\nfunction appendChild(parentInstance: Container | Instance, child: Instance | TextInstance): void {\n const index = parentInstance.children.indexOf(child);\n if (index !== -1) {\n parentInstance.children.splice(index, 1);\n }\n\n child.parent = parentInstance;\n parentInstance.children.push(child);\n}\n\n/**\n * This method should mutate the `parentInstance` and place the `child` before `beforeChild` in the list\n * of its children. For example, in the DOM this would translate to a\n * `parentInstance.insertBefore(child, beforeChild)` call.\n *\n * Note that React uses this method both for insertions and for reordering nodes. Similar to DOM, it is\n * expected that you can call `insertBefore` to reposition an existing child. Do not mutate any other parts\n * of the tree from it.\n */\nfunction insertBefore(\n parentInstance: Container | Instance,\n child: Instance | TextInstance,\n beforeChild: Instance | TextInstance,\n): void {\n const index = parentInstance.children.indexOf(child);\n if (index !== -1) {\n parentInstance.children.splice(index, 1);\n }\n\n child.parent = parentInstance;\n const beforeIndex = parentInstance.children.indexOf(beforeChild);\n parentInstance.children.splice(beforeIndex, 0, child);\n}\n\n/**\n * This method should mutate the `parentInstance` to remove the `child` from the list of its children.\n *\n * React will only call it for the top-level node that is being removed. It is expected that garbage\n * collection would take care of the whole subtree. You are not expected to traverse the child tree in it.\n */\nfunction removeChild(parentInstance: Container | Instance, child: Instance | TextInstance): void {\n const index = parentInstance.children.indexOf(child);\n parentInstance.children.splice(index, 1);\n child.parent = null;\n}\n","export function formatComponentList(names: string[]): string {\n if (names.length === 0) {\n return \"\";\n }\n\n if (names.length === 1) {\n return `<${names[0]}>`;\n }\n\n if (names.length === 2) {\n return `<${names[0]}> or <${names[1]}>`;\n }\n\n const allButLast = names.slice(0, -1);\n const last = names[names.length - 1];\n\n return `${allButLast.map((name) => `<${name}>`).join(\", \")}, or <${last}>`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,sBAAsB;;;ACDxB,IAAM,MAAM;AAAA,EACjB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,MAAM;AACR;AAGO,IAAM,iBAAiB;;;ACcvB,SAAS,SACd,SACA,WACA,SACe;AAzBjB;AA0BE,QAAM,eAAc,wCAAS,gBAAT,YAAwB;AAC5C,QAAM,oBAAmB,wCAAS,qBAAT,YAA6B;AAEtD,QAAM,UAAyB,CAAC;AAGhC,QAAM,sBAAqC,CAAC;AAE5C,UAAQ,SAAS,QAAQ,CAAC,UAAU;AAClC,QAAI,OAAO,UAAU,UAAU;AAC7B;AAAA,IACF;AAEA,wBAAoB,KAAK,GAAG,SAAS,OAAO,WAAW,iCAAK,UAAL,EAAc,aAAa,KAAK,EAAC,CAAC;AAAA,EAC3F,CAAC;AAED,MACE;AAAA,GAEC,oBAAoB,WAAW,KAAK,CAAC,qBACtC,UAAU,OAAO,GACjB;AACA,YAAQ,KAAK,OAAO;AAAA,EACtB;AAGA,UAAQ,KAAK,GAAG,mBAAmB;AAEnC,SAAO;AACT;;;ACvCO,SAAS,sBAAsB,UAAkC;AACtE,SAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO,CAAC;AAAA,IACR,UAAU,qBAAqB,SAAS,QAAQ;AAAA,IAChD,UAAU,uBAAO,IAAI,iBAAiB;AAAA,EACxC;AACF;AAEO,SAAS,qBAAqB,UAAwC;AAC3E,MAAI,SAAS,UAAU;AACrB,WAAO;AAAA,EACT;AAIA,QAA8C,cAAS,OAA/C,YAAU,UAhCpB,IAgCgD,IAA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EA,QAAM,SAAS,CAAC,YAA0B;AACxC,QAAI,kBAAkB,MAAM;AAC1B,YAAM,IAAI,MAAM,6BAA6B;AAAA,IAC/C;AAEA,mBAAe,gBAAgB,SAAS,gBAAgB,MAAM,IAAI;AAAA,EACpE;AAEA,QAAM,UAAU,MAAM;AACpB,QAAI,aAAa,MAAM;AACrB;AAAA,IACF;AAEA,mBAAe,gBAAgB,MAAM,gBAAgB,MAAM,IAAI;AAE/D,qBAAiB;AACjB,gBAAY;AAAA,EACd;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,IAAI,YAAyB;AAC3B,UAAI,aAAa,MAAM;AACrB,cAAM,IAAI,MAAM,qDAAqD;AAAA,MACvE;AAEA,aAAO,YAAY,aAAa,SAAS;AAAA,IAC3C;AAAA,EACF;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-renderer",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "A lightweight, JavaScript-only replacement for the deprecated React Test Renderer.",
5
5
  "keywords": [
6
6
  "react",
@@ -14,9 +14,9 @@
14
14
  "license": "MIT",
15
15
  "repository": {
16
16
  "type": "git",
17
- "url": "https://github.com/mdjastrzebski/universal-test-renderer.git"
17
+ "url": "https://github.com/mdjastrzebski/test-renderer.git"
18
18
  },
19
- "homepage": "https://github.com/mdjastrzebski/universal-test-renderer",
19
+ "homepage": "https://github.com/mdjastrzebski/test-renderer",
20
20
  "type": "module",
21
21
  "main": "./dist/index.cjs",
22
22
  "module": "./dist/index.js",