[Fiber] Don't throw away the Error object retaining the owner stack#33976
Merged
sebmarkbage merged 1 commit intofacebook:mainfrom Jul 24, 2025
Merged
[Fiber] Don't throw away the Error object retaining the owner stack#33976sebmarkbage merged 1 commit intofacebook:mainfrom
sebmarkbage merged 1 commit intofacebook:mainfrom
Conversation
sebmarkbage
commented
Jul 23, 2025
| const fiber: Fiber = (owner: any); | ||
| owner = fiber._debugOwner; | ||
| let debugStack = fiber._debugStack; | ||
| let debugStack: void | null | string | Error = fiber._debugStack; |
Contributor
Author
There was a problem hiding this comment.
This may still be a string for backwards compat.
|
Comparing: edac0dd...9434877 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
eps1lon
approved these changes
Jul 24, 2025
Contributor
Author
|
We don't plan to use the Chrome Debugger Protocol for inspecting owner stacks yet so this is not necessary but if ever do, then this would become necessary. So I'll land it preemptively since it should ideally retroactively work as far backwards as possible. |
github-actions bot
pushed a commit
that referenced
this pull request
Jul 24, 2025
…33976) We currently throw away the Error once we've used to the owner stack of a Fiber once. This maybe helps a bit with memory and redoing it but we really don't expect most Fibers to hit this at all. It's not very hot. If we throw away the Error, then we can't use native debugger protocols to inspect the native stack. Instead, we'd have to maintain a url to resource map indefinitely like what Chrome DevTools does to map a url to a resource. Technically it's not even technically correct since the file path might not be reversible and could in theory conflict. DiffTrain build for [4f34cc4](4f34cc4)
github-actions bot
pushed a commit
that referenced
this pull request
Jul 24, 2025
…33976) We currently throw away the Error once we've used to the owner stack of a Fiber once. This maybe helps a bit with memory and redoing it but we really don't expect most Fibers to hit this at all. It's not very hot. If we throw away the Error, then we can't use native debugger protocols to inspect the native stack. Instead, we'd have to maintain a url to resource map indefinitely like what Chrome DevTools does to map a url to a resource. Technically it's not even technically correct since the file path might not be reversible and could in theory conflict. DiffTrain build for [4f34cc4](4f34cc4)
github-actions bot
pushed a commit
to code/lib-react
that referenced
this pull request
Jul 28, 2025
…acebook#33976) We currently throw away the Error once we've used to the owner stack of a Fiber once. This maybe helps a bit with memory and redoing it but we really don't expect most Fibers to hit this at all. It's not very hot. If we throw away the Error, then we can't use native debugger protocols to inspect the native stack. Instead, we'd have to maintain a url to resource map indefinitely like what Chrome DevTools does to map a url to a resource. Technically it's not even technically correct since the file path might not be reversible and could in theory conflict. DiffTrain build for [4f34cc4](facebook@4f34cc4)
github-actions bot
pushed a commit
to code/lib-react
that referenced
this pull request
Jul 28, 2025
…acebook#33976) We currently throw away the Error once we've used to the owner stack of a Fiber once. This maybe helps a bit with memory and redoing it but we really don't expect most Fibers to hit this at all. It's not very hot. If we throw away the Error, then we can't use native debugger protocols to inspect the native stack. Instead, we'd have to maintain a url to resource map indefinitely like what Chrome DevTools does to map a url to a resource. Technically it's not even technically correct since the file path might not be reversible and could in theory conflict. DiffTrain build for [4f34cc4](facebook@4f34cc4)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We currently throw away the Error once we've used to the owner stack of a Fiber once. This maybe helps a bit with memory and redoing it but we really don't expect most Fibers to hit this at all. It's not very hot.
If we throw away the Error, then we can't use native debugger protocols to inspect the native stack. Instead, we'd have to maintain a url to resource map indefinitely like what Chrome DevTools does to map a url to a resource. Technically it's not even technically correct since the file path might not be reversible and could in theory conflict.