Skip to content
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 @@ -24,6 +24,7 @@
- Show `Stdlib.Null` and `Stdlib.Nullable` completions for `Stdlib.null<'a>` and `Stdlib.nullable<'a>` types, respectively. https://github.com/rescript-lang/rescript/pull/7826
- Fix generation of interfaces for module types containing multiple type constraints. https://github.com/rescript-lang/rescript/pull/7825
- JSX preserve mode: fix "make is not a valid component name". https://github.com/rescript-lang/rescript/pull/7831
- Rewatch: include parser arguments of experimental features. https://github.com/rescript-lang/rescript/pull/7836

#### :memo: Documentation

Expand Down
2 changes: 2 additions & 0 deletions rewatch/src/build/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ pub fn parser_args(
let jsx_module_args = root_config.get_jsx_module_args();
let jsx_mode_args = root_config.get_jsx_mode_args();
let jsx_preserve_args = root_config.get_jsx_preserve_args();
let experimental_features_args = root_config.get_experimental_features_args();
let bsc_flags = config::flatten_flags(&package_config.compiler_flags);

let file = PathBuf::from("..").join("..").join(file);
Expand All @@ -265,6 +266,7 @@ pub fn parser_args(
jsx_module_args,
jsx_mode_args,
jsx_preserve_args,
experimental_features_args,
bsc_flags,
vec![
"-absname".to_string(),
Expand Down
3 changes: 1 addition & 2 deletions rewatch/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,7 @@ impl<'de> serde::Deserialize<'de> for ExperimentalFeature {
other => {
let available = ["LetUnwrap"].join(", ");
Err(DeError::custom(format!(
"Unknown experimental feature '{}'. Available features: {}",
other, available
"Unknown experimental feature '{other}'. Available features: {available}",
)))
}
}
Expand Down
12 changes: 7 additions & 5 deletions rewatch/tests/experimental.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,18 @@ if [ $? -ne 0 ]; then
exit 1
fi

# Expect repeated string-list style: presence of -enable-experimental and LetUnwrap entries
echo "$stdout" | grep -q '"-enable-experimental"' && echo "$stdout" | grep -q '"LetUnwrap"'
if [ $? -ne 0 ]; then
# Expect repeated string-list style: two "-enable-experimental" entries and "LetUnwrap" present
enable_count=$(echo "$stdout" | grep -o '"-enable-experimental"' | wc -l | xargs)
echo "$stdout" | grep -q '"LetUnwrap"'
letunwrap_ok=$?
if [ "$enable_count" -ne 2 ] || [ $letunwrap_ok -ne 0 ]; then
mv rescript.json.bak rescript.json
error "-enable-experimental / LetUnwrap not found in compiler-args output"
error "Expected two occurrences of -enable-experimental and presence of LetUnwrap in compiler-args output"
echo "$stdout"
exit 1
fi

# Restore original rescript.json
mv rescript.json.bak rescript.json

success "experimentalFeatures emits -enable-experimental as string list"
success "experimentalFeatures emits -enable-experimental twice as string list"
Loading