Skip to content

chore(gradle): deprecate @nx/gradle/plugin-v1 entry#35610

Merged
FrozenPandaz merged 3 commits into
masterfrom
deprecate-gradle-plugin-v1
May 8, 2026
Merged

chore(gradle): deprecate @nx/gradle/plugin-v1 entry#35610
FrozenPandaz merged 3 commits into
masterfrom
deprecate-gradle-plugin-v1

Conversation

@FrozenPandaz
Copy link
Copy Markdown
Contributor

Current Behavior

@nx/gradle/plugin-v1 is the legacy non-atomized Gradle plugin entry. In Nx 21, when v2 (the atomized default) became the new @nx/gradle, existing users were migrated to plugin-v1 to preserve their behavior. Since then it's been a stable opt-out, with no @deprecated annotation, no runtime warning, and no docs note signaling it's going away.

Expected Behavior

The @nx/gradle/plugin-v1 entry remains fully functional in Nx 23 but emits a clear deprecation warning on plugin load and is annotated @deprecated on every public symbol. Removal is scheduled for Nx 24, giving users on the legacy non-atomized plugin one major to switch to the default @nx/gradle entry.

What changed

  • packages/gradle/plugin-v1.ts — emits a deprecation warning on module load via emitPluginWorkerLog so the message surfaces to the user even when the daemon is enabled. Routing it through logger.warn would have been swallowed into the daemon log file.
  • packages/gradle/src/plugin-v1/{nodes,dependencies}.ts@deprecated JSDoc on the public createNodesV2 / createDependencies exports.
  • packages/nx/src/devkit-internals.ts + packages/devkit/internal.ts — re-export emitPluginWorkerLog so @nx/devkit/internal becomes the canonical path for plugin authors who want a daemon-aware warning channel (instead of deep-importing into nx/src/project-graph/plugins/isolation/).

Notes

  • Purely additive: no code or exports removed. Plugin behavior is unchanged.
  • Runtime-guarded with typeof emitPluginWorkerLog === 'function' to handle the @nx/devkit@23 + nx@22.0–22.6 skew (the helper shipped in nx@22.7).
  • A swap migration (rewriting @nx/gradle/plugin-v1@nx/gradle in nx.json) will ship alongside the v24 removal.

Related Issue(s)

Marks the plugin-v1 subpath export as deprecated and emits a runtime
warning on module load. The entry remains functional through Nx 23 and
is scheduled for removal in Nx 24, giving users on the legacy
non-atomized plugin one major to switch to the default @nx/gradle entry.
@netlify
Copy link
Copy Markdown

netlify Bot commented May 7, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 166ea4e
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69fd7a6aac4df8000809b6b2
😎 Deploy Preview https://deploy-preview-35610--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.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 7, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 166ea4e
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69fd7a6aa8291d0008a5622b
😎 Deploy Preview https://deploy-preview-35610--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.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented May 7, 2026

View your CI Pipeline Execution ↗ for commit 166ea4e

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 29m 46s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 3s 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 25s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 6s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-08 06:27:05 UTC

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

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.

Nx Cloud has identified a flaky task in your failed CI:

🔂 Since the failure was identified as flaky, we triggered a CI rerun by adding an empty commit to this branch.

Nx Cloud View detailed reasoning in Nx Cloud ↗


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

@FrozenPandaz FrozenPandaz marked this pull request as ready for review May 8, 2026 16:53
@FrozenPandaz FrozenPandaz requested a review from a team as a code owner May 8, 2026 16:54
@FrozenPandaz FrozenPandaz requested a review from leosvelperez May 8, 2026 16:54
@FrozenPandaz FrozenPandaz enabled auto-merge (squash) May 8, 2026 16:54
Comment on lines +11 to +19
if (typeof emitPluginWorkerLog === 'function') {
emitPluginWorkerLog(
'warn',
'`@nx/gradle/plugin-v1` is deprecated and will be removed in Nx 24. ' +
'Switch your `nx.json` plugins entry from `@nx/gradle/plugin-v1` to `@nx/gradle`. ' +
'Note that the default `@nx/gradle` plugin generates atomized targets — ' +
'see https://nx.dev/nx-api/gradle for configuration options.'
);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The typeof guard will not protect against older Nx versions lacking emitPluginWorkerLog. If the export doesn't exist in @nx/devkit/internal, the import statement at line 1 will throw a module resolution error before reaching the type check. This breaks the stated goal of supporting "@nx/devkit supports nx at +/-1 major" for Nx < 22.7.

Fix: Use dynamic import with try-catch:

try {
  const { emitPluginWorkerLog } = await import('@nx/devkit/internal');
  if (typeof emitPluginWorkerLog === 'function') {
    emitPluginWorkerLog('warn', '...');
  }
} catch {
  // Gracefully degrade on older Nx versions
}

Or conditionally import only when needed and handle the error.

Suggested change
if (typeof emitPluginWorkerLog === 'function') {
emitPluginWorkerLog(
'warn',
'`@nx/gradle/plugin-v1` is deprecated and will be removed in Nx 24. ' +
'Switch your `nx.json` plugins entry from `@nx/gradle/plugin-v1` to `@nx/gradle`. ' +
'Note that the default `@nx/gradle` plugin generates atomized targets — ' +
'see https://nx.dev/nx-api/gradle for configuration options.'
);
}
try {
const { emitPluginWorkerLog } = await import('@nx/devkit/internal');
if (typeof emitPluginWorkerLog === 'function') {
emitPluginWorkerLog(
'warn',
'`@nx/gradle/plugin-v1` is deprecated and will be removed in Nx 24. ' +
'Switch your `nx.json` plugins entry from `@nx/gradle/plugin-v1` to `@nx/gradle`. ' +
'Note that the default `@nx/gradle` plugin generates atomized targets — ' +
'see https://nx.dev/nx-api/gradle for configuration options.'
);
}
} catch {
// Gracefully degrade on older Nx versions that lack emitPluginWorkerLog
}

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@FrozenPandaz FrozenPandaz merged commit 509d92e into master May 8, 2026
26 checks passed
@FrozenPandaz FrozenPandaz deleted the deprecate-gradle-plugin-v1 branch May 8, 2026 19:31
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.

2 participants