You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
web components props converts "12345" to number. Does not respect the typeof.
To Reproduce
inject a prop with a string 12345, the received prop will be a number 12345 instead of string.
Expected behavior
If I prop is string should be string, if prop is number should be a number. Same for other types. Maybe the serializer could handle props with number:... or string:... ??
The text was updated successfully, but these errors were encountered:
And the Brisadeserialize it understands it as “12345”.
To solve it internally in Brisa, the current problem is that all attributes are being serialized, including in HTML elements such as <input value="12345" />, which is not deserialized because it expects a string always even if you put a number.
In order to solve it from Brisa, we would have to use a different serializer when consuming custom elements, which adds a layer of difficulty to make this distinction. Maybe in the client part we can use something like customElements.get(tagName)... And then in the server for SSR we already know the web components. Before implementing this, I want to investigate alternatives. Because this probably is going to increase the client build size, and we have to look for a solution that adds as little bytes as possible (if it can be reduced better, of course), and also does not increase the parse time.
Describe the bug
web components props converts "12345" to number. Does not respect the typeof.
To Reproduce
inject a prop with a string 12345, the received prop will be a number 12345 instead of string.
Expected behavior
If I prop is string should be string, if prop is number should be a number. Same for other types. Maybe the serializer could handle props with number:... or string:... ??
The text was updated successfully, but these errors were encountered: