Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
22ab286
migrate wip
zth Aug 24, 2025
a151b5e
wip migrate
zth Aug 25, 2025
f4016a9
pipe chain example
zth Aug 25, 2025
86e2d21
migrations for Js_option
zth Aug 28, 2025
c9bd01c
migrations for Js_null
zth Aug 28, 2025
0d6e631
rename migration template for pipe chains
zth Aug 28, 2025
35eeb19
migrations for Js_null_undefined
zth Aug 28, 2025
11407a1
js_float migrations
zth Aug 28, 2025
7be3461
Js_int migrations
zth Aug 28, 2025
4ca31f7
format
zth Aug 28, 2025
b9c14bf
dict migrations
zth Aug 28, 2025
8b46d23
migrations for Js_date
zth Aug 29, 2025
6f23477
migrations for Js_re
zth Aug 29, 2025
5a35bb9
migrations for Js_math
zth Aug 29, 2025
1955bf8
one more test
zth Aug 29, 2025
865e9e5
migrations for js_undefined
zth Aug 30, 2025
7df7cec
deprecate Js_OO
zth Aug 30, 2025
4511313
migrations for Js_extern
zth Aug 30, 2025
1c9497c
migrations for Js_global
zth Aug 30, 2025
3b89ae1
migrations for Js_obj
zth Aug 30, 2025
6d9c817
make parsing of @deprecated with migration info an experimental feature
zth Aug 30, 2025
74405a7
Revert "make parsing of @deprecated with migration info an experiment…
zth Aug 31, 2025
c811257
typed array migrations
zth Aug 31, 2025
3d1f924
format
zth Aug 31, 2025
c86e3b3
support replacing types
zth Aug 31, 2025
4cf2a73
more type replacement migrations
zth Aug 31, 2025
e076439
support @apply.transforms for applying transforms, and add migrations…
zth Aug 31, 2025
22157ff
refactor a bit and add transform for dropping unit args in apply
zth Aug 31, 2025
3b4a909
refactor
zth Aug 31, 2025
e7c6e1f
finish js_json migration
zth Sep 1, 2025
210f276
more migrations
zth Sep 1, 2025
c22c54b
remove unused Match template
zth Sep 1, 2025
c474077
more migrations
zth Sep 4, 2025
ef53158
update test fixtures
zth Sep 4, 2025
7deb03a
update test fixtures
zth Sep 4, 2025
33e1b29
more fixtures
zth Sep 4, 2025
b7d8f1f
remove
zth Sep 4, 2025
2a8f562
more
zth Sep 4, 2025
fb7bc7f
more
zth Sep 4, 2025
5b7d723
migrate .resi files as well
zth Sep 4, 2025
75ec80d
fix resi
zth Sep 4, 2025
f5d2d8c
migrate-all command
zth Sep 12, 2025
743d636
more migrations
zth Sep 12, 2025
8cc3c0e
migrations for Exn
zth Sep 12, 2025
a6de19d
change migrate summary
zth Sep 12, 2025
a3acab0
oops, test file
zth Sep 12, 2025
42242a4
proper interfaces for Js Promise modules, so they can have migrations
zth Sep 12, 2025
0f54714
format
zth Sep 12, 2025
af7459e
more migration fixes
zth Sep 13, 2025
aaa17dd
more migration fix
zth Sep 13, 2025
9203c68
get rid of some warning output
zth Sep 13, 2025
7674b50
update artifacts list
zth Sep 14, 2025
75554f3
spec
zth Sep 25, 2025
3f74930
more migrations
zth Sep 25, 2025
8ae6340
more migrations
zth Sep 25, 2025
b69aa6c
analysis output
zth Sep 25, 2025
e8331b8
remove redundant stuff in migration templates
zth Sep 25, 2025
8636091
bool migration
zth Sep 25, 2025
94b9a75
more migrations
zth Sep 25, 2025
5b3c6d1
fix changelog
zth Sep 25, 2025
c160a71
remove changelog entry
zth Oct 6, 2025
b71abc1
updates after merge
zth Oct 6, 2025
bd23e6f
message about automatic migrations
zth Oct 6, 2025
2b81e1d
updated analysis output
zth Oct 6, 2025
8ea5696
tweak message
zth Oct 6, 2025
062cc1a
fix subcommand
zth Oct 6, 2025
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
Prev Previous commit
Next Next commit
Revert "make parsing of @deprecated with migration info an experiment…
…al feature"

This reverts commit 59c902c.
  • Loading branch information
zth committed Oct 6, 2025
commit 74405a7595fe265a610633e4d0d0370930f76b27
25 changes: 7 additions & 18 deletions compiler/ml/builtin_attributes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ let cat s1 s2 =

let rec deprecated_of_attrs = function
| [] -> None
| ( {txt = "deprecated"; _},
PStr [{pstr_desc = Pstr_eval ({pexp_desc = Pexp_record _}, _)}] )
:: _ ->
(* Skip record payloads here. `deprecated_of_attrs_with_migrate` should be used if we want to
parse record payloads. *)
None
| ({txt = "ocaml.deprecated" | "deprecated"; _}, p) :: _ ->
Some (string_of_opt_payload p)
| _ :: tl -> deprecated_of_attrs tl
Expand Down Expand Up @@ -132,18 +126,13 @@ let rec deprecated_of_attrs_with_migrate = function
| _ :: tl -> deprecated_of_attrs_with_migrate tl

let check_deprecated ?deprecated_context loc attrs s =
if Experimental_features.is_enabled DeprecatedMigrations then (
match deprecated_of_attrs_with_migrate attrs with
| None -> ()
| Some (txt, migration_template, migration_in_pipe_chain_template) ->
!Cmt_utils.record_deprecated_used
?deprecated_context ?migration_template
?migration_in_pipe_chain_template loc txt;
Location.deprecated loc (cat s txt))
else
match deprecated_of_attrs attrs with
| None -> ()
| Some txt -> Location.deprecated loc (cat s txt)
match deprecated_of_attrs_with_migrate attrs with
| None -> ()
| Some (txt, migration_template, migration_in_pipe_chain_template) ->
!Cmt_utils.record_deprecated_used
?deprecated_context ?migration_template ?migration_in_pipe_chain_template
loc txt;
Location.deprecated loc (cat s txt)

let check_deprecated_inclusion ~def ~use loc attrs1 attrs2 s =
match (deprecated_of_attrs attrs1, deprecated_of_attrs attrs2) with
Expand Down
4 changes: 1 addition & 3 deletions compiler/ml/experimental_features.ml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
type feature = LetUnwrap | DeprecatedMigrations
type feature = LetUnwrap

let to_string (f : feature) : string =
match f with
| LetUnwrap -> "LetUnwrap"
| DeprecatedMigrations -> "DeprecatedMigrations"

let from_string (s : string) : feature option =
match s with
| "LetUnwrap" -> Some LetUnwrap
| "DeprecatedMigrations" -> Some DeprecatedMigrations
| _ -> None

module FeatureSet = Set.Make (struct
Expand Down
2 changes: 1 addition & 1 deletion compiler/ml/experimental_features.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type feature = LetUnwrap | DeprecatedMigrations
type feature = LetUnwrap

val enable_from_string : string -> unit
val is_enabled : feature -> bool
Expand Down
4 changes: 0 additions & 4 deletions docs/docson/build-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,6 @@
"LetUnwrap": {
"type": "boolean",
"description": "Enable `let?` syntax."
},
"DeprecatedMigrations": {
"type": "boolean",
"description": "Enable parsing of the `@deprecated` attribute with migration information."
}
},
"additionalProperties": false
Expand Down
1 change: 0 additions & 1 deletion rewatch/CompilerConfigurationSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ An object of feature flags to enable experimental compiler behavior. Only suppor
Currently supported features:

- LetUnwrap: Enable `let?` syntax.
- DeprecatedMigrations: Enable parsing of the `@deprecated` attribute with migration information.

### Warnings

Expand Down
5 changes: 1 addition & 4 deletions rewatch/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ pub enum DeprecationWarning {
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub enum ExperimentalFeature {
LetUnwrap,
DeprecatedMigrations,
}

impl<'de> serde::Deserialize<'de> for ExperimentalFeature {
Expand All @@ -249,9 +248,8 @@ impl<'de> serde::Deserialize<'de> for ExperimentalFeature {
{
match v {
"LetUnwrap" => Ok(ExperimentalFeature::LetUnwrap),
"DeprecatedMigrations" => Ok(ExperimentalFeature::DeprecatedMigrations),
other => {
let available = ["LetUnwrap", "DeprecatedMigrations"].join(", ");
let available = ["LetUnwrap"].join(", ");
Err(DeError::custom(format!(
"Unknown experimental feature '{other}'. Available features: {available}",
)))
Expand Down Expand Up @@ -550,7 +548,6 @@ impl Config {
"-enable-experimental".to_string(),
match feature {
ExperimentalFeature::LetUnwrap => "LetUnwrap",
ExperimentalFeature::DeprecatedMigrations => "DeprecatedMigrations",
}
.to_string(),
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
Cleaned 0/428
Parsed 2 source files
Compiled 2 modules
=======
=======
>>>>>>> 91e157ad8 (Revert "make parsing of @deprecated with migration info an experimental feature")
Cleaned 0/113
Parsed 4 source files
Compiled 3 modules
Expand Down Expand Up @@ -70,12 +73,15 @@ Compiled 3 modules
Use `Array.joinUnsafe` instead.


<<<<<<< HEAD
>>>>>>> 434a19184 (migrate wip)
=======
Cleaned 0/115
Parsed 2 source files
Compiled 2 modules
>>>>>>> d746a071c (make parsing of @deprecated with migration info an experimental feature)
=======
>>>>>>> 91e157ad8 (Revert "make parsing of @deprecated with migration info an experimental feature")

The field 'bs-dependencies' found in the package config of '@testrepo/deprecated-config' is deprecated and will be removed in a future version.
Use 'dependencies' instead.
Expand Down
24 changes: 24 additions & 0 deletions rewatch/tests/snapshots/rename-file-internal-dep.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,30 @@ Use 'dev-dependencies' instead.
The field 'bsc-flags' found in the package config of '@testrepo/deprecated-config' is deprecated and will be removed in a future version.
Use 'compiler-flags' instead.

Warning number 3
/packages/main/src/Main.res:1:1-6

1 │ Js.log("01")
2 │ Dep01.log()
3 │

deprecated: Js.log
Use `Console.log` instead.


Warning number 3
/packages/main/src/Main.res:4:1-6

2 │ Dep01.log()
3 │
4 │ Js.log(InternalDep.value)
5 │
6 │ module Array = Belt.Array

deprecated: Js.log
Use `Console.log` instead.


We've found a bug for you!
/packages/main/src/Main.res:4:8-24

Expand Down