Skip to content

cherry pick changes in release branch && add changes log #5065

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 8 commits into from
Apr 13, 2021
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
42 changes: 42 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
`*` means potential break changes

# 9.1

- #5014 #5063 #5027 the new ReScript CLI interface
Thew new CLI is self explainatory:
```
rescript -h
Available flags
-v, -version display version number
-h, -help display help
Subcommands:
build
clean
format
convert
help
Run rescript subcommand -h for more details,
For example:
rescript build -h
rescript format -h
```

- #5025 in place format support, this is subsumed into `rescript format` subcommand
- #5060 #5055
Add formatting support for stdin/sdout
- #5053 #5050 clean up structural object semantics
- #5037
Allows coercion from nullary types to int/string.
This applies to collections types too
- #5029
int polyvar is compiled into int.
`#0` is the same as 0 except it is structually typed as `#0`
- #5023 generate interface file in rescript syntax by default
- #5021 makes int64 runtime payload small for just comparison
- #5019, #5017, #5016, #5015, #5010 improve error message
- #5008 don't trigger a rebuild if mjs file changes, fix an infinite loop in watch mode
- #5005 not depending on Format for Arg module, smaller size
- #4985 fix the schema of bsb on `dev` property
- #4967 #4986, #4984, #4971, #4972, #4969 Breaking changes
Remove ocaml style classes while structural objects and structural typings are simplified. Js.t is no longer needed. If user does not know
what ocaml style class is, this should not affect him.


# 9.0.2

- #4990 Fix an optimization bug introduced in 9.0
Expand Down
54 changes: 16 additions & 38 deletions jscomp/artifacts.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,32 @@
"bsrefmt",
"COPYING",
"LICENSE",
"4061.json",
"rescript",
"bsconfig.json",
"bspack.json",
"esy.json",
"package.json",
"COPYING.LESSER",
"Changes.md",
"CONTRIBUTING.md",
"Credits.md",
"DCO.md",
"README.md",
".istanbul.yml"
],
"darwin": [
"bsc.byte",
"ninja.COPYING",
"bsb_helper.exe",
"bsb.exe",
"bsc.exe",
"ninja.exe",
"refmt.exe"
"refmt.exe",
"rescript.exe"
],
"docs/docson": [
"LICENSE",
"build-schema.json",
"README.md"
],
"esy.lock": [
".gitattributes",
".gitignore",
"index.json"
],
"freebsd": [
"ninja.COPYING"
],
Expand All @@ -53,10 +49,12 @@
"bsb_helper.ml",
"bsb.ml",
"refmt_main3.ml",
"rescript.ml",
"whole_compiler.ml",
"bsb_helper.mli",
"bsb.mli",
"refmt_main3.mli",
"rescript.mli",
"whole_compiler.mli"
],
"lib/es6": [
Expand Down Expand Up @@ -118,7 +116,6 @@
"caml_float_extern.js",
"caml_float.js",
"caml_format.js",
"caml_gc.js",
"caml_hash_primitive.js",
"caml_hash.js",
"caml_int32_extern.js",
Expand All @@ -132,22 +129,18 @@
"caml_module.js",
"caml_nativeint_extern.js",
"caml_obj.js",
"caml_oo_curry.js",
"caml_oo.js",
"caml_option.js",
"caml_parser.js",
"caml_primitive.js",
"caml_splice_call.js",
"caml_string_extern.js",
"caml_string.js",
"caml_sys.js",
"caml_undefined_extern.js",
"camlinternalBigarray.js",
"caml.js",
"camlinternalFormat.js",
"camlinternalFormatBasics.js",
"camlinternalLazy.js",
"camlinternalMod.js",
"camlinternalOO.js",
"char.js",
"complex.js",
"curry.js",
Expand Down Expand Up @@ -196,7 +189,6 @@
"list.js",
"listLabels.js",
"map.js",
"marshal.js",
"moreLabels.js",
"node_buffer.js",
"node_child_process.js",
Expand Down Expand Up @@ -284,7 +276,6 @@
"caml_float_extern.js",
"caml_float.js",
"caml_format.js",
"caml_gc.js",
"caml_hash_primitive.js",
"caml_hash.js",
"caml_int32_extern.js",
Expand All @@ -298,22 +289,18 @@
"caml_module.js",
"caml_nativeint_extern.js",
"caml_obj.js",
"caml_oo_curry.js",
"caml_oo.js",
"caml_option.js",
"caml_parser.js",
"caml_primitive.js",
"caml_splice_call.js",
"caml_string_extern.js",
"caml_string.js",
"caml_sys.js",
"caml_undefined_extern.js",
"camlinternalBigarray.js",
"caml.js",
"camlinternalFormat.js",
"camlinternalFormatBasics.js",
"camlinternalLazy.js",
"camlinternalMod.js",
"camlinternalOO.js",
"char.js",
"complex.js",
"curry.js",
Expand Down Expand Up @@ -362,7 +349,6 @@
"list.js",
"listLabels.js",
"map.js",
"marshal.js",
"moreLabels.js",
"node_buffer.js",
"node_child_process.js",
Expand Down Expand Up @@ -432,12 +418,10 @@
"bytes.cmi",
"bytesLabels.cmi",
"callback.cmi",
"camlinternalBigarray.cmi",
"camlinternalFormat.cmi",
"camlinternalFormatBasics.cmi",
"camlinternalLazy.cmi",
"camlinternalMod.cmi",
"camlinternalOO.cmi",
"char.cmi",
"complex.cmi",
"digest.cmi",
Expand Down Expand Up @@ -485,7 +469,6 @@
"list.cmi",
"listLabels.cmi",
"map.cmi",
"marshal.cmi",
"moreLabels.cmi",
"node_buffer.cmi",
"node_child_process.cmi",
Expand Down Expand Up @@ -562,12 +545,10 @@
"bytes.cmt",
"bytesLabels.cmt",
"callback.cmt",
"camlinternalBigarray.cmt",
"camlinternalFormat.cmt",
"camlinternalFormatBasics.cmt",
"camlinternalLazy.cmt",
"camlinternalMod.cmt",
"camlinternalOO.cmt",
"char.cmt",
"complex.cmt",
"digest.cmt",
Expand Down Expand Up @@ -615,7 +596,6 @@
"list.cmt",
"listLabels.cmt",
"map.cmt",
"marshal.cmt",
"moreLabels.cmt",
"node_buffer.cmt",
"node_child_process.cmt",
Expand Down Expand Up @@ -691,7 +671,6 @@
"camlinternalFormatBasics.cmti",
"camlinternalLazy.cmti",
"camlinternalMod.cmti",
"camlinternalOO.cmti",
"char.cmti",
"complex.cmti",
"digest.cmti",
Expand Down Expand Up @@ -719,7 +698,6 @@
"list.cmti",
"listLabels.cmti",
"map.cmti",
"marshal.cmti",
"moreLabels.cmti",
"node_process.cmti",
"obj.cmti",
Expand Down Expand Up @@ -790,12 +768,10 @@
"bytes.ml",
"bytesLabels.ml",
"callback.ml",
"camlinternalBigarray.ml",
"camlinternalFormat.ml",
"camlinternalFormatBasics.ml",
"camlinternalLazy.ml",
"camlinternalMod.ml",
"camlinternalOO.ml",
"char.ml",
"complex.ml",
"digest.ml",
Expand Down Expand Up @@ -851,7 +827,6 @@
"map.cppo.ml",
"map.ml",
"mapm.cppo.ml",
"marshal.ml",
"moreLabels.ml",
"node_buffer.ml",
"node_child_process.ml",
Expand Down Expand Up @@ -930,7 +905,6 @@
"camlinternalFormatBasics.mli",
"camlinternalLazy.mli",
"camlinternalMod.mli",
"camlinternalOO.mli",
"char.mli",
"complex.mli",
"digest.mli",
Expand Down Expand Up @@ -962,7 +936,6 @@
"map.cppo.mli",
"map.mli",
"mapm.cppo.mli",
"marshal.mli",
"moreLabels.mli",
"node_process.mli",
"obj.mli",
Expand Down Expand Up @@ -991,7 +964,8 @@
"bsb.exe",
"bsc.exe",
"ninja.exe",
"refmt.exe"
"refmt.exe",
"rescript.exe"
],
"openbsd": [
".keep"
Expand All @@ -1016,6 +990,9 @@
"prepublish.js",
"release.js",
"repl.js",
"rescript_arg.js",
"rescript_convert.js",
"rescript_format.js",
"shake.js",
"tasks.js",
"tmp.js",
Expand All @@ -1038,6 +1015,7 @@
"bsb.exe",
"bsc.exe",
"ninja.exe",
"refmt.exe"
"refmt.exe",
"rescript.exe"
]
}
2 changes: 1 addition & 1 deletion jscomp/bsb/bsb_config_parse.ml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ let extract_package_name_and_namespace
(kinda check npm upgrade)

Note if the setup is correct:
the running compiler and node_modules/bs-platform
the running compiler and node_modules/rescript
should be the same version,
The exact check is that the running compiler should have a
compatible runtime version installed, the location of the
Expand Down
2 changes: 1 addition & 1 deletion jscomp/bsb/bsb_config_types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type t =
pinned_dependencies : Set_string.t;
built_in_dependency : bool;
warning : Bsb_warning.t;
(*TODO: maybe we should always resolve bs-platform
(*TODO: maybe we should always resolve rescript
so that we can calculate correct relative path in
[.merlin]
*)
Expand Down
2 changes: 1 addition & 1 deletion jscomp/bsb/bsb_exception.ml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ let print (fmt : Format.formatter) (x : error) =
"File \"bsconfig.json\", line 1\n\
@{<error>Error:@} package @{<error>%s@} is not found %s\n\
It's the basic, required package. If you have it installed globally,\n\
Please run `npm link bs-platform` to make it available" name in_json
Please run `npm link rescript` to make it available" name in_json
else
Format.fprintf fmt
"File \"bsconfig.json\", line 1\n\
Expand Down
2 changes: 1 addition & 1 deletion jscomp/common/bs_version.ml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
let version = "9.1.0"
let header =
"// Generated by ReScript, PLEASE EDIT WITH CARE"
let package_name = ref "bs-platform"
let package_name = ref "rescript"
2 changes: 1 addition & 1 deletion jscomp/core/js_name_of_module_id.ml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ let get_runtime_module_path
current_package_info
~package_dir:(Lazy.force Ext_path.package_dir)
module_system )
(*Invariant: the package path to bs-platform, it is used to
(*Invariant: the package path to rescript, it is used to
calculate relative js path
*)
(match !Js_config.customize_runtime with
Expand Down
4 changes: 3 additions & 1 deletion jscomp/ext/ext_obj.ml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ let rec dump r =
opaque (Printf.sprintf "unknown: tag %d size %d" t s)

let dump v = dump (Obj.repr v)

let dump_endline ?(__LOC__="") v =
print_endline __LOC__;
print_endline (dump v )
let pp_any fmt v =
Format.fprintf fmt "@[%s@]"
(dump v )
Expand Down
1 change: 1 addition & 0 deletions jscomp/ext/ext_obj.mli
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
val dump : 'a -> string
val dump_endline : ?__LOC__:string -> 'a -> unit
val pp_any : Format.formatter -> 'a -> unit
val bt : unit -> unit
2 changes: 1 addition & 1 deletion jscomp/install-bsb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# dev small utils
# hot replace global bsb.exe for quick testing
npm_prefix=`npm prefix -g`
cp ../lib/bsb ../lib/bsb.exe ../lib/bsb_helper.exe $npm_prefix/lib/node_modules/bs-platform/lib/
cp ../lib/bsb ../lib/bsb.exe ../lib/bsb_helper.exe $npm_prefix/lib/node_modules/rescript/lib/
Loading