Skip to content

Commit 57121b2

Browse files
authored
Propagate JSX settings to dependencies (#7094)
* add build test for inhert the jsx settings * fix to inhert jsx settings to deps * change log * fix test
1 parent 44e9786 commit 57121b2

File tree

20 files changed

+1635
-0
lines changed

20 files changed

+1635
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
- Fix "rescript format" with many files. https://github.com/rescript-lang/rescript-compiler/pull/7081
3333
- Fix bigint max, min https://github.com/rescript-lang/rescript-compiler/pull/7088
3434
- Fix parsing issue with nested variant pattern type spreads. https://github.com/rescript-lang/rescript-compiler/pull/7080
35+
- Fix JSX settings inheritance: only 'version' propagates to dependencies, preserving their 'mode' and 'module'. https://github.com/rescript-lang/rescript-compiler/pull/7094
3536

3637
#### :nail_care: Polish
3738

compiler/bsb/bsb_config_parse.ml

+6
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,12 @@ let interpret_json ~(filename : string) ~(json : Ext_json_types.t)
261261
in
262262
let bsc_flags = extract_string_list map Bsb_build_schemas.bsc_flags in
263263
let jsx = Bsb_jsx.from_map map in
264+
let jsx, bsc_flags =
265+
match package_kind with
266+
| Pinned_dependency x | Dependency x ->
267+
({jsx with version = x.jsx.version}, bsc_flags)
268+
| Toplevel -> (jsx, bsc_flags)
269+
in
264270
{
265271
pinned_dependencies;
266272
gentype_config;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
!node_modules
2+
node_modules/**/lib
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@ts-check
2+
var cp = require("child_process");
3+
var { rescript_exe } = require("#cli/bin_path");
4+
5+
cp.execSync(rescript_exe, { cwd: __dirname });

tests/build_tests/jsx_settings_inheritance/node_modules/@rescript/react/rescript.json

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/build_tests/jsx_settings_inheritance/node_modules/@rescript/react/src/React.mjs

+34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)