Skip to content

Make Jsx.element a private empty record to avoid unnecessary Primitive_option.some #7450

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

Merged
merged 7 commits into from
May 9, 2025

Conversation

cknitt
Copy link
Member

@cknitt cknitt commented May 9, 2025

Implement @glennsl's idea from #7430 (comment)

(And update the ancient React bindings in the tests.)

@cknitt cknitt force-pushed the jsx-element-private-empty-record branch from e36f9ff to 0b93205 Compare May 9, 2025 09:52
Copy link

pkg-pr-new bot commented May 9, 2025

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@7450

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@7450

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@7450

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@7450

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@7450

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@7450

commit: af98928

@cknitt
Copy link
Member Author

cknitt commented May 9, 2025

Also tested successfully against a real-world project.

Goodbye, Primitive_option.some (for React elements)! 🎉

@cknitt cknitt requested review from zth and nojaf May 9, 2025 11:04
Copy link
Collaborator

@nojaf nojaf left a comment

Choose a reason for hiding this comment

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

I believe this is fine, but I need a better understanding of the consequences of this change.

@cknitt cknitt force-pushed the jsx-element-private-empty-record branch from ed244b0 to af98928 Compare May 9, 2025 14:04
@cknitt cknitt merged commit 27a9c94 into master May 9, 2025
21 checks passed
@cknitt cknitt deleted the jsx-element-private-empty-record branch May 9, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants