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(core): execute plugins in isolated processes #21760

Merged
merged 4 commits into from Feb 23, 2024

Conversation

AgentEnder
Copy link
Member

@AgentEnder AgentEnder commented Feb 9, 2024

Current Behavior

Project graph plugins are all loaded in the main nx process (or daemon if enabled), which can cause issues when they do things that mutate the global process (E.g. registering a typescript transpiler)

Expected Behavior

Plugins operate in a sandbox

Related Issue(s)

See: https://www.loom.com/share/87febc4db210444aa7f4163a76d7f758

Copy link

vercel bot commented Feb 9, 2024

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

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Feb 22, 2024 9:57pm

@AgentEnder AgentEnder requested review from a team as code owners February 9, 2024 22:56
@@ -1,3 +1,5 @@
import { shutdownPluginWorkers } from './project-graph/plugins/plugin-pool';
Copy link
Member

Choose a reason for hiding this comment

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

remove this import

const pidMap = new Map<number, string>();

export function loadRemoteNxPlugin(plugin: PluginConfiguration, root: string) {
const isTest = path.extname(__filename) === '.ts';
Copy link
Member

Choose a reason for hiding this comment

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

I understand why we need to do this, but maybe we can change this to be more descriptive.

Comment on lines 210 to 216
if (process.env.NX_VERBOSE_LOGGING) {
console.log(
'Unable to find local plugin',
possiblePaths,
projectRootMappings
);
}
Copy link
Member

Choose a reason for hiding this comment

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

Use the new logger.verbose function

@AgentEnder AgentEnder force-pushed the feat/isolated-plugins branch 2 times, most recently from 358efad to 44284fa Compare February 22, 2024 21:37
@AgentEnder AgentEnder merged commit c2581dc into nrwl:master Feb 23, 2024
4 of 6 checks passed
@AgentEnder AgentEnder deleted the feat/isolated-plugins branch February 23, 2024 18:20
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 Feb 29, 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.

None yet

3 participants