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): avoid launching default plugins twice #29539

Merged
merged 3 commits into from
Jan 8, 2025

Conversation

AgentEnder
Copy link
Member

Current Behavior

Default plugins are launched twice when loading plugins in a workspace that has local plugins:

  • Once to resolve the local plugin
  • Once to be used as an actual plugin

Expected Behavior

Default plugins are launched once and reused

Related Issue(s)

Fixes #

@AgentEnder AgentEnder requested a review from a team as a code owner January 7, 2025 14:48
Copy link

vercel bot commented Jan 7, 2025

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

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Jan 8, 2025 9:14pm

Copy link

nx-cloud bot commented Jan 7, 2025

View your CI Pipeline Execution ↗ for commit a5b786e.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 12m 58s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 24s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check --base=cb4a9... ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗
nx documentation --no-dte ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-08 22:58:23 UTC

@AgentEnder AgentEnder force-pushed the fix/only-launch-default-plugins-once branch from 1ac8357 to e216afc Compare January 7, 2025 18:51
@AgentEnder AgentEnder requested a review from a team as a code owner January 7, 2025 23:56
@AgentEnder AgentEnder force-pushed the fix/only-launch-default-plugins-once branch from 1bde73f to 3d23c4c Compare January 8, 2025 16:37
@AgentEnder AgentEnder force-pushed the fix/only-launch-default-plugins-once branch from 3d23c4c to 824fc92 Compare January 8, 2025 17:13
Comment on lines 276 to 279
async function normalizePlugins(plugins: PluginConfiguration[], root: string) {
plugins ??= [];

return [
...plugins,
// Most of the nx core node plugins go on the end, s.t. it overwrites any other plugins
...(await getDefaultPlugins(root)),
];
return [...plugins];
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe we don't have to normalize plugins at all anymore?

* Use `getPlugins` instead.
* @deprecated Do not use this. Use `getPlugins` instead.
*/
export async function loadNxPlugins(
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is now only used in 2 tests. Can we get rid of this function?

@FrozenPandaz FrozenPandaz merged commit 0edd110 into master Jan 8, 2025
6 checks passed
@FrozenPandaz FrozenPandaz deleted the fix/only-launch-default-plugins-once branch January 8, 2025 23:10
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 Jan 14, 2025
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.

2 participants