Skip to content

Update TypeScript types for Libraries/Core/Devtools to match implementation#43566

Closed
kraenhansen wants to merge 3 commits into
react:mainfrom
kraenhansen:patch-2
Closed

Update TypeScript types for Libraries/Core/Devtools to match implementation#43566
kraenhansen wants to merge 3 commits into
react:mainfrom
kraenhansen:patch-2

Conversation

@kraenhansen

@kraenhansen kraenhansen commented Mar 20, 2024

Copy link
Copy Markdown
Contributor

Summary:

The parseErrorStack function takes the stack as a string, as its only argument, not the Error: https://github.com/facebook/react-native/blob/ce4d8f2756841e1226cb1c773026413b63abdf85/packages/react-native/Libraries/Core/Devtools/parseErrorStack.js#L41

The symbolicateStackTrace returns a promise of an object containing a codeFrame and stack, not an array of frames:

https://github.com/facebook/react-native/blob/ce4d8f2756841e1226cb1c773026413b63abdf85/packages/react-native/Libraries/Core/Devtools/symbolicateStackTrace.js#L17-L30

Changelog:

[GENERAL] [FIXED] - Fixed TypeScript type of the parseErrorStack and symbolicateStackTrace functions to match their implementation.

Test Plan:

I patched the file locally and tested function to ensure its callable with a string.

@facebook-github-bot 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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Mar 20, 2024
@kraenhansen kraenhansen changed the title Update TypeScript types for parseErrorStack to match its implementation Update TypeScript types for Libraries/Core/Devtools to match implementation Mar 20, 2024
@react-native-bot

Copy link
Copy Markdown
Collaborator

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@react-native-bot react-native-bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Sep 17, 2024
@kraenhansen

Copy link
Copy Markdown
Contributor Author

I believe this is still relevant.

@react-native-bot react-native-bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Sep 18, 2024
facebook-github-bot pushed a commit that referenced this pull request Jun 2, 2025
Summary:
- This is similar to #43566, but include also updated `StackFrame` type.

The current `Devtools.d.ts` doesn't match the `parseErrorStack.js` and `symbolicateStackTrace.js` implementations.

I've tried to run `build-types`, but only `symbolicateStackTrace.d.ts` was generated. I've not checked why.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL] [FIXED] - Devtools TS Types

Pull Request resolved: #51737

Test Plan: Call `parseErrorStack` and `symbolicateStackTrace` in TS.

Reviewed By: rshest

Differential Revision: D75782013

Pulled By: huntie

fbshipit-source-id: 91fe560f079731af2a5834c8de8eafb723d00bf9
@react-native-bot

Copy link
Copy Markdown
Collaborator

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@react-native-bot react-native-bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 14, 2025
@kraenhansen

Copy link
Copy Markdown
Contributor Author

Needs a rebase, but the still seem wrong on main if the implementation wasn't adjusted since.

@react-native-bot react-native-bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 19, 2025
@react-native-bot

Copy link
Copy Markdown
Collaborator

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@react-native-bot react-native-bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 15, 2026
@kraenhansen

Copy link
Copy Markdown
Contributor Author

Same as before - still relevant.

@react-native-bot react-native-bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 17, 2026
@meta-codesync

meta-codesync Bot commented Jul 7, 2026

Copy link
Copy Markdown

@huntie has imported this pull request. If you are a Meta employee, you can view this in D110879262.

@huntie

huntie commented Jul 7, 2026

Copy link
Copy Markdown
Member

Sorry we totally missed this. Landing now.

@huntie

huntie commented Jul 8, 2026

Copy link
Copy Markdown
Member

Ah, merged already via #51737.

@huntie huntie closed this Jul 8, 2026
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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants