Skip to content

Commit 1f70005

Browse files
committed
group Jsx modules
1 parent 352fa02 commit 1f70005

18 files changed

+100
-48
lines changed

lib/es6/Jsx.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1-
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
1+
2+
3+
4+
let DOMStyle;
5+
6+
let Event;
7+
8+
let DOM;
9+
10+
export {
11+
DOMStyle,
12+
Event,
13+
DOM,
14+
}
15+
/* No side effect */

lib/es6/Jsx_common.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */

lib/js/Jsx.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
1+
'use strict';
2+
3+
4+
let DOMStyle;
5+
6+
let Event;
7+
8+
let DOM;
9+
10+
exports.DOMStyle = DOMStyle;
11+
exports.Event = Event;
12+
exports.DOM = DOM;
13+
/* No side effect */

lib/js/Jsx_common.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */

runtime/Jsx.res

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,7 @@
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2424

25-
@notUndefined
26-
type element
27-
28-
@val external null: element = "null"
29-
30-
external float: float => element = "%identity"
31-
external int: int => element = "%identity"
32-
external string: string => element = "%identity"
33-
34-
external array: array<element> => element = "%identity"
35-
36-
type componentLike<'props, 'return> = 'props => 'return
37-
type component<'props> = componentLike<'props, element>
38-
39-
/* this function exists to prepare for making `component` abstract */
40-
external component: componentLike<'props, element> => component<'props> = "%identity"
25+
include Jsx_common
26+
module DOMStyle = JsxDOMStyle
27+
module Event = JsxEvent
28+
module DOM = JsxDOM

runtime/JsxDOM.res

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2424

25+
@@deprecated("Use `Jsx.DOM` instead.")
2526
type style = JsxDOMStyle.t
2627
type domRef
2728
/**
@@ -38,7 +39,7 @@ type popoverTargetAction = | @as("toggle") Toggle | @as("show") Show | @as("hide
3839
*/
3940
type domProps = {
4041
key?: string,
41-
children?: Jsx.element,
42+
children?: Jsx_common.element,
4243
ref?: domRef,
4344
/* accessibility */
4445
/* https://www.w3.org/TR/wai-aria-1.1/ */

runtime/JsxDOMStyle.res

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2424

25+
@@deprecated("Use `Jsx.DOMStyle` instead.")
2526
type t = {
2627
/**
2728
See [`accent-color`](https://developer.mozilla.org/docs/Web/CSS/accent-color) on MDN.

runtime/JsxEvent.res

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2424

25+
@@deprecated("Use `Jsx.Event` instead.")
2526
type synthetic<'a>
2627

2728
module MakeEventWithType = (

runtime/Jsx_common.res

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* Copyright (C) 2022- Authors of ReScript
2+
*
3+
* This program is free software: you can redistribute it and/or modify
4+
* it under the terms of the GNU Lesser General Public License as published by
5+
* the Free Software Foundation, either version 3 of the License, or
6+
* (at your option) any later version.
7+
*
8+
* In addition to the permissions granted to you by the LGPL, you may combine
9+
* or link a "work that uses the Library" with a publicly distributed version
10+
* of this file to produce a combined library or application, then distribute
11+
* that combined work under the terms of your choosing, with no requirement
12+
* to comply with the obligations normally placed on you by section 4 of the
13+
* LGPL version 3 (or the corresponding section of a later version of the LGPL
14+
* should you choose to use a later version).
15+
*
16+
* This program is distributed in the hope that it will be useful,
17+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
* GNU Lesser General Public License for more details.
20+
*
21+
* You should have received a copy of the GNU Lesser General Public License
22+
* along with this program; if not, write to the Free Software
23+
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
24+
25+
@notUndefined
26+
type element
27+
28+
@val external null: element = "null"
29+
30+
external float: float => element = "%identity"
31+
external int: int => element = "%identity"
32+
external string: string => element = "%identity"
33+
34+
external array: array<element> => element = "%identity"
35+
36+
type componentLike<'props, 'return> = 'props => 'return
37+
type component<'props> = componentLike<'props, element>
38+
39+
/* this function exists to prepare for making `component` abstract */
40+
external component: componentLike<'props, element> => component<'props> = "%identity"

tests/analysis_tests/tests/src/expected/Completion.res.txt

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)