Repository navigation
docs(webpack): deprecate the core aspect's bundler/dev-server surface - #10624
Conversation
react/node/aspect envs now build with @teambit/webpack.webpack-bundler and @teambit/webpack.webpack-dev-server directly (#10610), not this aspect - see https://bit.cloud/teambit/webpack/~change-requests/decouple-webpack-bundler-from-webpack-aspect. Marks WebpackMain.createBundler/createDevServer/mergeConfig, the WebpackBundler/WebpackDevServer classes, and the rest of the public exports as @deprecated so anyone still importing from @teambit/webpack gets a signal to move to the standalone packages instead. No behavior change - a follow-up will delete the deprecated code once callers have migrated.
PR Summary by QodoDeprecate @teambit/webpack bundler/dev-server surface in favor of standalone packages
AI Description
Diagram
High-Level Assessment
Files changed (15)
|
Code Review by Qodo
1. React 18 variant added
|
| react: 18.3.1 | ||
| react-dom: 18.3.1(react@18.3.1) | ||
| webpack: 5.97.1([email protected])([email protected]) | ||
| webpack-dev-server: 4.15.0([email protected])([email protected])([email protected])([email protected]) | ||
| webpack-dev-server: 4.15.0([email protected])([email protected])([email protected])([email protected])([email protected]) |
There was a problem hiding this comment.
1. React 18 variant added 🐞 Bug ☼ Reliability
pnpm-lock.yaml now resolves @teambit/[email protected] in a React 18.3.1 context (react/react-dom), adding a second React major to the install graph. This conflicts with the workspace override strategy that tries to keep a single React version and risks duplicate React instances / type incompatibilities in preview/env loading.
Agent Prompt
## Issue description
The lockfile introduces a React 18.3.1 resolution path (via `@teambit/[email protected]`) alongside the workspace’s intended React 19 unification. This can lead to multiple React majors installed and resolved into different peer-variants.
## Issue Context
The workspace config explicitly pins React 19 and collapses older React 17 contexts to avoid duplicated React installs/types, but it does not pin React 18. The new lock snapshot for `@teambit/[email protected]` includes `react: 18.3.1` / `react-dom: 18.3.1`.
## Fix Focus Areas
- pnpm-lock.yaml[901-980]
- pnpm-lock.yaml[90191-90220]
- workspace.jsonc[695-724]
### Suggested remediation options
1) If this PR is intended to be deprecation-docs only: revert/regenerate `pnpm-lock.yaml` to the previous resolution (e.g. keep `@teambit/preview.react-preview` at `1.1.13`, which does not introduce the React 18 context shown in this PR diff).
2) If `@teambit/[email protected]` is required: add explicit overrides for `react@18` and `react-dom@18` to align with the workspace React policy, and verify previews still work end-to-end.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
2. Lockfile churn in docs pr 🐞 Bug ⚙ Maintainability
pnpm-lock.yaml updates resolve multiple @teambit packages to newer minor versions (e.g. @teambit/preview.react-preview 1.2.0 and @teambit/react.webpack.react-webpack 1.0.60), coupling dependency upgrades with the deprecation-only code changes. This makes the change harder to review and any regressions harder to attribute/roll back.
Agent Prompt
## Issue description
The PR includes resolved-version upgrades in `pnpm-lock.yaml` in addition to the intended `@deprecated` annotations.
## Issue Context
Even minor upgrades can change behavior; mixing them into a deprecation-only PR increases review surface and makes bisecting regressions harder.
## Fix Focus Areas
- pnpm-lock.yaml[915-946]
### Suggested remediation
- If the intent is deprecation annotations only: restore `pnpm-lock.yaml` to the previous state (or regenerate it without upgrading resolutions).
- Otherwise: split the lockfile upgrades into a dedicated PR with an explicit changelog/test plan for the upgraded packages.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Summary
react/node/aspect envs build with
@teambit/webpack.webpack-bundlerand@teambit/webpack.webpack-dev-serverdirectly now (#10610), not theteambit.webpack/webpackcore aspect. Depending on both means pnpm resolves two independently-versioned webpack instances - the exact root cause behind theinstanceof Compilationfailures fixed in #10620.This PR only adds
@deprecatedJSDoc to the now-superseded surface (WebpackMain.createBundler/createDevServer/mergeConfig, theWebpackBundler/WebpackDevServerclasses, and the various type/utility re-exports) so anyone still importing from@teambit/webpackgets a signal to move to the standalone packages. No code is removed and no behavior changes - purely additive, safe to merge on its own.A follow-up PR deletes the deprecated code once callers have had a chance to migrate (tracked separately, alongside https://bit.cloud/teambit/webpack/~change-requests/decouple-webpack-bundler-from-webpack-aspect).
Test plan
npm run lintpasses (tsc + oxlint)