typed-identity-function-frozen-input.js — react Source File
Architecture documentation for typed-identity-function-frozen-input.js, a javascript file in the react codebase. 2 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 766bab18_ffb8_a015_2f04_9c74e1f54a55["typed-identity-function-frozen-input.js"] ac587885_e294_a1e9_b13f_5e7b920fdb42["react"] 766bab18_ffb8_a015_2f04_9c74e1f54a55 --> ac587885_e294_a1e9_b13f_5e7b920fdb42 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"] 766bab18_ffb8_a015_2f04_9c74e1f54a55 --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05 style 766bab18_ffb8_a015_2f04_9c74e1f54a55 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
// @enableNewMutationAliasingModel
import {useMemo} from 'react';
import {
identity,
makeObject_Primitives,
typedIdentity,
useIdentity,
ValidateMemoization,
} from 'shared-runtime';
function Component({a, b}) {
// create a mutable value with input `a`
const x = useMemo(() => makeObject_Primitives(a), [a]);
// freeze the value
useIdentity(x);
// known to pass-through via aliasing signature
const x2 = typedIdentity(x);
// Unknown function so we assume it conditionally mutates,
// but x2 is frozen so this downgrades to a read.
// x should *not* take b as a dependency
identity(x2, b);
return <ValidateMemoization inputs={[a]} output={x} />;
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{a: 0, b: 0}],
sequentialRenders: [
{a: 0, b: 0},
{a: 1, b: 0},
{a: 1, b: 1},
{a: 0, b: 1},
{a: 0, b: 0},
],
};
Domain
Subdomains
Functions
Dependencies
- react
- shared-runtime
Source
Frequently Asked Questions
What does typed-identity-function-frozen-input.js do?
typed-identity-function-frozen-input.js is a source file in the react codebase, written in javascript. It belongs to the TestingUtilities domain, Fixtures subdomain.
What functions are defined in typed-identity-function-frozen-input.js?
typed-identity-function-frozen-input.js defines 1 function(s): Component.
What does typed-identity-function-frozen-input.js depend on?
typed-identity-function-frozen-input.js imports 2 module(s): react, shared-runtime.
Where is typed-identity-function-frozen-input.js in the architecture?
typed-identity-function-frozen-input.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-mutability/typed-identity-function-frozen-input.js (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-mutability).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free