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

fix(core): all graph nodes should have targets block, even if its empty #18625

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

AgentEnder
Copy link
Member

Current Behavior

After #18032 project nodes on the graph may not have a targets block. We've always supported projects having undefined targets in generators when a project is defined by package.json or similar, but once they are in the graph they have generally had the targets block. This was a result of the mergePluginTargets function which assigned targets from nx plugin's registerProjectTargets method.

In #18032 we removed that method entirely, and didn't notice that it was essentially doing node.data.targets ??= {}.

In our own code, this resulted in nx graph failing when it tried to build the task graphs for the UI to display but it would not be unrealistic to say that there would be other cases that this would crop up in the Nx codebase or user's custom scripts.

Expected Behavior

Project nodes have a targets block, even if it may be empty and all createNodes functions returned undefined targets.

Related Issue(s)

Fixes #

@AgentEnder AgentEnder requested a review from a team as a code owner August 14, 2023 17:56
@vercel
Copy link

vercel bot commented Aug 14, 2023

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

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 14, 2023 6:02pm

@FrozenPandaz FrozenPandaz enabled auto-merge (squash) August 14, 2023 18:16
@FrozenPandaz FrozenPandaz merged commit b2ecea4 into nrwl:master Aug 14, 2023
15 checks passed
@github-actions
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 Aug 20, 2023
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.

None yet

2 participants