fable-compiler / Feliz.JSX

Feliz API for JSX compilation
MIT License
30 stars 1 forks source link

Why is int32ToString needed for numeric props? (SolidJs) #3

Open goswinr opened 1 month ago

goswinr commented 1 month ago

Why is int32ToString needed for numeric props? (SolidJs)

Doesn't Solid work well directly with numeric values in props ?

e.g. Attr.x1

test: https://playground.solidjs.com/anonymous/7523d6dc-9e88-43ab-a493-5421c9482aa4

MangelMaxime commented 1 month ago

This is perhaps just an over site.

I am not so familiar with SolidJS or the JSX module of Fable. I think the best thing to do, is to test if using an int works and if yes then send a PR and make a new release.

Like for Fable.SolidJS, if you want I can give you maintainer access to this repo and the packages.

goswinr commented 1 month ago

Thanks @MangelMaxime I will test changes it in my own fork, and if it works well create a pull request. You gave me maintainer access to the NuGet already 🤓 (but not this repo). But I can't cover the React JSX part 🤷‍♂️.

MangelMaxime commented 1 month ago

But I can't cover the React JSX part 🤷‍♂️.

I don't think it is really used by the community, it is still marked as a beta and no one maintained it since 2022.

So I think it is fine to mark as obsolete or keep it as it is for now. Most of the effort are made using Feliz and if a new package needs to be generated it will probably go under Glutinum project as I am working on experimenting on generating bindings automatically and will perhaps needs to have a custom low level API to make it possible.

goswinr commented 1 month ago

Actually, unquoted number literals work because simply attributes don't need quotation marks. It's in the html spec. (SolidJS will in this case just create it's internal html template for html rendering also without the quotation marks.) https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 :

Unquoted attribute value syntax: The attribute name, followed by zero or more ASCII whitespace, followed by a single U+003D EQUALS SIGN character, followed by zero or more ASCII whitespace, followed by the attribute value, which, in addition to the requirements given above for attribute values, must not contain any literal ASCII whitespace, any U+0022 QUOTATION MARK characters ("), U+0027 APOSTROPHE characters ('), U+003D EQUALS SIGN characters (=), U+003C LESS-THAN SIGN characters (<), U+003E GREATER-THAN SIGN characters (>), or U+0060 GRAVE ACCENT characters (`), and must not be the empty string.