Skip to content

chore(envs): migrate react components from teambit.react/react to react-env - #10642

Open
davidfirst wants to merge 1 commit into
masterfrom
migrate-react-comps-to-react-env
Open

chore(envs): migrate react components from teambit.react/react to react-env#10642
davidfirst wants to merge 1 commit into
masterfrom
migrate-react-comps-to-react-env

Conversation

@davidfirst

Copy link
Copy Markdown
Member

Why

The core teambit.react/react env bundles component previews with webpack. The teambit.react/react-env@2.0.3 env bundles them with Rspack. Rspack uses less memory and less time in CI builds.

Changes

  • Move all 72 workspace components from teambit.react/react to teambit.react/react-env@2.0.3 with bit env replace. The change adds an explicit env entry to each component in .bitmap.
  • The pnpm-lock.yaml diff is the dependency churn from the env switch.

Verification

  • All 330 components compile.
  • All tests on the migrated components pass (43/43 across the 6 components that have tests). One component (use-bulk-paged-query) has a pre-existing tester error. Its spec imports a .js path that jest cannot resolve. This error is not related to this change.
  • npm run lint (tsc + oxlint) passes.
  • A full bit build of a migrated component ran the Rspack bundler in the GeneratePreview task and completed all tasks.

Replaces #10467, which did the same migration against react-env@2.0.0.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Migrate React components to the Rspack-based React environment

⚙️ Configuration changes ✨ Enhancement 🕐 20-40 Minutes

Grey Divider

AI Description

• Assign 72 React components to react-env 2.0.3 for Rspack-powered previews.
• Reduce preview build time and memory usage in CI.
• Refresh pnpm lock data for the new environment dependency graph.
Diagram

graph TD
  A[".bitmap"] -->|assigns env| B["72 React components"] -->|uses| C["React Env 2.0.3"] -->|runs| D["Rspack preview build"] -->|improves| E(["CI efficiency"])
  F["pnpm lockfile"] -->|resolves deps| C
Loading
High-Level Assessment

The PR uses Bit's canonical bit env replace workflow and pins react-env 2.0.3 explicitly for the targeted components, making the migration auditable and reproducible. Retaining the webpack-based environment would preserve current behavior but miss the CI performance goal, while manual dependency changes would be less reliable than regenerating the lockfile through Bit and pnpm.

Files changed (2) +61866 / -49141

Other (2) +61866 / -49141
.bitmapAssign 72 components to react-env 2.0.3 +483/-69

Assign 72 components to react-env 2.0.3

• Adds explicit environment configuration for 72 React components, selecting 'teambit.react/react-env@2.0.3'. This routes their preview builds through the environment's Rspack bundler instead of the core React environment's webpack setup.

.bitmap

pnpm-lock.yamlRegenerate dependencies for the React environment migration +61383/-49072

Regenerate dependencies for the React environment migration

• Captures the generated dependency-resolution churn caused by switching the migrated components to react-env 2.0.3 and its Rspack-based preview toolchain.

pnpm-lock.yaml

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can copy the agent prompt from any finding and feed it to your IDE agent

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant