Skip to content

Commit 1711a6a

Browse files
authored
Merge pull request #5065 from rescript-lang/9.1.rebase
cherry pick changes in release branch && add changes log
2 parents 2a2a122 + 79cd888 commit 1711a6a

21 files changed

+136
-85
lines changed

Changes.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
11
`*` means potential break changes
22

3+
# 9.1
4+
5+
- #5014 #5063 #5027 the new ReScript CLI interface
6+
Thew new CLI is self explainatory:
7+
```
8+
rescript -h
9+
Available flags
10+
-v, -version display version number
11+
-h, -help display help
12+
Subcommands:
13+
build
14+
clean
15+
format
16+
convert
17+
help
18+
Run rescript subcommand -h for more details,
19+
For example:
20+
rescript build -h
21+
rescript format -h
22+
```
23+
24+
- #5025 in place format support, this is subsumed into `rescript format` subcommand
25+
- #5060 #5055
26+
Add formatting support for stdin/sdout
27+
- #5053 #5050 clean up structural object semantics
28+
- #5037
29+
Allows coercion from nullary types to int/string.
30+
This applies to collections types too
31+
- #5029
32+
int polyvar is compiled into int.
33+
`#0` is the same as 0 except it is structually typed as `#0`
34+
- #5023 generate interface file in rescript syntax by default
35+
- #5021 makes int64 runtime payload small for just comparison
36+
- #5019, #5017, #5016, #5015, #5010 improve error message
37+
- #5008 don't trigger a rebuild if mjs file changes, fix an infinite loop in watch mode
38+
- #5005 not depending on Format for Arg module, smaller size
39+
- #4985 fix the schema of bsb on `dev` property
40+
- #4967 #4986, #4984, #4971, #4972, #4969 Breaking changes
41+
Remove ocaml style classes while structural objects and structural typings are simplified. Js.t is no longer needed. If user does not know
42+
what ocaml style class is, this should not affect him.
43+
44+
345
# 9.0.2
446

547
- #4990 Fix an optimization bug introduced in 9.0

jscomp/artifacts.json

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,32 @@
77
"bsrefmt",
88
"COPYING",
99
"LICENSE",
10-
"4061.json",
10+
"rescript",
1111
"bsconfig.json",
12-
"bspack.json",
13-
"esy.json",
1412
"package.json",
1513
"COPYING.LESSER",
1614
"Changes.md",
1715
"CONTRIBUTING.md",
16+
"Credits.md",
1817
"DCO.md",
1918
"README.md",
2019
".istanbul.yml"
2120
],
2221
"darwin": [
22+
"bsc.byte",
2323
"ninja.COPYING",
2424
"bsb_helper.exe",
2525
"bsb.exe",
2626
"bsc.exe",
2727
"ninja.exe",
28-
"refmt.exe"
28+
"refmt.exe",
29+
"rescript.exe"
2930
],
3031
"docs/docson": [
3132
"LICENSE",
3233
"build-schema.json",
3334
"README.md"
3435
],
35-
"esy.lock": [
36-
".gitattributes",
37-
".gitignore",
38-
"index.json"
39-
],
4036
"freebsd": [
4137
"ninja.COPYING"
4238
],
@@ -53,10 +49,12 @@
5349
"bsb_helper.ml",
5450
"bsb.ml",
5551
"refmt_main3.ml",
52+
"rescript.ml",
5653
"whole_compiler.ml",
5754
"bsb_helper.mli",
5855
"bsb.mli",
5956
"refmt_main3.mli",
57+
"rescript.mli",
6058
"whole_compiler.mli"
6159
],
6260
"lib/es6": [
@@ -118,7 +116,6 @@
118116
"caml_float_extern.js",
119117
"caml_float.js",
120118
"caml_format.js",
121-
"caml_gc.js",
122119
"caml_hash_primitive.js",
123120
"caml_hash.js",
124121
"caml_int32_extern.js",
@@ -132,22 +129,18 @@
132129
"caml_module.js",
133130
"caml_nativeint_extern.js",
134131
"caml_obj.js",
135-
"caml_oo_curry.js",
136-
"caml_oo.js",
137132
"caml_option.js",
138133
"caml_parser.js",
139-
"caml_primitive.js",
140134
"caml_splice_call.js",
141135
"caml_string_extern.js",
142136
"caml_string.js",
143137
"caml_sys.js",
144138
"caml_undefined_extern.js",
145-
"camlinternalBigarray.js",
139+
"caml.js",
146140
"camlinternalFormat.js",
147141
"camlinternalFormatBasics.js",
148142
"camlinternalLazy.js",
149143
"camlinternalMod.js",
150-
"camlinternalOO.js",
151144
"char.js",
152145
"complex.js",
153146
"curry.js",
@@ -196,7 +189,6 @@
196189
"list.js",
197190
"listLabels.js",
198191
"map.js",
199-
"marshal.js",
200192
"moreLabels.js",
201193
"node_buffer.js",
202194
"node_child_process.js",
@@ -284,7 +276,6 @@
284276
"caml_float_extern.js",
285277
"caml_float.js",
286278
"caml_format.js",
287-
"caml_gc.js",
288279
"caml_hash_primitive.js",
289280
"caml_hash.js",
290281
"caml_int32_extern.js",
@@ -298,22 +289,18 @@
298289
"caml_module.js",
299290
"caml_nativeint_extern.js",
300291
"caml_obj.js",
301-
"caml_oo_curry.js",
302-
"caml_oo.js",
303292
"caml_option.js",
304293
"caml_parser.js",
305-
"caml_primitive.js",
306294
"caml_splice_call.js",
307295
"caml_string_extern.js",
308296
"caml_string.js",
309297
"caml_sys.js",
310298
"caml_undefined_extern.js",
311-
"camlinternalBigarray.js",
299+
"caml.js",
312300
"camlinternalFormat.js",
313301
"camlinternalFormatBasics.js",
314302
"camlinternalLazy.js",
315303
"camlinternalMod.js",
316-
"camlinternalOO.js",
317304
"char.js",
318305
"complex.js",
319306
"curry.js",
@@ -362,7 +349,6 @@
362349
"list.js",
363350
"listLabels.js",
364351
"map.js",
365-
"marshal.js",
366352
"moreLabels.js",
367353
"node_buffer.js",
368354
"node_child_process.js",
@@ -432,12 +418,10 @@
432418
"bytes.cmi",
433419
"bytesLabels.cmi",
434420
"callback.cmi",
435-
"camlinternalBigarray.cmi",
436421
"camlinternalFormat.cmi",
437422
"camlinternalFormatBasics.cmi",
438423
"camlinternalLazy.cmi",
439424
"camlinternalMod.cmi",
440-
"camlinternalOO.cmi",
441425
"char.cmi",
442426
"complex.cmi",
443427
"digest.cmi",
@@ -485,7 +469,6 @@
485469
"list.cmi",
486470
"listLabels.cmi",
487471
"map.cmi",
488-
"marshal.cmi",
489472
"moreLabels.cmi",
490473
"node_buffer.cmi",
491474
"node_child_process.cmi",
@@ -562,12 +545,10 @@
562545
"bytes.cmt",
563546
"bytesLabels.cmt",
564547
"callback.cmt",
565-
"camlinternalBigarray.cmt",
566548
"camlinternalFormat.cmt",
567549
"camlinternalFormatBasics.cmt",
568550
"camlinternalLazy.cmt",
569551
"camlinternalMod.cmt",
570-
"camlinternalOO.cmt",
571552
"char.cmt",
572553
"complex.cmt",
573554
"digest.cmt",
@@ -615,7 +596,6 @@
615596
"list.cmt",
616597
"listLabels.cmt",
617598
"map.cmt",
618-
"marshal.cmt",
619599
"moreLabels.cmt",
620600
"node_buffer.cmt",
621601
"node_child_process.cmt",
@@ -691,7 +671,6 @@
691671
"camlinternalFormatBasics.cmti",
692672
"camlinternalLazy.cmti",
693673
"camlinternalMod.cmti",
694-
"camlinternalOO.cmti",
695674
"char.cmti",
696675
"complex.cmti",
697676
"digest.cmti",
@@ -719,7 +698,6 @@
719698
"list.cmti",
720699
"listLabels.cmti",
721700
"map.cmti",
722-
"marshal.cmti",
723701
"moreLabels.cmti",
724702
"node_process.cmti",
725703
"obj.cmti",
@@ -790,12 +768,10 @@
790768
"bytes.ml",
791769
"bytesLabels.ml",
792770
"callback.ml",
793-
"camlinternalBigarray.ml",
794771
"camlinternalFormat.ml",
795772
"camlinternalFormatBasics.ml",
796773
"camlinternalLazy.ml",
797774
"camlinternalMod.ml",
798-
"camlinternalOO.ml",
799775
"char.ml",
800776
"complex.ml",
801777
"digest.ml",
@@ -851,7 +827,6 @@
851827
"map.cppo.ml",
852828
"map.ml",
853829
"mapm.cppo.ml",
854-
"marshal.ml",
855830
"moreLabels.ml",
856831
"node_buffer.ml",
857832
"node_child_process.ml",
@@ -930,7 +905,6 @@
930905
"camlinternalFormatBasics.mli",
931906
"camlinternalLazy.mli",
932907
"camlinternalMod.mli",
933-
"camlinternalOO.mli",
934908
"char.mli",
935909
"complex.mli",
936910
"digest.mli",
@@ -962,7 +936,6 @@
962936
"map.cppo.mli",
963937
"map.mli",
964938
"mapm.cppo.mli",
965-
"marshal.mli",
966939
"moreLabels.mli",
967940
"node_process.mli",
968941
"obj.mli",
@@ -991,7 +964,8 @@
991964
"bsb.exe",
992965
"bsc.exe",
993966
"ninja.exe",
994-
"refmt.exe"
967+
"refmt.exe",
968+
"rescript.exe"
995969
],
996970
"openbsd": [
997971
".keep"
@@ -1016,6 +990,9 @@
1016990
"prepublish.js",
1017991
"release.js",
1018992
"repl.js",
993+
"rescript_arg.js",
994+
"rescript_convert.js",
995+
"rescript_format.js",
1019996
"shake.js",
1020997
"tasks.js",
1021998
"tmp.js",
@@ -1038,6 +1015,7 @@
10381015
"bsb.exe",
10391016
"bsc.exe",
10401017
"ninja.exe",
1041-
"refmt.exe"
1018+
"refmt.exe",
1019+
"rescript.exe"
10421020
]
10431021
}

jscomp/bsb/bsb_config_parse.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ let extract_package_name_and_namespace
9292
(kinda check npm upgrade)
9393
9494
Note if the setup is correct:
95-
the running compiler and node_modules/bs-platform
95+
the running compiler and node_modules/rescript
9696
should be the same version,
9797
The exact check is that the running compiler should have a
9898
compatible runtime version installed, the location of the

jscomp/bsb/bsb_config_types.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ type t =
6363
pinned_dependencies : Set_string.t;
6464
built_in_dependency : bool;
6565
warning : Bsb_warning.t;
66-
(*TODO: maybe we should always resolve bs-platform
66+
(*TODO: maybe we should always resolve rescript
6767
so that we can calculate correct relative path in
6868
[.merlin]
6969
*)

jscomp/bsb/bsb_exception.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ let print (fmt : Format.formatter) (x : error) =
6262
"File \"bsconfig.json\", line 1\n\
6363
@{<error>Error:@} package @{<error>%s@} is not found %s\n\
6464
It's the basic, required package. If you have it installed globally,\n\
65-
Please run `npm link bs-platform` to make it available" name in_json
65+
Please run `npm link rescript` to make it available" name in_json
6666
else
6767
Format.fprintf fmt
6868
"File \"bsconfig.json\", line 1\n\

jscomp/common/bs_version.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
let version = "9.1.0"
2626
let header =
2727
"// Generated by ReScript, PLEASE EDIT WITH CARE"
28-
let package_name = ref "bs-platform"
28+
let package_name = ref "rescript"

jscomp/core/js_name_of_module_id.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ let get_runtime_module_path
7777
current_package_info
7878
~package_dir:(Lazy.force Ext_path.package_dir)
7979
module_system )
80-
(*Invariant: the package path to bs-platform, it is used to
80+
(*Invariant: the package path to rescript, it is used to
8181
calculate relative js path
8282
*)
8383
(match !Js_config.customize_runtime with

jscomp/ext/ext_obj.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ let rec dump r =
102102
opaque (Printf.sprintf "unknown: tag %d size %d" t s)
103103

104104
let dump v = dump (Obj.repr v)
105-
105+
let dump_endline ?(__LOC__="") v =
106+
print_endline __LOC__;
107+
print_endline (dump v )
106108
let pp_any fmt v =
107109
Format.fprintf fmt "@[%s@]"
108110
(dump v )

jscomp/ext/ext_obj.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424
val dump : 'a -> string
25+
val dump_endline : ?__LOC__:string -> 'a -> unit
2526
val pp_any : Format.formatter -> 'a -> unit
2627
val bt : unit -> unit

jscomp/install-bsb.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# dev small utils
44
# hot replace global bsb.exe for quick testing
55
npm_prefix=`npm prefix -g`
6-
cp ../lib/bsb ../lib/bsb.exe ../lib/bsb_helper.exe $npm_prefix/lib/node_modules/bs-platform/lib/
6+
cp ../lib/bsb ../lib/bsb.exe ../lib/bsb_helper.exe $npm_prefix/lib/node_modules/rescript/lib/

0 commit comments

Comments
 (0)