Home / File/ merge-consecutive-scopes-objects.js — react Source File

merge-consecutive-scopes-objects.js — react Source File

Architecture documentation for merge-consecutive-scopes-objects.js, a javascript file in the react codebase. 2 imports, 0 dependents.

File javascript TestingUtilities Fixtures 2 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  bbeac6d0_f73a_a9ce_0b7a_937fb972c94b["merge-consecutive-scopes-objects.js"]
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  bbeac6d0_f73a_a9ce_0b7a_937fb972c94b --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"]
  bbeac6d0_f73a_a9ce_0b7a_937fb972c94b --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05
  style bbeac6d0_f73a_a9ce_0b7a_937fb972c94b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import {useState} from 'react';
import {Stringify} from 'shared-runtime';

// This is a translation of the original merge-consecutive-scopes which uses plain objects
// to describe the UI instead of JSX. The JSXText elements in that fixture happen to
// prevent scome scopes from merging, which concealed a bug with the merging logic.
// By avoiding JSX we eliminate extraneous instructions and more accurately test the merging.
function Component(props) {
  let [state, setState] = useState(0);
  return [
    {component: Stringify, props: {text: 'Counter'}},
    {component: 'span', props: {children: [state]}},
    {
      component: 'button',
      props: {
        'data-testid': 'button',
        onClick: () => setState(state + 1),
        children: ['increment'],
      },
    },
  ];
}

export const FIXTURE_ENTRYPOINT = {
  fn: Component,
  params: [{}],
};

Subdomains

Functions

Dependencies

  • react
  • shared-runtime

Frequently Asked Questions

What does merge-consecutive-scopes-objects.js do?
merge-consecutive-scopes-objects.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 merge-consecutive-scopes-objects.js?
merge-consecutive-scopes-objects.js defines 1 function(s): Component.
What does merge-consecutive-scopes-objects.js depend on?
merge-consecutive-scopes-objects.js imports 2 module(s): react, shared-runtime.
Where is merge-consecutive-scopes-objects.js in the architecture?
merge-consecutive-scopes-objects.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/merge-consecutive-scopes-objects.js (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