发布

  • feat(misc)!: deprecate executors with inferred-plugin replacements (#35576)

    frostbyte_neo 发布于 2026-05-08 17:22:57 +00:00

    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
    @nx/react-native build-android, build-ios, bundle,
    pod-install, run-android, run-ios, start, upgrade
    @nx/vitest test

    Generation-time warnings wired in

    • @nx/<pkg>:configuration for webpack, vite, rollup, jest, playwright,
      storybook, rspack, vitest
    • @nx/<pkg>:application for next, expo, react-native
    • @nx/eslint:lint-project legacy fallback path
    • @nx/react:application (webpack, rspack branches) and
      @nx/react:library (rollup legacy fallback) — warning text is inlined
      rather than imported. Two distinct reasons:
    • rspack: @nx/react does not declare a tsconfig project reference
      to @nx/rspack, so the deep import would not even type-check.
    • webpack and rollup: the project reference exists, so the deep
      import compiles, but @nx/webpack and @nx/rollup only expose
      ./index.js in their package exports field. The import would resolve
      in source but throw Cannot find module '@nx/<pkg>/src/utils/deprecation' at runtime in published packages.
    • @nx/react-native:web-configuration (webpack) — inline for the same
      reason as the rspack case (no project reference).

    Scope notes

    • @nx/vite:test is intentionally not included — it is being
      removed entirely by PR #35517 (deprecation messaging would ship as dead
      code). @nx/vitest:test is now in scope: the convert-to-inferred
      generator for @nx/vitest is in place, so the deprecation has a real
      migration target.
    • @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/react-native:storybook is intentionally not included. The
      companion @nx/react-native:storybook-configuration generator was
      already removed in v21 and no generator has emitted this target since
      Jan 2024 (RN 0.73 upgrade). It will be removed outright in a follow-up
      PR rather than going through the deprecate-now / remove-in-v24 cycle.
    • @nx/webpack:ssr-dev-server, @nx/expo:build-list,
      @nx/expo:sync-deps, @nx/expo:update, @nx/expo:ensure-symlink,
      @nx/react-native:sync-deps, and @nx/react-native:ensure-symlink are
      intentionally left as-is — none are covered by convert-to-inferred and
      they have no clean replacement (Nx-specific glue or non-migrating
      utilities).
    • @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.
    Fixes NXC-4296.
    Fixes NXC-4294.
    Fixes NXC-4290.
    Fixes NXC-4285.
    Fixes NXC-4283.
    Fixes NXC-4286.
    Fixes NXC-4297.
    Fixes NXC-4293.
    Fixes NXC-4292.
    Fixes NXC-4282.
    Fixes NXC-4287.
    Fixes NXC-4295.
    Fixes NXC-4447.


    Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>

    下载附件