rescript-lang/rescript-compiler

Convert JsxDOM.ml to JsxDOM.res and add missing aria attributes

cknitt opened this issue ยท 9 comments

E.g.

  @as("aria-haspopup")
  ariaHaspopup: [#"false" | #"true" | #menu | #listbox | #tree | #grid | #dialog],

But the .ml -> .res transition is not so easy because of #5706 (comment).

Note that #"true" will become the string 'true' in JS, not the boolean value true.

But as aria-haspopup is defined as

'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | undefined;

according to the TypeScript typedef, the strings 'false' and 'true' instead of the boolean values should work fine, too.

The other aria attributes have similar definitions.

Note that #"true" will become the string 'true' in JS, not the boolean value true.

But as aria-haspopup is defined as

'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | undefined;

according to the TypeScript typedef, the strings 'false' and 'true' instead of the boolean values should work fine, too.

The other aria attributes have similar definitions.

AFAIK, "true" and "false" are fine for the attribute value. Can you share where the aria-haspopup defines as boolean?

@cristianoc Thanks to #5714 , can we try to rewrite the jsxDOM.ml to res? I know that the new syntax of extension record would be introduced and make rewriting job much easier. Just to check if res is allowed now.

Yes .res files should be good to go now.

Done in #5723, closing! ๐ŸŽ‰