Skip to content

Propagate JSX settings to dependencies #7094

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 4 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
- Fix "rescript format" with many files. https://github.com/rescript-lang/rescript-compiler/pull/7081
- Fix bigint max, min https://github.com/rescript-lang/rescript-compiler/pull/7088
- Fix parsing issue with nested variant pattern type spreads. https://github.com/rescript-lang/rescript-compiler/pull/7080
- Fix JSX settings inheritance: only 'version' propagates to dependencies, preserving their 'mode' and 'module'. https://github.com/rescript-lang/rescript-compiler/pull/7094

#### :nail_care: Polish

Expand Down
6 changes: 6 additions & 0 deletions compiler/bsb/bsb_config_parse.ml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,12 @@ let interpret_json ~(filename : string) ~(json : Ext_json_types.t)
in
let bsc_flags = extract_string_list map Bsb_build_schemas.bsc_flags in
let jsx = Bsb_jsx.from_map map in
let jsx, bsc_flags =
match package_kind with
| Pinned_dependency x | Dependency x ->
({jsx with version = x.jsx.version}, bsc_flags)
| Toplevel -> (jsx, bsc_flags)
in
{
pinned_dependencies;
gentype_config;
Expand Down
2 changes: 2 additions & 0 deletions tests/build_tests/jsx_settings_inheritance/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!node_modules
node_modules/**/lib
5 changes: 5 additions & 0 deletions tests/build_tests/jsx_settings_inheritance/input.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//@ts-check
var cp = require("child_process");
var { rescript_exe } = require("#cli/bin_path");

cp.execSync(rescript_exe, { cwd: __dirname });

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading