Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(devkit): bump compatibility to Nx 19 - 21.x #28243

Merged
merged 1 commit into from
Oct 3, 2024
Merged

Conversation

FrozenPandaz
Copy link
Collaborator

@FrozenPandaz FrozenPandaz commented Oct 2, 2024

BREAKING CHANGE

Current Behavior

  • @nx/devkit supports Nx 17 - 20.
  • Node 18 - 22 is supported
  • ExecutorContext.projectGraph, ExecutorContext.nxJsonConfiguration, and ExecutorContext.projectsConfigurations is marked as optional because ExecutorContext in some versions of Nx did not have them.
  • ExecutorContext.workspace is marked as optional because ExecutorContext in some versions of Nx did not have the above properties which contain the same information.
  • ProjectGraphNode is deprecated.
  • NxPluginV1.processProjectGraph was deprecated long ago and there has been a warning since.
  • appRootPath has been deprecated for a long time.
  • parseTargetString had a variant that did not take either the project graph or the executor context.
  • readNxJson has a variant which does not take a tree. This was not clearly deprecated.
  • There are handlers to require from @nx/ instead of @nrwl
  • Nx tries to get a root install from @nrwl/cli

Expected Behavior

  • @nx/devkit supports Nx 19 - 21.
  • Node 20 - 22 is supported
  • ExecutorContext.projectGraph, ExecutorContext.nxJsonConfiguration, and ExecutorContext.projectsConfigurations is marked as required because ExecutorContext in Nx 19+ is guaranteed to have them.
  • ExecutorContext.workspace is removed because the same information is available in the above properties
  • ProjectGraphNode is removed.
  • NxPluginV1 is no more. All plugins should be NxPluginV2.
  • workspaceRoot is the replacement for appRootPath. appRootPath is removed.
  • parseTargetString no longer has a variant that did not take either the project graph or the executor context.
  • readNxJson still has a variant which does not take a tree but it's clearly deprecated to be removed in Nx 21.
  • @nrwl packages are no more so we don't have to redirect requires anymore.
  • @nrwl/cli is no more so Nx shouldn't try to get a root install there

Related Issue(s)

Fixes #

Copy link

vercel bot commented Oct 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Oct 3, 2024 8:50pm

'node:sea',
'node:sqlite',
]);
const experimentalNodeModules = new Set(['node:sqlite']);
Copy link
Member

Choose a reason for hiding this comment

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

Is this necessary? If you run with node --experimental-sqlite then isBuiltin from node:module already includes node:sqlite.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sometimes Nx Console starts the daemon and probably won't run with --experimental-sqlite so this ensure that it's handled regardless of it's passed or not.

import { combineGlobPatterns } from '../../utils/globs';

import type { NxPluginV1 } from '../../utils/nx-plugin.deprecated';
import type { LoadedNxPlugin, NormalizedPlugin } from './internal-api';
import {
Copy link
Member

Choose a reason for hiding this comment

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

Are there changes to the V2 public APIs? I see that CreateNodesV2 is slated for removal in v21, and users should be using CreateNodes instead. Is that part of v20 changes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We'll do this in Nx 21.. because there's not enough time at the moment.

@FrozenPandaz FrozenPandaz force-pushed the devkit-cleanup branch 2 times, most recently from f480850 to 8101b56 Compare October 3, 2024 18:20
@FrozenPandaz FrozenPandaz changed the title feat(devkit): bump compatibility to Nx 19 - 20.x feat(devkit): bump compatibility to Nx 19 - 21.x Oct 3, 2024
@FrozenPandaz FrozenPandaz merged commit 23bebd9 into master Oct 3, 2024
6 checks passed
@FrozenPandaz FrozenPandaz deleted the devkit-cleanup branch October 3, 2024 21:35
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants