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

[DevTools] Use Owner Stacks to Implement View Source of a Server Component #30798

Merged
merged 2 commits into from
Aug 27, 2024

Commits on Aug 23, 2024

  1. Optimize getSourceForFiber

    Skip intermediate maps. Store result on instance instead of itermediate
    stack. Skip generating stack frames for parents.
    
    This means that we don't jump to the source of nearest parent if this
    node doesn't have a stack. That was already a bug / weird.
    sebmarkbage committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    ba68663 View commit details
    Browse the repository at this point in the history
  2. Get the source location from the first owned child's stack frame

    If JSX is an owner of something then it must have the owner on the stack.
    
    There could be an edge case like if it's a bound function without a stack
    but in general it'll have a stack frame.
    
    We can use this as the source location of the component itself.
    sebmarkbage committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    b622950 View commit details
    Browse the repository at this point in the history