Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
- Hint about partial application when missing required argument in function call. https://github.com/rescript-lang/rescript/pull/7807
- More autocomplete improvements involving modules and module types. https://github.com/rescript-lang/rescript/pull/7795
- Autocomplete `@react.componentWithProps` attribute. https://github.com/rescript-lang/rescript/pull/7812
- Add some missing iframe attributes to `domProps`. https://github.com/rescript-lang/rescript/pull/7813

#### :house: Internal

Expand Down
6 changes: 6 additions & 0 deletions packages/@rescript/runtime/JsxDOM.res
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ type domProps = {
key?: string,
children?: Jsx.element,
ref?: domRef,
// https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/iframe#allow
allow?: string,
/* accessibility */
/* https://www.w3.org/TR/wai-aria-1.1/ */
/* https://accessibilityresources.org/<aria-tag> is a great resource for these */
Expand Down Expand Up @@ -203,6 +205,8 @@ type domProps = {
formAction?: string /* uri */,
formTarget?: string /* "_blank", "_self", etc. */,
formMethod?: string /* "post", "get", "put" */,
// https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/iframe#frameborder
frameBorder?: int /* "0", "1" */,
headers?: string,
height?: string /* in html5 this can only be a number, but in html4 it can ba a percentage as well */,
high?: int,
Expand Down Expand Up @@ -517,6 +521,8 @@ type domProps = {
primitiveUnits?: string,
r?: string,
radius?: string,
// https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/iframe#referrerpolicy
referrerPolicy?: string,
refX?: string,
refY?: string,
renderingIntent?: string,
Expand Down
2 changes: 1 addition & 1 deletion tests/analysis_tests/tests/src/expected/Completion.res.txt

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions tests/tests/src/jsx_preserve_test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,16 @@ let _fragment = <Fragment>
{"Hello, world!"}
</Fragment>;

let _youtube_iframe = <iframe
allow={"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"}
allowFullScreen={true}
frameBorder={0}
height={"1075"}
src={"https://www.youtube.com/embed/dQw4w9WgXcQ"}
width={"1911"}
referrerPolicy={"strict-origin-when-cross-origin"}
/>;

export {
Icon,
_single_element_child,
Expand Down Expand Up @@ -242,5 +252,6 @@ export {
_props_with_hyphen,
React,
_fragment,
_youtube_iframe,
}
/* _single_element_child Not a pure module */
11 changes: 11 additions & 0 deletions tests/tests/src/jsx_preserve_test.res
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,14 @@ module React = {
}

let _fragment = <> {Jsx.string("Hello, world!")} </>

let _youtube_iframe =
<iframe
width="1911"
height="1075"
src="https://www.youtube.com/embed/dQw4w9WgXcQ"
frameBorder={0}
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerPolicy="strict-origin-when-cross-origin"
allowFullScreen={true}>
</iframe>
Loading