From b26c48a8df38c207ba77956d473ae9868d0d253e Mon Sep 17 00:00:00 2001 From: David Sancho Moreno Date: Mon, 24 Feb 2025 13:03:21 +0100 Subject: [PATCH 1/2] update tests with melange 3 and ocaml 5.2 --- ppx/test/hover.t | 96 +--- ppx/test/issue-429.t/run.t | 722 ++---------------------------- ppx/test/keys.t/run.t | 4 +- ppx/test/react.t | 24 +- ppx/test/simple.t/run.t | 264 +---------- ppx/test/uppercase.t/run.t | 24 - test/blackbox-tests/useCallback.t | 16 +- 7 files changed, 98 insertions(+), 1052 deletions(-) diff --git a/ppx/test/hover.t b/ppx/test/hover.t index 16aecf194..c9482033a 100644 --- a/ppx/test/hover.t +++ b/ppx/test/hover.t @@ -49,59 +49,23 @@ Let's test hovering over parts of the component }, "end": { "line": 3, - "col": 33 - }, - "type": "React.element", - "tail": "no" - }, - { - "start": { - "line": 2, - "col": 2 - }, - "end": { - "line": 4, - "col": 15 + "col": 29 }, - "type": "React.element array", + "type": "string -> React.element", "tail": "no" }, { "start": { - "line": 2, - "col": 2 + "line": 3, + "col": 17 }, "end": { - "line": 4, - "col": 15 + "line": 3, + "col": 33 }, "type": "React.element", "tail": "no" }, - { - "start": { - "line": 2, - "col": 2 - }, - "end": { - "line": 4, - "col": 15 - }, - "type": "React.element option", - "tail": "no" - }, - { - "start": { - "line": 2, - "col": 2 - }, - "end": { - "line": 4, - "col": 15 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 2, @@ -160,63 +124,27 @@ The `foo` variable inside the component body { "start": { "line": 3, - "col": 17 + "col": 30 }, "end": { "line": 3, "col": 33 }, - "type": "React.element", - "tail": "no" - }, - { - "start": { - "line": 2, - "col": 2 - }, - "end": { - "line": 4, - "col": 15 - }, - "type": "React.element array", + "type": "string", "tail": "no" }, { "start": { - "line": 2, - "col": 2 + "line": 3, + "col": 17 }, "end": { - "line": 4, - "col": 15 + "line": 3, + "col": 33 }, "type": "React.element", "tail": "no" }, - { - "start": { - "line": 2, - "col": 2 - }, - "end": { - "line": 4, - "col": 15 - }, - "type": "React.element option", - "tail": "no" - }, - { - "start": { - "line": 2, - "col": 2 - }, - "end": { - "line": 4, - "col": 15 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 2, diff --git a/ppx/test/issue-429.t/run.t b/ppx/test/issue-429.t/run.t index a1b1454ee..6ead93f1a 100644 --- a/ppx/test/issue-429.t/run.t +++ b/ppx/test/issue-429.t/run.t @@ -310,54 +310,6 @@ First child `button` "type": "element", "tail": "no" }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "array(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "element", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "option(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 29, @@ -413,18 +365,6 @@ First child `onClick` prop $ ocamlmerlin single type-enclosing -position 30:17 -verbosity 0 \ > -filename component.re < component.re | jq '.value' [ - { - "start": { - "line": 30, - "col": 4 - }, - "end": { - "line": 30, - "col": 75 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 30, @@ -437,54 +377,6 @@ First child `onClick` prop "type": "element", "tail": "no" }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "array(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "element", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "option(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 29, @@ -540,18 +432,6 @@ First child `onClick` callback argument (event) $ ocamlmerlin single type-enclosing -position 30:23 -verbosity 0 \ > -filename component.re < component.re | jq '.value' [ - { - "start": { - "line": 30, - "col": 20 - }, - "end": { - "line": 30, - "col": 46 - }, - "type": "Event.Mouse.t => unit", - "tail": "no" - }, { "start": { "line": 30, @@ -573,69 +453,9 @@ First child `onClick` callback argument (event) "line": 30, "col": 75 }, - "type": "ReactDOM.domProps", - "tail": "no" - }, - { - "start": { - "line": 30, - "col": 4 - }, - "end": { - "line": 30, - "col": 75 - }, - "type": "element", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "array(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, "type": "element", "tail": "no" }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "option(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 29, @@ -710,21 +530,21 @@ First child `onClick` prop `dispatch` }, "end": { "line": 30, - "col": 45 + "col": 34 }, - "type": "unit", + "type": "action => unit", "tail": "no" }, { "start": { "line": 30, - "col": 20 + "col": 26 }, "end": { "line": 30, - "col": 46 + "col": 45 }, - "type": "Event.Mouse.t => unit", + "type": "unit", "tail": "no" }, { @@ -739,18 +559,6 @@ First child `onClick` prop `dispatch` "type": "option(Event.Mouse.t => unit)", "tail": "no" }, - { - "start": { - "line": 30, - "col": 4 - }, - "end": { - "line": 30, - "col": 75 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 30, @@ -763,54 +571,6 @@ First child `onClick` prop `dispatch` "type": "element", "tail": "no" }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "array(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "element", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "option(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 29, @@ -902,18 +662,6 @@ First child `onClick` prop `Click` "type": "unit", "tail": "no" }, - { - "start": { - "line": 30, - "col": 20 - }, - "end": { - "line": 30, - "col": 46 - }, - "type": "Event.Mouse.t => unit", - "tail": "no" - }, { "start": { "line": 30, @@ -935,69 +683,9 @@ First child `onClick` prop `Click` "line": 30, "col": 75 }, - "type": "ReactDOM.domProps", - "tail": "no" - }, - { - "start": { - "line": 30, - "col": 4 - }, - "end": { - "line": 30, - "col": 75 - }, - "type": "element", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "array(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, "type": "element", "tail": "no" }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "option(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 29, @@ -1068,13 +756,13 @@ First child `string` { "start": { "line": 30, - "col": 48 + "col": 49 }, "end": { "line": 30, - "col": 65 + "col": 55 }, - "type": "element", + "type": "string => element", "tail": "no" }, { @@ -1098,69 +786,9 @@ First child `string` "line": 30, "col": 75 }, - "type": "ReactDOM.domProps", - "tail": "no" - }, - { - "start": { - "line": 30, - "col": 4 - }, - "end": { - "line": 30, - "col": 75 - }, - "type": "element", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "array(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, "type": "element", "tail": "no" }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "option(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 29, @@ -1231,13 +859,13 @@ First child `message` { "start": { "line": 30, - "col": 48 + "col": 56 }, "end": { "line": 30, - "col": 65 + "col": 63 }, - "type": "element", + "type": "string", "tail": "no" }, { @@ -1247,81 +875,21 @@ First child `message` }, "end": { "line": 30, - "col": 65 - }, - "type": "option(element)", - "tail": "no" - }, - { - "start": { - "line": 30, - "col": 4 - }, - "end": { - "line": 30, - "col": 75 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, - { - "start": { - "line": 30, - "col": 4 - }, - "end": { - "line": 30, - "col": 75 - }, - "type": "element", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "array(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "element", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 + "col": 65 }, "type": "option(element)", "tail": "no" }, { "start": { - "line": 29, - "col": 2 + "line": 30, + "col": 4 }, "end": { - "line": 35, - "col": 9 + "line": 30, + "col": 75 }, - "type": "ReactDOM.domProps", + "type": "element", "tail": "no" }, { @@ -1398,71 +966,35 @@ Third child `state` }, "end": { "line": 34, - "col": 15 + "col": 10 }, - "type": "bool", + "type": "state", "tail": "no" }, { "start": { "line": 34, - "col": 4 + "col": 5 }, "end": { "line": 34, - "col": 42 - }, - "type": "element", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 + "col": 15 }, - "type": "array(element)", + "type": "bool", "tail": "no" }, { "start": { - "line": 29, - "col": 2 + "line": 34, + "col": 4 }, "end": { - "line": 35, - "col": 9 + "line": 34, + "col": 42 }, "type": "element", "tail": "no" }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "option(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 29, @@ -1554,54 +1086,6 @@ Third child `show` in `state.show` "type": "element", "tail": "no" }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "array(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "element", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "option(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 29, @@ -1676,71 +1160,35 @@ Third child `string` }, "end": { "line": 34, - "col": 34 + "col": 24 }, - "type": "element", + "type": "string => element", "tail": "no" }, { "start": { "line": 34, - "col": 4 + "col": 18 }, "end": { "line": 34, - "col": 42 + "col": 34 }, "type": "element", "tail": "no" }, { "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "array(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 + "line": 34, + "col": 4 }, "end": { - "line": 35, - "col": 9 + "line": 34, + "col": 42 }, "type": "element", "tail": "no" }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "option(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 29, @@ -1811,75 +1259,39 @@ Third child `greeting` { "start": { "line": 34, - "col": 18 + "col": 25 }, "end": { "line": 34, - "col": 34 + "col": 33 }, - "type": "element", + "type": "string", "tail": "no" }, { "start": { "line": 34, - "col": 4 + "col": 18 }, "end": { "line": 34, - "col": 42 + "col": 34 }, "type": "element", "tail": "no" }, { "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "array(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 + "line": 34, + "col": 4 }, "end": { - "line": 35, - "col": 9 + "line": 34, + "col": 42 }, "type": "element", "tail": "no" }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "option(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 29, @@ -1950,63 +1362,27 @@ Third child `null` { "start": { "line": 34, - "col": 4 + "col": 37 }, "end": { "line": 34, - "col": 42 + "col": 41 }, "type": "element", "tail": "no" }, { "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "array(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 + "line": 34, + "col": 4 }, "end": { - "line": 35, - "col": 9 + "line": 34, + "col": 42 }, "type": "element", "tail": "no" }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "option(element)", - "tail": "no" - }, - { - "start": { - "line": 29, - "col": 2 - }, - "end": { - "line": 35, - "col": 9 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 29, diff --git a/ppx/test/keys.t/run.t b/ppx/test/keys.t/run.t index 3242dd6b0..f2d83210c 100644 --- a/ppx/test/keys.t/run.t +++ b/ppx/test/keys.t/run.t @@ -32,7 +32,7 @@ _^ "line": 10, "col": 85 }, - "type": "string", + "type": "React.element", "tail": "no" } @@ -122,7 +122,7 @@ ______^ "line": 10, "col": 73 }, - "type": "unit", + "type": "option(React.element)", "tail": "no" } diff --git a/ppx/test/react.t b/ppx/test/react.t index b6cee36dc..eb7c3f080 100644 --- a/ppx/test/react.t +++ b/ppx/test/react.t @@ -40,16 +40,16 @@ Demonstrate how to use the React JSX PPX function X$App(Props) { return Belt__Belt_List.toArray(Belt__Belt_List.map({ - hd: "Hello!", - tl: { - hd: "This is React!", - tl: /* [] */ 0 - } - }, (function (greeting) { - return JsxRuntime.jsx("h1", { - children: greeting - }); - }))); + hd: "Hello!", + tl: { + hd: "This is React!", + tl: /* [] */0 + } + }, (function (greeting) { + return JsxRuntime.jsx("h1", { + children: greeting + }); + }))); } const App = { @@ -60,7 +60,5 @@ Demonstrate how to use the React JSX PPX JsxRuntime.jsx(X$App, {}); - module.exports = { - App, - } + exports.App = App; /* Not a pure module */ diff --git a/ppx/test/simple.t/run.t b/ppx/test/simple.t/run.t index a2c13f98b..23f074d5e 100644 --- a/ppx/test/simple.t/run.t +++ b/ppx/test/simple.t/run.t @@ -71,18 +71,6 @@ Let's test hovering over parts of the component "type": "(~initialValue: int=?, unit) => React.element", "tail": "no" }, - { - "start": { - "line": 1, - "col": 32 - }, - "end": { - "line": 10, - "col": 1 - }, - "type": "{\n external makeProps:\n (~initialValue: 'initialValue=?, ~key: string=?, unit) =>\n {.. \"initialValue\": option('initialValue)} = \"\"\n \"����\u0000\u0000\u0000!\u0000\u0000\u0000\u000b\u0000\u0000\u0000!\u0000\u0000\u0000\u001f���A�,initialValue@��A�#key@��@@@\";\n let make: (~initialValue: int=?, unit) => React.element;\n let make: {.. \"initialValue\": option(int)} => React.element;\n}", - "tail": "no" - }, { "start": { "line": 1, @@ -114,18 +102,6 @@ Let's test hovering over parts of the component $ ocamlmerlin single type-enclosing -position 6:17 -verbosity 0 \ > -filename component.re < component.re | jq '.value' [ - { - "start": { - "line": 6, - "col": 4 - }, - "end": { - "line": 8, - "col": 14 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 6, @@ -162,18 +138,6 @@ Let's test hovering over parts of the component "type": "(~initialValue: int=?, unit) => React.element", "tail": "no" }, - { - "start": { - "line": 1, - "col": 32 - }, - "end": { - "line": 10, - "col": 1 - }, - "type": "{\n external makeProps:\n (~initialValue: 'initialValue=?, ~key: string=?, unit) =>\n {.. \"initialValue\": option('initialValue)} = \"\"\n \"����\u0000\u0000\u0000!\u0000\u0000\u0000\u000b\u0000\u0000\u0000!\u0000\u0000\u0000\u001f���A�,initialValue@��A�#key@��@@@\";\n let make: (~initialValue: int=?, unit) => React.element;\n let make: {.. \"initialValue\": option(int)} => React.element;\n}", - "tail": "no" - }, { "start": { "line": 1, @@ -205,18 +169,6 @@ Let's test hovering over parts of the component $ ocamlmerlin single type-enclosing -position 6:23 -verbosity 0 \ > -filename component.re < component.re | jq '.value' [ - { - "start": { - "line": 6, - "col": 20 - }, - "end": { - "line": 6, - "col": 55 - }, - "type": "React.Event.Mouse.t => unit", - "tail": "no" - }, { "start": { "line": 6, @@ -229,18 +181,6 @@ Let's test hovering over parts of the component "type": "option(React.Event.Mouse.t => unit)", "tail": "no" }, - { - "start": { - "line": 6, - "col": 4 - }, - "end": { - "line": 8, - "col": 14 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 6, @@ -277,18 +217,6 @@ Let's test hovering over parts of the component "type": "(~initialValue: int=?, unit) => React.element", "tail": "no" }, - { - "start": { - "line": 1, - "col": 32 - }, - "end": { - "line": 10, - "col": 1 - }, - "type": "{\n external makeProps:\n (~initialValue: 'initialValue=?, ~key: string=?, unit) =>\n {.. \"initialValue\": option('initialValue)} = \"\"\n \"����\u0000\u0000\u0000!\u0000\u0000\u0000\u000b\u0000\u0000\u0000!\u0000\u0000\u0000\u001f���A�,initialValue@��A�#key@��@@@\";\n let make: (~initialValue: int=?, unit) => React.element;\n let make: {.. \"initialValue\": option(int)} => React.element;\n}", - "tail": "no" - }, { "start": { "line": 1, @@ -339,21 +267,21 @@ Let's test hovering over parts of the component }, "end": { "line": 6, - "col": 54 + "col": 34 }, - "type": "unit", + "type": "(int => int) => unit", "tail": "no" }, { "start": { "line": 6, - "col": 20 + "col": 26 }, "end": { "line": 6, - "col": 55 + "col": 54 }, - "type": "React.Event.Mouse.t => unit", + "type": "unit", "tail": "no" }, { @@ -368,18 +296,6 @@ Let's test hovering over parts of the component "type": "option(React.Event.Mouse.t => unit)", "tail": "no" }, - { - "start": { - "line": 6, - "col": 4 - }, - "end": { - "line": 8, - "col": 14 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 6, @@ -416,18 +332,6 @@ Let's test hovering over parts of the component "type": "(~initialValue: int=?, unit) => React.element", "tail": "no" }, - { - "start": { - "line": 1, - "col": 32 - }, - "end": { - "line": 10, - "col": 1 - }, - "type": "{\n external makeProps:\n (~initialValue: 'initialValue=?, ~key: string=?, unit) =>\n {.. \"initialValue\": option('initialValue)} = \"\"\n \"����\u0000\u0000\u0000!\u0000\u0000\u0000\u000b\u0000\u0000\u0000!\u0000\u0000\u0000\u001f���A�,initialValue@��A�#key@��@@@\";\n let make: (~initialValue: int=?, unit) => React.element;\n let make: {.. \"initialValue\": option(int)} => React.element;\n}", - "tail": "no" - }, { "start": { "line": 1, @@ -495,18 +399,6 @@ Let's test hovering over parts of the component "type": "unit", "tail": "no" }, - { - "start": { - "line": 6, - "col": 20 - }, - "end": { - "line": 6, - "col": 55 - }, - "type": "React.Event.Mouse.t => unit", - "tail": "no" - }, { "start": { "line": 6, @@ -519,18 +411,6 @@ Let's test hovering over parts of the component "type": "option(React.Event.Mouse.t => unit)", "tail": "no" }, - { - "start": { - "line": 6, - "col": 4 - }, - "end": { - "line": 8, - "col": 14 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 6, @@ -567,18 +447,6 @@ Let's test hovering over parts of the component "type": "(~initialValue: int=?, unit) => React.element", "tail": "no" }, - { - "start": { - "line": 1, - "col": 32 - }, - "end": { - "line": 10, - "col": 1 - }, - "type": "{\n external makeProps:\n (~initialValue: 'initialValue=?, ~key: string=?, unit) =>\n {.. \"initialValue\": option('initialValue)} = \"\"\n \"����\u0000\u0000\u0000!\u0000\u0000\u0000\u000b\u0000\u0000\u0000!\u0000\u0000\u0000\u001f���A�,initialValue@��A�#key@��@@@\";\n let make: (~initialValue: int=?, unit) => React.element;\n let make: {.. \"initialValue\": option(int)} => React.element;\n}", - "tail": "no" - }, { "start": { "line": 1, @@ -629,7 +497,7 @@ Let's test hovering over parts of the component }, "end": { "line": 6, - "col": 53 + "col": 49 }, "type": "int", "tail": "no" @@ -637,37 +505,37 @@ Let's test hovering over parts of the component { "start": { "line": 6, - "col": 35 + "col": 44 }, "end": { "line": 6, "col": 53 }, - "type": "int => int", + "type": "int", "tail": "no" }, { "start": { "line": 6, - "col": 26 + "col": 35 }, "end": { "line": 6, - "col": 54 + "col": 53 }, - "type": "unit", + "type": "int => int", "tail": "no" }, { "start": { "line": 6, - "col": 20 + "col": 26 }, "end": { "line": 6, - "col": 55 + "col": 54 }, - "type": "React.Event.Mouse.t => unit", + "type": "unit", "tail": "no" }, { @@ -682,18 +550,6 @@ Let's test hovering over parts of the component "type": "option(React.Event.Mouse.t => unit)", "tail": "no" }, - { - "start": { - "line": 6, - "col": 4 - }, - "end": { - "line": 8, - "col": 14 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 6, @@ -730,18 +586,6 @@ Let's test hovering over parts of the component "type": "(~initialValue: int=?, unit) => React.element", "tail": "no" }, - { - "start": { - "line": 1, - "col": 32 - }, - "end": { - "line": 10, - "col": 1 - }, - "type": "{\n external makeProps:\n (~initialValue: 'initialValue=?, ~key: string=?, unit) =>\n {.. \"initialValue\": option('initialValue)} = \"\"\n \"����\u0000\u0000\u0000!\u0000\u0000\u0000\u000b\u0000\u0000\u0000!\u0000\u0000\u0000\u001f���A�,initialValue@��A�#key@��@@@\";\n let make: (~initialValue: int=?, unit) => React.element;\n let make: {.. \"initialValue\": option(int)} => React.element;\n}", - "tail": "no" - }, { "start": { "line": 1, @@ -792,9 +636,9 @@ Let's test hovering over parts of the component }, "end": { "line": 7, - "col": 22 + "col": 11 }, - "type": "React.element", + "type": "int", "tail": "no" }, { @@ -809,18 +653,6 @@ Let's test hovering over parts of the component "type": "option(React.element)", "tail": "no" }, - { - "start": { - "line": 6, - "col": 4 - }, - "end": { - "line": 8, - "col": 14 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 6, @@ -857,18 +689,6 @@ Let's test hovering over parts of the component "type": "(~initialValue: int=?, unit) => React.element", "tail": "no" }, - { - "start": { - "line": 1, - "col": 32 - }, - "end": { - "line": 10, - "col": 1 - }, - "type": "{\n external makeProps:\n (~initialValue: 'initialValue=?, ~key: string=?, unit) =>\n {.. \"initialValue\": option('initialValue)} = \"\"\n \"����\u0000\u0000\u0000!\u0000\u0000\u0000\u000b\u0000\u0000\u0000!\u0000\u0000\u0000\u001f���A�,initialValue@��A�#key@��@@@\";\n let make: (~initialValue: int=?, unit) => React.element;\n let make: {.. \"initialValue\": option(int)} => React.element;\n}", - "tail": "no" - }, { "start": { "line": 1, @@ -915,13 +735,13 @@ Let's test hovering over parts of the component { "start": { "line": 7, - "col": 6 + "col": 13 }, "end": { "line": 7, "col": 22 }, - "type": "React.element", + "type": "int => React.element", "tail": "no" }, { @@ -936,18 +756,6 @@ Let's test hovering over parts of the component "type": "option(React.element)", "tail": "no" }, - { - "start": { - "line": 6, - "col": 4 - }, - "end": { - "line": 8, - "col": 14 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 6, @@ -984,18 +792,6 @@ Let's test hovering over parts of the component "type": "(~initialValue: int=?, unit) => React.element", "tail": "no" }, - { - "start": { - "line": 1, - "col": 32 - }, - "end": { - "line": 10, - "col": 1 - }, - "type": "{\n external makeProps:\n (~initialValue: 'initialValue=?, ~key: string=?, unit) =>\n {.. \"initialValue\": option('initialValue)} = \"\"\n \"����\u0000\u0000\u0000!\u0000\u0000\u0000\u000b\u0000\u0000\u0000!\u0000\u0000\u0000\u001f���A�,initialValue@��A�#key@��@@@\";\n let make: (~initialValue: int=?, unit) => React.element;\n let make: {.. \"initialValue\": option(int)} => React.element;\n}", - "tail": "no" - }, { "start": { "line": 1, @@ -1039,18 +835,6 @@ Closing `` "type": "unit", "tail": "no" }, - { - "start": { - "line": 6, - "col": 4 - }, - "end": { - "line": 8, - "col": 14 - }, - "type": "ReactDOM.domProps", - "tail": "no" - }, { "start": { "line": 6, @@ -1087,18 +871,6 @@ Closing `` "type": "(~initialValue: int=?, unit) => React.element", "tail": "no" }, - { - "start": { - "line": 1, - "col": 32 - }, - "end": { - "line": 10, - "col": 1 - }, - "type": "{\n external makeProps:\n (~initialValue: 'initialValue=?, ~key: string=?, unit) =>\n {.. \"initialValue\": option('initialValue)} = \"\"\n \"����\u0000\u0000\u0000!\u0000\u0000\u0000\u000b\u0000\u0000\u0000!\u0000\u0000\u0000\u001f���A�,initialValue@��A�#key@��@@@\";\n let make: (~initialValue: int=?, unit) => React.element;\n let make: {.. \"initialValue\": option(int)} => React.element;\n}", - "tail": "no" - }, { "start": { "line": 1, diff --git a/ppx/test/uppercase.t/run.t b/ppx/test/uppercase.t/run.t index d88343a7c..8636080d9 100644 --- a/ppx/test/uppercase.t/run.t +++ b/ppx/test/uppercase.t/run.t @@ -47,18 +47,6 @@ Let's test hovering over parts of the component "type": "React.element", "tail": "no" }, - { - "start": { - "line": 12, - "col": 28 - }, - "end": { - "line": 16, - "col": 3 - }, - "type": "{.. \"children\": React.element}", - "tail": "no" - }, { "start": { "line": 12, @@ -83,18 +71,6 @@ Let's test hovering over parts of the component "type": "(~children: React.element) => React.element", "tail": "no" }, - { - "start": { - "line": 10, - "col": 19 - }, - "end": { - "line": 17, - "col": 1 - }, - "type": "{\n external makeProps:\n (~children: 'children, ~key: string=?, unit) =>\n {.. \"children\": 'children} = \"\"\n \"����\u0000\u0000\u0000\u001c\u0000\u0000\u0000\u000b\u0000\u0000\u0000\u001f\u0000\u0000\u0000\u001e���A�(children��A�#key@��@@@\";\n let make: (~children: React.element) => React.element;\n let make: {.. \"children\": React.element} => React.element;\n}", - "tail": "no" - }, { "start": { "line": 10, diff --git a/test/blackbox-tests/useCallback.t b/test/blackbox-tests/useCallback.t index c77fa812f..58749b525 100644 --- a/test/blackbox-tests/useCallback.t +++ b/test/blackbox-tests/useCallback.t @@ -24,12 +24,10 @@ const React = require("react"); const cb = React.useCallback((function (a, b) { - return a + b | 0; - }), []); + return a + b | 0; + }), []); - module.exports = { - cb, - } + exports.cb = cb; /* cb Not a pure module */ Using an Uncurried function: @@ -47,11 +45,9 @@ Using an Uncurried function: const React = require("react"); const cb = React.useCallback((function (a, b) { - return a + b | 0; - }), []); + return a + b | 0; + }), []); - module.exports = { - cb, - } + exports.cb = cb; /* cb Not a pure module */ From 47a21b996bf50e617883e79dfd8599c57326d480 Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Mon, 24 Feb 2025 04:06:48 -0800 Subject: [PATCH 2/2] update setup-ocaml to v3 (#878) --- .github/workflows/opam.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/opam.yml b/.github/workflows/opam.yml index 28fbb0456..85928d62a 100644 --- a/.github/workflows/opam.yml +++ b/.github/workflows/opam.yml @@ -49,7 +49,7 @@ jobs: key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }} - name: Use OCaml ${{ matrix.ocaml-compiler }} - uses: ocaml/setup-ocaml@v2 + uses: ocaml/setup-ocaml@v3 with: ocaml-compiler: ${{ matrix.ocaml-compiler }} dune-cache: true