-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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(node-modules): Portal support #2481
Conversation
Co-authored-by: Andrei Alecu <andreialecu@users.noreply.github.com>
Co-authored-by: Andrei Alecu <andreialecu@users.noreply.github.com>
193def2
to
4c71dc6
Compare
Would it be worth to have the linker print a warning explaining that |
Yes, I think, it makes sense, I will add the warning, when any of portal targets has at least one dependency (otherwise the |
This is currently still missing the |
@andreialecu I'm not sure what do you mean, the |
The core doesn't resolve the |
@larixer sorry for not being clear enough, I'm referring to the discussion on Discord here: https://discord.com/channels/226791405589233664/226793713722982400/810902897947836466 |
e41d66a
to
d37d1d5
Compare
* fix: restore build state to prevent rebuilds * fix: persist build state when lockfile doesn't match persisted resolutions
66754db
to
00dcb34
Compare
Switched to a draft, because apparently if portal target is inside the project and it is used more than once, the portal must be fully hoistable too, otherwise multiple hoisting layouts will arise for such a portal which will lead to broken install. Going to implement this extra constraint here |
Actually in the case above the inner portal MUST NOT be fully hoistable, it must have SINGLE hoisting layout. Hence, this PR is okay. There are two other problems that should be addressed in follow up PRs, but these problems existed for long time already and not directly related to portals:
|
What's the problem this PR addresses?
This PR adds support for portals to the node-modules linker. The application that uses portals must be started with
--preserve-symlinks
Node option. Only those portals that point inside project directory or have no conflicting dependencies with their parent package are representable in node_modules installs and are supported. When conflict is found, the nm linker outputs error and abandons install.How did you fix it?
Portal dependencies are now added to the dependency graph before hoisting. Conflicts in portal dependencies are detected and reported.
This PR also fixes #2266
CC: @andreialecu
Checklist