Skip to content

group Jsx modules #7347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 15 additions & 1 deletion lib/es6/Jsx.js
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */



let DOMStyle;

let Event;

let DOM;

export {
DOMStyle,
Event,
DOM,
}
/* No side effect */
1 change: 1 addition & 0 deletions lib/es6/Jsx_common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
14 changes: 13 additions & 1 deletion lib/js/Jsx.js
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
'use strict';


let DOMStyle;

let Event;

let DOM;

exports.DOMStyle = DOMStyle;
exports.Event = Event;
exports.DOM = DOM;
/* No side effect */
1 change: 1 addition & 0 deletions lib/js/Jsx_common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
20 changes: 4 additions & 16 deletions runtime/Jsx.res
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */

type element
type ref

@val external null: element = "null"

external float: float => element = "%identity"
external int: int => element = "%identity"
external string: string => element = "%identity"

external array: array<element> => element = "%identity"

type componentLike<'props, 'return> = 'props => 'return
type component<'props> = componentLike<'props, element>

/* this function exists to prepare for making `component` abstract */
external component: componentLike<'props, element> => component<'props> = "%identity"
include Jsx_common
module DOMStyle = JsxDOMStyle
module Event = JsxEvent
module DOM = JsxDOM
3 changes: 2 additions & 1 deletion runtime/JsxDOM.res
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */

@@deprecated("Use `Jsx.DOM` instead.")
type style = JsxDOMStyle.t
type domRef
/**
Expand All @@ -38,7 +39,7 @@ type popoverTargetAction = | @as("toggle") Toggle | @as("show") Show | @as("hide
*/
type domProps = {
key?: string,
children?: Jsx.element,
children?: Jsx_common.element,
ref?: domRef,
/* accessibility */
/* https://www.w3.org/TR/wai-aria-1.1/ */
Expand Down
1 change: 1 addition & 0 deletions runtime/JsxDOMStyle.res
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */

@@deprecated("Use `Jsx.DOMStyle` instead.")
type t = {
/**
See [`accent-color`](https://developer.mozilla.org/docs/Web/CSS/accent-color) on MDN.
Expand Down
1 change: 1 addition & 0 deletions runtime/JsxEvent.res
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */

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

module MakeEventWithType = (
Expand Down
40 changes: 40 additions & 0 deletions runtime/Jsx_common.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* Copyright (C) 2022- Authors of ReScript
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* In addition to the permissions granted to you by the LGPL, you may combine
* or link a "work that uses the Library" with a publicly distributed version
* of this file to produce a combined library or application, then distribute
* that combined work under the terms of your choosing, with no requirement
* to comply with the obligations normally placed on you by section 4 of the
* LGPL version 3 (or the corresponding section of a later version of the LGPL
* should you choose to use a later version).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */

type element
type ref

@val external null: element = "null"

external float: float => element = "%identity"
external int: int => element = "%identity"
external string: string => element = "%identity"

external array: array<element> => element = "%identity"

type componentLike<'props, 'return> = 'props => 'return
type component<'props> = componentLike<'props, element>

/* this function exists to prepare for making `component` abstract */
external component: componentLike<'props, element> => component<'props> = "%identity"
2 changes: 1 addition & 1 deletion tests/analysis_tests/tests/src/expected/Completion.res.txt

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading