Skip to content

Preserve jsx with custom module #7577

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nojaf
Copy link
Collaborator

@nojaf nojaf commented Jun 26, 2025

It was mentioned on the forum that -bs-jsx-preserve doesn't work in combination with -bs-jsx-module.

Sample to reproduce:

dune exec bsc -- ./tests/tests/src/jsx_preserve_custom_module.res       

@cristianoc PPX seems fine, and I believe the information gets lost before reaching js_dump.
Would you have any guess what is different for this code path?

Copy link

pkg-pr-new bot commented Jun 26, 2025

Open in StackBlitz

rescript

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

@rescript/darwin-arm64

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

@rescript/darwin-x64

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

@rescript/linux-arm64

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

@rescript/linux-x64

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

@rescript/win32-x64

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

commit: 6de73df

@cknitt cknitt added this to the v12.1 milestone Jul 3, 2025
@cknitt cknitt requested a review from cristianoc July 3, 2025 09:22
@nojaf
Copy link
Collaborator Author

nojaf commented Jul 3, 2025

Original reported via https://github.com/Fattafatta/rescript-v12-test

@cristianoc
Copy link
Collaborator

@nojaf could this be involved?

        let element_binding =
          match config.module_ |> String.lowercase_ascii with
          | "react" -> Lident "ReactDOM"
          | _generic -> module_access_name config "Elements"
        in

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