-
Notifications
You must be signed in to change notification settings - Fork 626
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
add customizeStack hook #964
Closed
Closed
Conversation
This file contains 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
facebook-github-bot
added
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
labels
Apr 5, 2023
This pull request was exported from Phabricator. Differential Revision: D44257733 |
GijsWeterings
added a commit
to GijsWeterings/metro
that referenced
this pull request
Apr 5, 2023
Summary: X-link: facebook/react-native#36819 Pull Request resolved: facebook#964 This diff creates a new hook to the Metro symbolicator. `customizeStack` aims to provide a whole stack modification hook on the output of the `/symbolicate` endpoint. The purpose of this hook is to be able to apply callsite-based modifications to the stack trace. One such example is user-facing frame skipping APIs like FBLogger internally. Consider the following API: ``` FBLogger('my_project') .blameToPreviousFile() .mustfix( 'This error should refer to the callsite of this method', ); ``` In this particular case, we'd want to skip all frames from the top that come from the same source file. To do that, we need knowledge of the entire symbolicated stack, neither a hook before symbolication nor an implementation in `symbolicator.customizeFrame` are sufficient to be able to apply this logic. This diff creates the new hook, which allows for mutations of the entire symbolicated stack via a `symbolicator.customizeStack` hook. The default implementation of this simply returns the same stack, but it can be wrapped similar to `symbolicator.customizeFrame`. To actually have information for this hook to act on, I've created the possibility to send additional data to the metro `/symbolicate` endpoint via an `extraData` object. This mirrors the `extraData` from https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/NativeExceptionsManager.js#L33, and I've wired up LogBox to send that object along with the symbolicate call. Changelog: [General][Added] - Added customizeStack hook to Metro's `/symbolicate` endpoint to allow custom frame skipping logic on a stack level. Reviewed By: motiz88 Differential Revision: D44257733 fbshipit-source-id: 3faa0145f4f362cf75692fb1fb2eab1ed4ce41dd
This pull request was exported from Phabricator. Differential Revision: D44257733 |
GijsWeterings
force-pushed
the
export-D44257733
branch
from
April 5, 2023 16:02
e12f0a0
to
784c655
Compare
GijsWeterings
added a commit
to GijsWeterings/react-native
that referenced
this pull request
Apr 5, 2023
Summary: Pull Request resolved: facebook#36819 X-link: facebook/metro#964 This diff creates a new hook to the Metro symbolicator. `customizeStack` aims to provide a whole stack modification hook on the output of the `/symbolicate` endpoint. The purpose of this hook is to be able to apply callsite-based modifications to the stack trace. One such example is user-facing frame skipping APIs like FBLogger internally. Consider the following API: ``` FBLogger('my_project') .blameToPreviousFile() .mustfix( 'This error should refer to the callsite of this method', ); ``` In this particular case, we'd want to skip all frames from the top that come from the same source file. To do that, we need knowledge of the entire symbolicated stack, neither a hook before symbolication nor an implementation in `symbolicator.customizeFrame` are sufficient to be able to apply this logic. This diff creates the new hook, which allows for mutations of the entire symbolicated stack via a `symbolicator.customizeStack` hook. The default implementation of this simply returns the same stack, but it can be wrapped similar to `symbolicator.customizeFrame`. To actually have information for this hook to act on, I've created the possibility to send additional data to the metro `/symbolicate` endpoint via an `extraData` object. This mirrors the `extraData` from https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/NativeExceptionsManager.js#L33, and I've wired up LogBox to send that object along with the symbolicate call. Changelog: [General][Added] - Added customizeStack hook to Metro's `/symbolicate` endpoint to allow custom frame skipping logic on a stack level. Reviewed By: motiz88 Differential Revision: D44257733 fbshipit-source-id: 526146fb57275e145a8b61a7bf26e48fdfe80223
GijsWeterings
added a commit
to GijsWeterings/metro
that referenced
this pull request
Apr 6, 2023
Summary: X-link: facebook/react-native#36819 Pull Request resolved: facebook#964 This diff creates a new hook to the Metro symbolicator. `customizeStack` aims to provide a whole stack modification hook on the output of the `/symbolicate` endpoint. The purpose of this hook is to be able to apply callsite-based modifications to the stack trace. One such example is user-facing frame skipping APIs like FBLogger internally. Consider the following API: ``` FBLogger('my_project') .blameToPreviousFile() .mustfix( 'This error should refer to the callsite of this method', ); ``` In this particular case, we'd want to skip all frames from the top that come from the same source file. To do that, we need knowledge of the entire symbolicated stack, neither a hook before symbolication nor an implementation in `symbolicator.customizeFrame` are sufficient to be able to apply this logic. This diff creates the new hook, which allows for mutations of the entire symbolicated stack via a `symbolicator.customizeStack` hook. The default implementation of this simply returns the same stack, but it can be wrapped similar to `symbolicator.customizeFrame`. To actually have information for this hook to act on, I've created the possibility to send additional data to the metro `/symbolicate` endpoint via an `extraData` object. This mirrors the `extraData` from https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/NativeExceptionsManager.js#L33, and I've wired up LogBox to send that object along with the symbolicate call. Changelog: [General][Added] - Added customizeStack hook to Metro's `/symbolicate` endpoint to allow custom frame skipping logic on a stack level. Reviewed By: motiz88 Differential Revision: D44257733 fbshipit-source-id: ee107fb7238dda19b5cdc292ade9c045fbefc530
GijsWeterings
force-pushed
the
export-D44257733
branch
from
April 6, 2023 12:28
784c655
to
b67f26f
Compare
This pull request was exported from Phabricator. Differential Revision: D44257733 |
GijsWeterings
added a commit
to GijsWeterings/react-native
that referenced
this pull request
Apr 6, 2023
Summary: Pull Request resolved: facebook#36819 X-link: facebook/metro#964 This diff creates a new hook to the Metro symbolicator. `customizeStack` aims to provide a whole stack modification hook on the output of the `/symbolicate` endpoint. The purpose of this hook is to be able to apply callsite-based modifications to the stack trace. One such example is user-facing frame skipping APIs like FBLogger internally. Consider the following API: ``` FBLogger('my_project') .blameToPreviousFile() .mustfix( 'This error should refer to the callsite of this method', ); ``` In this particular case, we'd want to skip all frames from the top that come from the same source file. To do that, we need knowledge of the entire symbolicated stack, neither a hook before symbolication nor an implementation in `symbolicator.customizeFrame` are sufficient to be able to apply this logic. This diff creates the new hook, which allows for mutations of the entire symbolicated stack via a `symbolicator.customizeStack` hook. The default implementation of this simply returns the same stack, but it can be wrapped similar to `symbolicator.customizeFrame`. To actually have information for this hook to act on, I've created the possibility to send additional data to the metro `/symbolicate` endpoint via an `extraData` object. This mirrors the `extraData` from https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/NativeExceptionsManager.js#L33, and I've wired up LogBox to send that object along with the symbolicate call. Changelog: [General][Added] - Added customizeStack hook to Metro's `/symbolicate` endpoint to allow custom frame skipping logic on a stack level. Reviewed By: motiz88 Differential Revision: D44257733 fbshipit-source-id: 33facc19adedda890ebec16a26e8cd8afb814a54
Summary: X-link: facebook/react-native#36819 Pull Request resolved: facebook#964 This diff creates a new hook to the Metro symbolicator. `customizeStack` aims to provide a whole stack modification hook on the output of the `/symbolicate` endpoint. The purpose of this hook is to be able to apply callsite-based modifications to the stack trace. One such example is user-facing frame skipping APIs like FBLogger internally. Consider the following API: ``` FBLogger('my_project') .blameToPreviousFile() .mustfix( 'This error should refer to the callsite of this method', ); ``` In this particular case, we'd want to skip all frames from the top that come from the same source file. To do that, we need knowledge of the entire symbolicated stack, neither a hook before symbolication nor an implementation in `symbolicator.customizeFrame` are sufficient to be able to apply this logic. This diff creates the new hook, which allows for mutations of the entire symbolicated stack via a `symbolicator.customizeStack` hook. The default implementation of this simply returns the same stack, but it can be wrapped similar to `symbolicator.customizeFrame`. To actually have information for this hook to act on, I've created the possibility to send additional data to the metro `/symbolicate` endpoint via an `extraData` object. This mirrors the `extraData` from https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/NativeExceptionsManager.js#L33, and I've wired up LogBox to send that object along with the symbolicate call. Changelog: [General][Added] - Added customizeStack hook to Metro's `/symbolicate` endpoint to allow custom frame skipping logic on a stack level. Reviewed By: motiz88 Differential Revision: D44257733 fbshipit-source-id: fec3f576fb424fb3231f28c0391f587a276e709e
This pull request was exported from Phabricator. Differential Revision: D44257733 |
GijsWeterings
force-pushed
the
export-D44257733
branch
from
April 6, 2023 16:23
b67f26f
to
b617e1d
Compare
GijsWeterings
added a commit
to GijsWeterings/react-native
that referenced
this pull request
Apr 6, 2023
Summary: Pull Request resolved: facebook#36819 X-link: facebook/metro#964 This diff creates a new hook to the Metro symbolicator. `customizeStack` aims to provide a whole stack modification hook on the output of the `/symbolicate` endpoint. The purpose of this hook is to be able to apply callsite-based modifications to the stack trace. One such example is user-facing frame skipping APIs like FBLogger internally. Consider the following API: ``` FBLogger('my_project') .blameToPreviousFile() .mustfix( 'This error should refer to the callsite of this method', ); ``` In this particular case, we'd want to skip all frames from the top that come from the same source file. To do that, we need knowledge of the entire symbolicated stack, neither a hook before symbolication nor an implementation in `symbolicator.customizeFrame` are sufficient to be able to apply this logic. This diff creates the new hook, which allows for mutations of the entire symbolicated stack via a `symbolicator.customizeStack` hook. The default implementation of this simply returns the same stack, but it can be wrapped similar to `symbolicator.customizeFrame`. To actually have information for this hook to act on, I've created the possibility to send additional data to the metro `/symbolicate` endpoint via an `extraData` object. This mirrors the `extraData` from https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/NativeExceptionsManager.js#L33, and I've wired up LogBox to send that object along with the symbolicate call. Changelog: [General][Added] - Added customizeStack hook to Metro's `/symbolicate` endpoint to allow custom frame skipping logic on a stack level. Reviewed By: motiz88 Differential Revision: D44257733 fbshipit-source-id: 0e54cac365750d4092e89dd6a54878bbd3a6a1be
This pull request has been merged in ce266dd. |
facebook-github-bot
pushed a commit
to facebook/react-native
that referenced
this pull request
Apr 6, 2023
Summary: Pull Request resolved: #36819 X-link: facebook/metro#964 This diff creates a new hook to the Metro symbolicator. `customizeStack` aims to provide a whole stack modification hook on the output of the `/symbolicate` endpoint. The purpose of this hook is to be able to apply callsite-based modifications to the stack trace. One such example is user-facing frame skipping APIs like FBLogger internally. Consider the following API: ``` FBLogger('my_project') .blameToPreviousFile() .mustfix( 'This error should refer to the callsite of this method', ); ``` In this particular case, we'd want to skip all frames from the top that come from the same source file. To do that, we need knowledge of the entire symbolicated stack, neither a hook before symbolication nor an implementation in `symbolicator.customizeFrame` are sufficient to be able to apply this logic. This diff creates the new hook, which allows for mutations of the entire symbolicated stack via a `symbolicator.customizeStack` hook. The default implementation of this simply returns the same stack, but it can be wrapped similar to `symbolicator.customizeFrame`. To actually have information for this hook to act on, I've created the possibility to send additional data to the metro `/symbolicate` endpoint via an `extraData` object. This mirrors the `extraData` from https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/NativeExceptionsManager.js#L33, and I've wired up LogBox to send that object along with the symbolicate call. Changelog: [General][Added] - Added customizeStack hook to Metro's `/symbolicate` endpoint to allow custom frame skipping logic on a stack level. Reviewed By: motiz88 Differential Revision: D44257733 fbshipit-source-id: 05cd57f5917a1e97b0520e772692ce64029fbf8a
jeongshin
pushed a commit
to jeongshin/react-native
that referenced
this pull request
May 7, 2023
Summary: Pull Request resolved: facebook#36819 X-link: facebook/metro#964 This diff creates a new hook to the Metro symbolicator. `customizeStack` aims to provide a whole stack modification hook on the output of the `/symbolicate` endpoint. The purpose of this hook is to be able to apply callsite-based modifications to the stack trace. One such example is user-facing frame skipping APIs like FBLogger internally. Consider the following API: ``` FBLogger('my_project') .blameToPreviousFile() .mustfix( 'This error should refer to the callsite of this method', ); ``` In this particular case, we'd want to skip all frames from the top that come from the same source file. To do that, we need knowledge of the entire symbolicated stack, neither a hook before symbolication nor an implementation in `symbolicator.customizeFrame` are sufficient to be able to apply this logic. This diff creates the new hook, which allows for mutations of the entire symbolicated stack via a `symbolicator.customizeStack` hook. The default implementation of this simply returns the same stack, but it can be wrapped similar to `symbolicator.customizeFrame`. To actually have information for this hook to act on, I've created the possibility to send additional data to the metro `/symbolicate` endpoint via an `extraData` object. This mirrors the `extraData` from https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/NativeExceptionsManager.js#L33, and I've wired up LogBox to send that object along with the symbolicate call. Changelog: [General][Added] - Added customizeStack hook to Metro's `/symbolicate` endpoint to allow custom frame skipping logic on a stack level. Reviewed By: motiz88 Differential Revision: D44257733 fbshipit-source-id: 05cd57f5917a1e97b0520e772692ce64029fbf8a
OlimpiaZurek
pushed a commit
to OlimpiaZurek/react-native
that referenced
this pull request
May 22, 2023
Summary: Pull Request resolved: facebook#36819 X-link: facebook/metro#964 This diff creates a new hook to the Metro symbolicator. `customizeStack` aims to provide a whole stack modification hook on the output of the `/symbolicate` endpoint. The purpose of this hook is to be able to apply callsite-based modifications to the stack trace. One such example is user-facing frame skipping APIs like FBLogger internally. Consider the following API: ``` FBLogger('my_project') .blameToPreviousFile() .mustfix( 'This error should refer to the callsite of this method', ); ``` In this particular case, we'd want to skip all frames from the top that come from the same source file. To do that, we need knowledge of the entire symbolicated stack, neither a hook before symbolication nor an implementation in `symbolicator.customizeFrame` are sufficient to be able to apply this logic. This diff creates the new hook, which allows for mutations of the entire symbolicated stack via a `symbolicator.customizeStack` hook. The default implementation of this simply returns the same stack, but it can be wrapped similar to `symbolicator.customizeFrame`. To actually have information for this hook to act on, I've created the possibility to send additional data to the metro `/symbolicate` endpoint via an `extraData` object. This mirrors the `extraData` from https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/NativeExceptionsManager.js#L33, and I've wired up LogBox to send that object along with the symbolicate call. Changelog: [General][Added] - Added customizeStack hook to Metro's `/symbolicate` endpoint to allow custom frame skipping logic on a stack level. Reviewed By: motiz88 Differential Revision: D44257733 fbshipit-source-id: 05cd57f5917a1e97b0520e772692ce64029fbf8a
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
Merged
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.
Summary:
This diff creates a new hook to the Metro symbolicator.
customizeStack
aims to provide a whole stack modification hook on the output of the/symbolicate
endpoint.The purpose of this hook is to be able to apply callsite-based modifications to the stack trace. One such example is user-facing frame skipping APIs like FBLogger internally.
Consider the following API:
In this particular case, we'd want to skip all frames from the top that come from the same source file. To do that, we need knowledge of the entire symbolicated stack, neither a hook before symbolication nor an implementation in
symbolicator.customizeFrame
are sufficient to be able to apply this logic.This diff creates the new hook, which allows for mutations of the entire symbolicated stack via a
symbolicator.customizeStack
hook. The default implementation of this simply returns the same stack, but it can be wrapped similar tosymbolicator.customizeFrame
.To actually have information for this hook to act on, I've created the possibility to send additional data to the metro
/symbolicate
endpoint via anextraData
object. This mirrors theextraData
from https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/NativeExceptionsManager.js#L33, and I've wired up LogBox to send that object along with the symbolicate call.Changelog:
[General][Added] - Added customizeStack hook to Metro's
/symbolicate
endpoint to allow custom frame skipping logic on a stack level.Reviewed By: motiz88
Differential Revision: D44257733