-
Notifications
You must be signed in to change notification settings - Fork 469
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
base: master
Are you sure you want to change the base?
group Jsx
modules
#7347
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests/analysis_tests/tests-generic-jsx-transform/src/GenericJsx.res
Outdated
Show resolved
Hide resolved
runtime/Jsx.res
Outdated
module Event = JsxEvent | ||
module DOM = { | ||
type style = DOMStyle.t | ||
type domRef |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is problematic that the types defined here (other than style
) are different from those in JsxDOM
. They should all be aliases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JsxDOM.domProps.children
is of type Jsx.element
, defining a alias here creates a cyclic dependency Jsx.cmj -> JsxDOM.cmj -> Jsx.cmj
Unless we create a file Jsx_common.res
to put the common values/types
25f43c3
to
668ccb3
Compare
rescript
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/win32-x64
@rescript/darwin-arm64
commit: |
// Define this as a private empty record so that the compiler does not | ||
// unnecessarily add `Primitive_option.some` calls for optional props. | ||
type element = private {} | ||
|
||
@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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to Jsx_common.res
to avoid cyclic dependency.
Creates a top-level module for
Jsx
. It contains the following submodules:Jsx.DOMStyle
Jsx.Event
Jsx.DOM
Deprecate
JsxDOM.res
,JsxDOMStyle
andJsxEvent
With these changes we can have a section in the sidebar menu for the
Jsx
module containingDOM
,DOMStyle
andEvent