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

Refactor Component Stack Traces #18495

Merged
merged 7 commits into from
Apr 6, 2020

Commits on Apr 6, 2020

  1. Add feature flag

    sebmarkbage committed Apr 6, 2020
    Configuration menu
    Copy the full SHA
    4a7480d View commit details
    Browse the repository at this point in the history
  2. Split stack from current fiber

    You can get stack from any fiber, not just current.
    sebmarkbage committed Apr 6, 2020
    Configuration menu
    Copy the full SHA
    394db23 View commit details
    Browse the repository at this point in the history
  3. Refactor description of component frames

    These should use fiber tags for switching. This also puts the relevant code
    behind DEV flags.
    sebmarkbage committed Apr 6, 2020
    Configuration menu
    Copy the full SHA
    35e1403 View commit details
    Browse the repository at this point in the history
  4. We no longer expose StrictMode in component stacks

    They're not super useful and will go away later anyway.
    sebmarkbage committed Apr 6, 2020
    Configuration menu
    Copy the full SHA
    1438716 View commit details
    Browse the repository at this point in the history
  5. Update tests

    Context is no longer part of SSR stacks. This was already the case on the
    client.
    
    forwardRef no longer is wrapped on the stack. It's still in getComponentName
    but it's probably just noise in stacks. Eventually we'll remove the wrapper
    so it'll go away anyway. If we use native stack frames they won't have this
    extra wrapper.
    
    It also doesn't pick up displayName from the outer wrapper. We could maybe
    transfer it but this will also be fixed by removing the wrapper.
    sebmarkbage committed Apr 6, 2020
    Configuration menu
    Copy the full SHA
    5a1f598 View commit details
    Browse the repository at this point in the history
  6. Forward displayName onto the inner function for forwardRef and memo i…

    …n DEV
    
    This allows them to show up in stack traces.
    
    I'm not doing this for lazy because lazy is supposed to be called on the
    consuming side so you shouldn't assign it a name on that end. Especially
    not one that mutates the inner.
    sebmarkbage committed Apr 6, 2020
    Configuration menu
    Copy the full SHA
    9054ad2 View commit details
    Browse the repository at this point in the history
  7. Use multiple instances of the fake component

    We mutate the inner component for its name so we need multiple copies.
    sebmarkbage committed Apr 6, 2020
    Configuration menu
    Copy the full SHA
    5ccb1d1 View commit details
    Browse the repository at this point in the history