Skip to content

Commit 53e24ed

Browse files
authored
Remove rudimentary node bindings and undocumented %node extension (rescript-lang#6285)
1 parent cca9840 commit 53e24ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+13
-1169
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
- Introduced a new `%ffi` extension that provides a more robust mechanism for JavaScript function interoperation by considering function arity in type constraints. This enhancement improves safety when dealing with JavaScript functions by enforcing type constraints based on the arity of the function. [PR #6251](https://github.com/rescript-lang/rescript-compiler/pull/6251)
1818
- Extended untagged variants with function types https://github.com/rescript-lang/rescript-compiler/pull/6279
1919

20+
#### :boom: Breaking Change
21+
22+
- Remove rudimentary node bindings and undocumented `%node` extension. https://github.com/rescript-lang/rescript-compiler/pull/6285
23+
2024
#### :bug: Bug Fix
2125

2226
- Fix issue where uncurried type internals leak in type error. https://github.com/rescript-lang/rescript-compiler/pull/6264

jscomp/frontend/ast_exp_extension.ml

-35
Original file line numberDiff line numberDiff line change
@@ -69,41 +69,6 @@ let handle_extension e (self : Bs_ast_mapper.mapper)
6969
(Exp.ident ~loc {loc; txt = Lident "timed"})))
7070
| _ ->
7171
Location.raise_errorf ~loc "expect a boolean expression in the payload")
72-
| "bs.node" | "node" -> (
73-
let strip s =
74-
match s with
75-
| "_module" -> "module"
76-
| x -> x
77-
in
78-
match Ast_payload.as_ident payload with
79-
| Some
80-
{
81-
txt =
82-
Lident
83-
(("__filename" | "__dirname" | "_module" | "require") as name);
84-
loc;
85-
} ->
86-
let exp = Ast_exp_handle_external.handle_external loc (strip name) in
87-
let typ =
88-
Ast_core_type.lift_option_type
89-
(if name = "_module" then
90-
Typ.constr ~loc {txt = Ldot (Lident "Node", "node_module"); loc} []
91-
else if name = "require" then
92-
Typ.constr ~loc {txt = Ldot (Lident "Node", "node_require"); loc} []
93-
else Ast_literal.type_string ~loc ())
94-
in
95-
Exp.constraint_ ~loc exp typ
96-
| Some _ | None -> (
97-
match payload with
98-
| PTyp _ ->
99-
Location.raise_errorf ~loc
100-
"Illegal payload, expect an expression payload instead of type \
101-
payload"
102-
| PPat _ ->
103-
Location.raise_errorf ~loc
104-
"Illegal payload, expect an expression payload instead of pattern \
105-
payload"
106-
| _ -> Location.raise_errorf ~loc "Illegal payload"))
10772
| "bs.debugger" | "debugger" ->
10873
{e with pexp_desc = Ast_exp_handle_external.handle_debugger loc payload}
10974
| "bs.obj" | "obj" -> (

jscomp/others/node.ml

-84
This file was deleted.

jscomp/others/node_buffer.res

-40
This file was deleted.

jscomp/others/node_child_process.res

-49
This file was deleted.

jscomp/others/node_fs.res

-133
This file was deleted.

jscomp/others/node_module.res

-27
This file was deleted.

0 commit comments

Comments
 (0)