-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Extend earlyjs c++ pipeline for soft errors #46893
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
Conversation
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
Summary: Before, the c++ pipeline only supported fatal errors. Now, it supports soft errors! Changelog: [Internal] Reviewed By: javache Differential Revision: D63927090
f89965e to
08cbe04
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
08cbe04 to
1bb96e8
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
1bb96e8 to
82dece9
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
82dece9 to
2c8782a
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
2c8782a to
a530e02
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
a530e02 to
416211b
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
416211b to
de32a02
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
de32a02 to
7828fd0
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
7828fd0 to
fc1c4eb
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
Summary: Before, the c++ pipeline only supported fatal errors. Now, it supports soft errors! Changelog: [Internal] Reviewed By: javache Differential Revision: D63927090
bd79484 to
1d9b94e
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
Summary: Before, the c++ pipeline only supported fatal errors. Now, it supports soft errors! Changelog: [Internal] Reviewed By: javache Differential Revision: D63927090
1d9b94e to
c53a300
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
e37ee5a to
3ec51e2
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
3ec51e2 to
fd77fde
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
fd77fde to
03e2acb
Compare
Summary: Before, the c++ pipeline only supported fatal errors. Now, it supports soft errors! Changelog: [Internal] Reviewed By: javache Differential Revision: D63927090
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
03e2acb to
e800df7
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
e800df7 to
c143dff
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
Summary: Before, the c++ pipeline only supported fatal errors. Now, it supports soft errors! Changelog: [Internal] Reviewed By: javache Differential Revision: D63927090
c143dff to
fafb0da
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
fafb0da to
3a8af84
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
3a8af84 to
0caf1a7
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
Summary: For the js error handling pipeline, the javascript data structure looks like [this](https://www.internalfb.com/code/fbsource/[6181b57f4ba3619f58056bcec65382650d6ff59a]/xplat/js/react-native-github/packages/react-native/src/private/specs/modules/NativeExceptionsManager.js?lines=17-35): ``` export type StackFrame = {| column: ?number, file: ?string, lineNumber: ?number, methodName: string, collapse?: boolean, |}; export type ExceptionData = { message: string, originalMessage: ?string, name: ?string, componentStack: ?string, stack: Array<StackFrame>, id: number, isFatal: boolean, // flowlint-next-line unclear-type:off extraData?: Object, ... }; ``` So, I made the c++ data structure look similar ``` struct ParsedError { struct StackFrame { std::optional<std::string> file; std::string methodName; std::optional<int> lineNumber; std::optional<int> column; }; std::string message; std::optional<std::string> originalMessage; std::optional<std::string> name; std::optional<std::string> componentStack; std::vector<StackFrame> stack; int id; bool isFatal; jsi::Object extraData; }; ``` Notes: * [parseErrorStack](https://fburl.com/code/e27q9gkc) doesn't actually generate a collapse property on the error object. So, I omitted it from the c++. * ExceptionsManager [always provides an extraData field](https://fburl.com/code/2bvcsxac). So, I made it required. * In C++, I just stored extraData as a jsi::Object. I wanted the freedom to store arbitrary key/value pairs. But, I also didn't want to use folly::dynamic. Changelog: [Internal] Differential Revision: D63929580
Summary: This diff re-implements [js error stack trace parsing](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseErrorStack.js#L41-L57) in c++. Details: - I migrated [stacktrace-parser](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/src/stack-trace-parser.js#L7) - I migrated [parseHermesStack.js](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/parseHermesStack.js#L82) I also migrated all their tests to c++: - [stacktrace-parser tests](https://github.com/errwischt/stacktrace-parser/blob/ad379de5e5ac056012bbeb12923cf502aefe4710/test/stack-trace-parser.spec.js#L5) - [parseHermesStack tests](https://github.com/facebook/react-native/blob/86cac6836502aaeb5c894bff6427e837c52c09e0/packages/react-native/Libraries/Core/Devtools/__tests__/parseHermesStack-test.js#L16) Changelog: [Internal] Reviewed By: javache, NickGerleman Differential Revision: D63659013
Summary: Before, the c++ pipeline only supported fatal errors. Now, it supports soft errors! Changelog: [Internal] Reviewed By: javache Differential Revision: D63927090
0caf1a7 to
6c3cadf
Compare
|
This pull request was exported from Phabricator. Differential Revision: D63927090 |
|
This pull request has been merged in 509abff. |
Summary:
Before, the c++ pipeline only supported fatal errors.
Now, it supports soft errors!
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D63927090