Skip to content

Fix invalid JSX being generated for empty fragments - #8077

Merged
cknitt merged 4 commits into
rescript-lang:masterfrom
cknitt:fix-empty-fragments
Dec 9, 2025
Merged

cknitt merged 4 commits into
rescript-lang:masterfrom
cknitt:fix-empty-fragments

Conversation

@cknitt

@cknitt cknitt commented Dec 9, 2025

Copy link
Copy Markdown
Member

Fixes #8076

Comment thread compiler/core/js_dump.ml Resolved
@pkg-pr-new

pkg-pr-new Bot commented Dec 9, 2025 •

Copy link
Copy Markdown

Open in StackBlitz

rescript

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

@rescript/darwin-arm64

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

@rescript/darwin-x64

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

@rescript/linux-arm64

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

@rescript/linux-x64

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

@rescript/runtime

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

@rescript/win32-x64

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

commit: 5a55f16

@cknitt
cknitt requested review from cristianoc and nojaf December 9, 2025 10:45
Comment thread compiler/core/js_dump.ml
assuming "JsxRuntime". *)
let is_fragment =
match tag.expression_desc with
| J.Var (J.Qualified ({id = {name = "JsxRuntime"}}, Some "Fragment")) ->

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

pre-existing, but this is terrible
is there at least a file where all the "interesting" jsx preserve mode things like this are collected?
So one at least knows where to look?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't know of such a file or if there are more similar problems.

I can create an issue for tracking this though.

@cknitt
cknitt force-pushed the fix-empty-fragments branch from 0af7536 to 5a55f16 Compare December 9, 2025 13:29
@cknitt
cknitt merged commit 034e254 into rescript-lang:master Dec 9, 2025
@cknitt
cknitt deleted the fix-empty-fragments branch December 9, 2025 14:48
aspeddro pushed a commit to aspeddro/rescript-compiler that referenced this pull request Oct 31, 2026
* Fix invalid JSX being generated for empty fragments

* Reduce code duplication

* Added TODO

* CHANGELOG

Signed-off-by: Pedro Castro <aspeddro@gmail.com>
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.

invalid JSX generated in preserve JSX mode

3 participants