Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

React 19.1 captureOwnerStack #146

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

Open
Freddy03h wants to merge 5 commits into rescript-lang:master
base: master
Choose a base branch
Loading
from Freddy03h:captureOwnerStack

Conversation

@Freddy03h
Copy link
Collaborator

@Freddy03h Freddy03h commented Oct 17, 2025

It seems capureOwnerStack is the only new API in React 19.1 : https://github.com/facebook/react/releases/tag/v19.1.0

📖 captureOwnerStack Documentation

Maybe it's possible to have a release for 19.1 before working on React 19.2 new APIs

src/React.res Outdated
external act: (unit => promise<unit>) => promise<unit> = "act"

@module("react")
external captureOwnerStack: unit => Js.nullable<string> = "captureOwnerStack"
Copy link
Member

@tsnobip tsnobip Oct 31, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understood the API, it should return null or string, so either use a @return or Null.t.

Copy link
Collaborator Author

@Freddy03h Freddy03h Oct 31, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know this decorator, thanks!

external act: (unit => promise<unit>) => promise<unit> = "act"

@module("react") @return(nullable)
external captureOwnerStack: unit => option<string> = "captureOwnerStack"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: add a doc comment with link to https://react.dev/reference/react/captureOwnerStack

tsnobip reacted with thumbs up emoji
Copy link
Collaborator Author

@Freddy03h Freddy03h Nov 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to format it? I don't see any other comment with link to the react doc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't mean you shouldn't add it.
Try something like /** url */

src/React.res Outdated
@module("react")
external act: (unit => promise<unit>) => promise<unit> = "act"

@module("react") @return(nullable)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually @return(null_to_opt) would make the intention clearer as the API can only return string or null according to the docs (but not undefined).

Freddy03h reacted with thumbs up emoji
Copy link
Collaborator Author

Sorry for the delay, I updated the PR.

Copy link
Collaborator Author

Hi @cknitt,
Should I merge this PR now, or do you want to make a release with only ReScript 12 first?
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tsnobip tsnobip tsnobip left review comments

@nojaf nojaf nojaf approved these changes

@cknitt cknitt Awaiting requested review from cknitt

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /