Skip to content

Commit

Permalink
Better handle solid.lazy
Browse files Browse the repository at this point in the history
  • Loading branch information
thetarnav committed Dec 28, 2024
1 parent ac36b2a commit b1bc047
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/debugger/src/structure/walker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,24 @@ function mapOwner(

let first_owned: Solid.Owner | undefined

/*
solid.lazy(MyComponent) hoc
↳ wrap (callback returned from lazy, called as a component)
↳ memo
↳ MyComponent
*/
if (name === 'wrap' &&
typeof ((owner as Solid.Component).component as any)?.preload === 'function' &&
owner.owned &&
owner.owned.length === 1 &&
markOwnerType((first_owned = owner.owned[0]!)) === NodeType.Memo &&
first_owned.owned &&
first_owned.owned.length === 1 &&
markOwnerType((first_owned = first_owned.owned[0]!)) === NodeType.Component
) {
return mapOwner(first_owned, parent)
}

/*
Context
Expand Down

0 comments on commit b1bc047

Please sign in to comment.