diff --git a/CHANGELOG.md b/CHANGELOG.md index b6ab93b68d..d92fa1dfcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - Support for `break` and `continue` in loops. `break` and `continue` are new keywords. https://github.com/rescript-lang/rescript/pull/8348 - Fix iterator / iterable typedefs, add generator typedefs. https://github.com/rescript-lang/rescript/pull/8355 +- Remove deprecated %external extension. https://github.com/rescript-lang/rescript/pull/8376 #### :eyeglasses: Spec Compliance diff --git a/compiler/frontend/ast_exp_extension.ml b/compiler/frontend/ast_exp_extension.ml index 58391e36cb..adde841096 100644 --- a/compiler/frontend/ast_exp_extension.ml +++ b/compiler/frontend/ast_exp_extension.ml @@ -61,13 +61,6 @@ let handle_extension e (self : Bs_ast_mapper.mapper) Exp.constraint_ ~loc (Ast_exp_handle_external.handle_raw ~kind:Raw_re loc payload) (Ast_comb.to_regexp_type loc) - | "external" -> ( - Location.deprecated loc - "%external is deprecated, use %raw or regular FFI syntax instead."; - match Ast_payload.as_ident payload with - | Some {txt = Lident x} -> Ast_exp_handle_external.handle_external loc x - | None | Some _ -> - Location.raise_errorf ~loc "external expects a single identifier") | "debugger" -> {e with pexp_desc = Ast_exp_handle_external.handle_debugger loc payload} | "obj" -> ( diff --git a/tests/tests/src/ExternalExtension.mjs b/tests/tests/src/ExternalExtension.mjs deleted file mode 100644 index 58b5084505..0000000000 --- a/tests/tests/src/ExternalExtension.mjs +++ /dev/null @@ -1,13 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import * as Js from "@rescript/runtime/lib/es6/Js.mjs"; - -let match = Js.undefinedToOption(typeof __DEV__ === "undefined" ? undefined : __DEV__); - -if (match !== undefined) { - console.log("dev mode"); -} else { - console.log("production mode"); -} - -/* match Not a pure module */ diff --git a/tests/tests/src/ExternalExtension.res b/tests/tests/src/ExternalExtension.res deleted file mode 100644 index dcc6c9b019..0000000000 --- a/tests/tests/src/ExternalExtension.res +++ /dev/null @@ -1,4 +0,0 @@ -switch %external(__DEV__) { -| Some(_) => Console.log("dev mode") -| None => Console.log("production mode") -}