Skip to content

chore(bundling): deprecate @nx/webpack, @nx/vite, and @nx/rollup build executors#35576

Draft
FrozenPandaz wants to merge 12 commits intomasterfrom
deprecate-bundlers
Draft

chore(bundling): deprecate @nx/webpack, @nx/vite, and @nx/rollup build executors#35576
FrozenPandaz wants to merge 12 commits intomasterfrom
deprecate-bundlers

Conversation

@FrozenPandaz
Copy link
Copy Markdown
Contributor

@FrozenPandaz FrozenPandaz commented May 5, 2026

Current Behavior

Most Nx executors that have an inferred-plugin alternative (@nx/<pkg>/plugin) and a convert-to-inferred generator are still wired up like first-class citizens. There is no signal — at scaffold time, schema browsing, or task execution — that they are on a path to removal, and the existing cypress/detox deprecation messages are inconsistent with the canonical pattern shipped most recently.

Expected Behavior

Every executor that has an inferred-plugin migration target is now deprecated through three surfaces, matching the canonical pattern:

  • Runtime warning. The executor logs that it is deprecated, will be removed in Nx v24, and points at nx g @nx/<pkg>:convert-to-inferred.
  • Schema-root x-deprecated. Surfaces in editor / Nx Console / nx show project views.
  • Generation-time warning. When a generator is about to scaffold a target that uses one of these executors because the corresponding inferred plugin isn't registered, it warns at generation time and points at the same migration path.

All warnings link to https://nx.dev/docs/guides/tasks--caching/convert-to-inferred.

Executors deprecated in this PR

Package Executors
@nx/webpack webpack, dev-server
@nx/vite build, dev-server, preview-server
@nx/rollup rollup
@nx/next build, server
@nx/remix build, serve
@nx/jest jest
@nx/playwright playwright
@nx/eslint lint
@nx/storybook storybook, build
@nx/rspack rspack, dev-server
@nx/expo build, export, install, prebuild, run, serve, start, submit

Generation-time warnings wired in

  • @nx/<pkg>:configuration for webpack, vite, rollup, jest, playwright, storybook, rspack
  • @nx/<pkg>:application for next, expo
  • @nx/eslint:lint-project legacy fallback path
  • @nx/react:application (webpack, rspack branches) — inline because react does not have a tsconfig project reference to rspack
  • @nx/react:library (rollup legacy fallback)
  • @nx/react-native:web-configuration (webpack) — inline for the same reason

Scope notes

  • @nx/vite:test and @nx/vitest:test are intentionally not included — @nx/vite:test is being removed entirely by PR feat(vite)!: remove vitest support in favor of @nx/vitest #35517 (deprecation messaging would ship as dead code), and @nx/vitest:test is the destination of feat(vite)!: remove vitest support in favor of @nx/vitest #35517's migration, so deprecating it in the same release would be confusing user-facing messaging. Both are tracked as follow-ups once feat(vite)!: remove vitest support in favor of @nx/vitest #35517 settles.
  • @nx/cypress/@nx/detox already shipped earlier; this PR retitles their generation-time messages to the new wording (drop the redundant "register the plugin first" guidance, swap "Scaffolding" for "Generating") and points the detox URL at the general convert-to-inferred guide.
  • @nx/webpack:ssr-dev-server, @nx/expo:build-list, @nx/expo:sync-deps, @nx/expo:update, and @nx/expo:ensure-symlink are intentionally left as-is — none are covered by convert-to-inferred.
  • @nx/esbuild:esbuild and @nx/nuxt:* ship neither an inferred plugin nor a convert-to-inferred generator yet, so they're out of scope.
  • Per-package READMEs, introduction-doc banners, per-package "migration recipe" pages, and migrations.json entries are intentionally skipped per the canonical pattern (NXC-4422). The runtime warning carries the migration story.

Related Issue(s)

Fixes NXC-4423.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 5, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 1a366cf
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69fb5263db9527000816927a
😎 Deploy Preview https://deploy-preview-35576--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 5, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 1a366cf
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69fb52634e55a5000867ecd0
😎 Deploy Preview https://deploy-preview-35576--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented May 5, 2026

View your CI Pipeline Execution ↗ for commit 1a366cf

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ⛔ Cancelled 3m 39s View ↗
nx affected -t e2e-macos-local --parallel=1 --b... ❌ Failed 37m 55s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 5s View ↗
nx-cloud record -- pnpm nx-cloud conformance:check ✅ Succeeded 17s View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 24s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 9s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-06 15:33:34 UTC

@FrozenPandaz FrozenPandaz force-pushed the deprecate-bundlers branch from c789112 to 47ae35d Compare May 5, 2026 20:15
nx-cloud[bot]

This comment was marked as outdated.

@FrozenPandaz FrozenPandaz force-pushed the deprecate-bundlers branch from 563eed1 to 73cc1b8 Compare May 5, 2026 21:16
nx-cloud[bot]

This comment was marked as outdated.

@FrozenPandaz FrozenPandaz force-pushed the deprecate-bundlers branch from 73cc1b8 to 8c04e67 Compare May 5, 2026 21:47
Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud is proposing a fix for your failed CI:

We removed the cross-package import of warnWebpackExecutorScaffolding from @nx/webpack/src/utils/deprecation and inlined the equivalent logger.warn(...) call directly in packages/react/src/generators/application/lib/add-project.ts. This mirrors the existing pattern already used for the rspack warning in the same file and eliminates the runtime require that failed when @nx/webpack was resolved from the npm registry rather than a local build, fixing all 42 failing e2e tasks.

Warning

We could not verify this fix.

diff --git a/packages/react/src/generators/application/lib/add-project.ts b/packages/react/src/generators/application/lib/add-project.ts
index fd2f6c9f..0c9f6f70 100644
--- a/packages/react/src/generators/application/lib/add-project.ts
+++ b/packages/react/src/generators/application/lib/add-project.ts
@@ -12,7 +12,6 @@ import {
 import { hasWebpackPlugin } from '../../../utils/has-webpack-plugin';
 import { maybeJs } from '../../../utils/maybe-js';
 import { hasRspackPlugin } from '../../../utils/has-rspack-plugin';
-import { warnWebpackExecutorScaffolding } from '@nx/webpack/src/utils/deprecation';
 import type { PackageJson } from 'nx/src/utils/package-json';
 
 export function addProject(host: Tree, options: NormalizedSchema) {
@@ -26,7 +25,12 @@ export function addProject(host: Tree, options: NormalizedSchema) {
 
   if (options.bundler === 'webpack') {
     if (!hasWebpackPlugin(host) || !options.addPlugin) {
-      warnWebpackExecutorScaffolding();
+      // Mirrors warnWebpackExecutorScaffolding from @nx/webpack/src/utils/deprecation.
+      // Inlined to avoid a cross-package runtime require that breaks when @nx/webpack
+      // is resolved from the npm registry rather than a local build.
+      logger.warn(
+        'Generating targets that use the deprecated `@nx/webpack:webpack` and `@nx/webpack:dev-server` executors. These executors will be removed in Nx v24. Run `nx g @nx/webpack:convert-to-inferred` next to migrate these targets to the `@nx/webpack/plugin` inferred plugin and prevent future generators from emitting executor targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.'
+      );
       project.targets = {
         build: createBuildTarget(options),
         serve: createServeTarget(options),

🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.

Apply fix via Nx Cloud  Reject fix via Nx Cloud


Or Apply changes locally with:

npx nx-cloud apply-locally MoOI-sf4K

Apply fix locally with your editor ↗   View interactive diff ↗



🎓 Learn more about Self-Healing CI on nx.dev

…v-server executors

Add runtime + scaffold-time deprecation warnings and a schema-root
x-deprecated for @nx/webpack:webpack and @nx/webpack:dev-server. All
messages link to the general convert-to-inferred guide and point users
at `nx g @nx/webpack:convert-to-inferred` and the `@nx/webpack/plugin`
inferred plugin. Scaffold-time warnings fire from the @nx/webpack:configuration
generator and from the @nx/react / @nx/react-native scaffold paths that
bake the executor targets in directly.
…iew-server executors

Add runtime + scaffold-time deprecation warnings and a schema-root
x-deprecated for @nx/vite:build, @nx/vite:dev-server, and
@nx/vite:preview-server. All messages link to the general
convert-to-inferred guide and point users at `nx g @nx/vite:convert-to-inferred`
and the `@nx/vite/plugin` inferred plugin. The @nx/vite:test executor is
covered by the test-runner deprecation batch and is intentionally left out.
Add runtime + scaffold-time deprecation warnings and a schema-root
x-deprecated for @nx/rollup:rollup. The warnings link to the general
convert-to-inferred guide and point users at `nx g @nx/rollup:convert-to-inferred`
and the `@nx/rollup/plugin` inferred plugin. Scaffold-time warning fires
from @nx/rollup:configuration and from the @nx/react library generator's
legacy executor-target fallback when @nx/rollup/plugin is not registered.
…tors

Add runtime + scaffold-time deprecation warnings and a schema-root
x-deprecated for @nx/next:build and @nx/next:server. Warnings link to
the general convert-to-inferred guide and point users at
`nx g @nx/next:convert-to-inferred` and the `@nx/next/plugin` inferred
plugin. Scaffold-time warning fires from @nx/next:application when
@nx/next/plugin is not registered.
…tors

Add runtime deprecation warnings and a schema-root x-deprecated for
@nx/remix:build and @nx/remix:serve. Warnings link to the general
convert-to-inferred guide and point users at
`nx g @nx/remix:convert-to-inferred` and the `@nx/remix/plugin` inferred
plugin. No scaffold-time warning is needed because @nx/remix:application
already only registers the inferred plugin and never emits executor
targets directly.
…ion time

The previous wording started with "Scaffolding ..." and asked the user
to register `@nx/<pkg>/plugin` in `nx.json` first as a separate step.
Both points were noisy: "scaffolding" reads strangely in user-facing
output, and `convert-to-inferred` already registers the plugin in
nx.json, so directing users at the generator is enough.

Each generation-time warning now starts with "Generating ..." and reads
as a single ask: run `nx g @nx/<pkg>:convert-to-inferred` next, which
both migrates the just-generated targets to the inferred plugin and
prevents future generators from emitting executor targets.

Also retargets the detox warning's URL at the general
convert-to-inferred guide for consistency with the rest of the family.
Add runtime + scaffold-time deprecation warnings and a schema-root
x-deprecated for @nx/jest:jest. Warnings link to the general
convert-to-inferred guide and point users at
`nx g @nx/jest:convert-to-inferred` and the `@nx/jest/plugin` inferred
plugin. Scaffold-time warning fires from @nx/jest:configuration when
the inferred plugin is not registered or `addExplicitTargets` is set.
Add runtime + scaffold-time deprecation warnings and a schema-root
x-deprecated for @nx/playwright:playwright. Warnings link to the
general convert-to-inferred guide and point users at
`nx g @nx/playwright:convert-to-inferred` and the `@nx/playwright/plugin`
inferred plugin. Scaffold-time warning fires from
@nx/playwright:configuration when the inferred plugin is not registered.
Add runtime + scaffold-time deprecation warnings and a schema-root
x-deprecated for @nx/eslint:lint. Warnings link to the general
convert-to-inferred guide and point users at
`nx g @nx/eslint:convert-to-inferred` and the `@nx/eslint/plugin`
inferred plugin. Scaffold-time warning fires from
@nx/eslint:lint-project when it falls back to the executor target
because the inferred plugin is not registered.
…book:build executors

Add runtime + scaffold-time deprecation warnings and a schema-root
x-deprecated for both executors. Warnings link to the general
convert-to-inferred guide and point users at
`nx g @nx/storybook:convert-to-inferred` and the `@nx/storybook/plugin`
inferred plugin. Scaffold-time warning fires from
@nx/storybook:configuration when the inferred plugin is not registered
or `addExplicitTargets` is set.
…ver executors

Add runtime + scaffold-time deprecation warnings and a schema-root
x-deprecated for both executors. Warnings link to the general
convert-to-inferred guide and point users at
`nx g @nx/rspack:convert-to-inferred` and the `@nx/rspack/plugin`
inferred plugin. Scaffold-time warning fires from @nx/rspack:configuration
and from the @nx/react:application generator's rspack branch when
@nx/rspack/plugin is not registered. Inlined the warning in the
@nx/react caller because react does not declare a TypeScript project
reference to rspack.
…nferred

Add runtime + scaffold-time deprecation warnings and a schema-root
x-deprecated for the eight @nx/expo executors that have a migration
path through `@nx/expo:convert-to-inferred`: build, export, install,
prebuild, run, serve, start, and submit. Warnings link to the general
convert-to-inferred guide and point users at the `@nx/expo/plugin`
inferred plugin. Scaffold-time warning fires from @nx/expo:application
when the inferred plugin is not registered.

`@nx/expo:build-list`, `:sync-deps`, `:update`, and `:ensure-symlink`
are not covered by `convert-to-inferred`, so they stay as-is.
@FrozenPandaz FrozenPandaz force-pushed the deprecate-bundlers branch from 8c04e67 to 1a366cf Compare May 6, 2026 14:38
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