Skip to content

fix: consolidate isolated node/link attributes#9069

Merged
wraithgar merged 3 commits intolatestfrom
gar/isolated-fake-node
Mar 6, 2026
Merged

fix: consolidate isolated node/link attributes#9069
wraithgar merged 3 commits intolatestfrom
gar/isolated-fake-node

Conversation

@wraithgar
Copy link
Member

We are making fake versions of nodes and links in isolated mode. With this we are at least being consistent w/ the default attributes. For example isStoreLink was not on workspace links, but it is now.

@manzoorwanijk Heads up here. This is step one of the "fake Node and Link" cleanup I was talking about.

@wraithgar wraithgar requested a review from a team as a code owner March 5, 2026 20:52
@wraithgar wraithgar force-pushed the gar/isolated-fake-node branch from 9632d28 to 8008fb0 Compare March 5, 2026 21:04
children: combined,
let wrapper
/* istanbul ignore next - untested! */
if (actualTree.isLink) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only "new" code path here and we are not testing a linked root tree in isolated mode.

@manzoorwanijk
Copy link
Contributor

@manzoorwanijk Heads up here. This is step one of the "fake Node and Link" cleanup I was talking about.

Thank you for the heads up. For now, I would want to backport #9066 to v10.

@wraithgar
Copy link
Member Author

Yeah we can do another backport PR next week. I'm still iterating on this, I have more consolidation I'm doing now.

@manzoorwanijk
Copy link
Contributor

Yeah we can do another backport PR next week. I'm still iterating on this, I have more consolidation I'm doing now.

Sounds good. Thank you.

@wraithgar wraithgar force-pushed the gar/isolated-fake-node branch 2 times, most recently from 8977248 to ff5e96b Compare March 6, 2026 04:23
@wraithgar
Copy link
Member Author

@owlstronaut this is ready for review now.

We are making fake versions of nodes and links in isolated mode.
With this we are at least being consistent w/ the default attributes.
For example `isStoreLink` was not on workspace links, but it is now.
@wraithgar wraithgar force-pushed the gar/isolated-fake-node branch from ff5e96b to e65ce49 Compare March 6, 2026 04:28
@wraithgar
Copy link
Member Author

@manzoorwanijk given #9064 I think I see now why there is a "top" attribute here that seems out of place. It's left over from before the add omits to trash list refactor.

We'll want to be sure to account for that either here or when we backport this refactor to v10.

}

get isStoreLink () {
return true
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, won't workspace nodes pick this up?

Copy link
Member Author

Choose a reason for hiding this comment

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

These are links not nodes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, sorry, that's what I meant -

const wsLink = new IsolatedLink({
is where I'm worried about the workspace links being identified as store links

Copy link
Member Author

Choose a reason for hiding this comment

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

This is purely for the _diffTree, and it helps match nodes to their actual place on disk. Workspaces ARE links.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed they are links, but I think the isStoreLink returning true will be a change in behavior for them. There is some deduplication code in rebuild

for (const node of nodes) {
if (node.isStoreLink) {
storeNodes.add(node)
} else if (node.isLink) {
linkNodes.add(node)
} else {
depNodes.add(node)
}
}
. Workspace links will change their 'type'. This code seems to prevent lifecycle scripts from running twice?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok I'll go make that a this attribute and only pass it in and set it where it was explicit before.

@wraithgar wraithgar force-pushed the gar/isolated-fake-node branch from e6b75bc to e2f5dfd Compare March 6, 2026 16:54
@wraithgar
Copy link
Member Author

Those .top attributes end up being used at least once in reify's isolated mode path so I put them back. We can deal with it later.

@wraithgar wraithgar force-pushed the gar/isolated-fake-node branch from b04eb7b to 5137da2 Compare March 6, 2026 17:35
@wraithgar wraithgar force-pushed the gar/isolated-fake-node branch from 5137da2 to 7bbda07 Compare March 6, 2026 17:37
Copy link
Contributor

@owlstronaut owlstronaut left a comment

Choose a reason for hiding this comment

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

woohoo! This is awesome

@wraithgar wraithgar merged commit 1206f8b into latest Mar 6, 2026
16 checks passed
@wraithgar wraithgar deleted the gar/isolated-fake-node branch March 6, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants