Home / File/ hoisting-functionexpr-conditional-dep.tsx — react Source File

hoisting-functionexpr-conditional-dep.tsx — react Source File

Architecture documentation for hoisting-functionexpr-conditional-dep.tsx, a tsx file in the react codebase. 1 imports, 0 dependents.

File tsx TestingUtilities Fixtures 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  4eb5b348_6a5b_ad02_4fdf_7101fb7ea10c["hoisting-functionexpr-conditional-dep.tsx"]
  006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"]
  4eb5b348_6a5b_ad02_4fdf_7101fb7ea10c --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05
  style 4eb5b348_6a5b_ad02_4fdf_7101fb7ea10c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import {Stringify} from 'shared-runtime';

/**
 * We currently hoist the accessed properties of function expressions,
 * regardless of control flow. This is simply because we wrote support for
 * function expressions before doing a lot of work in PropagateScopeDeps
 * to handle conditionally accessed dependencies.
 *
 * Current evaluator error:
 *  Found differences in evaluator results
 *  Non-forget (expected):
 *  (kind: ok) <div>{"shouldInvokeFns":true,"callback":{"kind":"Function","result":null}}</div>
 *  Forget:
 *  (kind: exception) Cannot read properties of null (reading 'prop')
 */
function Component({obj, isObjNull}) {
  const callback = () => {
    if (!isObjNull) {
      return obj.prop;
    } else {
      return null;
    }
  };
  return <Stringify shouldInvokeFns={true} callback={callback} />;
}

export const FIXTURE_ENTRYPOINT = {
  fn: Component,
  params: [{obj: null, isObjNull: true}],
};

Subdomains

Functions

Dependencies

  • shared-runtime

Frequently Asked Questions

What does hoisting-functionexpr-conditional-dep.tsx do?
hoisting-functionexpr-conditional-dep.tsx is a source file in the react codebase, written in tsx. It belongs to the TestingUtilities domain, Fixtures subdomain.
What functions are defined in hoisting-functionexpr-conditional-dep.tsx?
hoisting-functionexpr-conditional-dep.tsx defines 1 function(s): Component.
What does hoisting-functionexpr-conditional-dep.tsx depend on?
hoisting-functionexpr-conditional-dep.tsx imports 1 module(s): shared-runtime.
Where is hoisting-functionexpr-conditional-dep.tsx in the architecture?
hoisting-functionexpr-conditional-dep.tsx is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-functionexpr-conditional-dep.tsx (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free