tipiirai 2 days ago

Author coming out here: Types matter, and Nue’s take is to use them where they truly shine. Adding them to naturally untyped spots like HTML or CSS? That’s just extra weight we can skip.

3
dimal 2 days ago

I prefer types over tests everywhere. If I’m passing props to a component and I get a TypeScript error, that’s a test I didn’t need to write or run. I love finding errors like this at compile time instead of at runtime. Just because HTML and CSS are untyped by default doesn’t say anything about whether types are useful for them. Does Nue have any way to protect against those kinds of errors or does some other architectural decision obviate the need for this kind of protection?

I’m not hating on Nue. At first glance, there’s a lot to like here, but I have to disagree on this point.

tossandthrow 2 days ago

Neither HTML, nor CSS are naturally untyped.

Actually, React is not typed enough.

Looking at the mozilla docs: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sp...

You can see that eg. <span /> is not allowed to hold all types of elelemts.

How awsome weould it be, if th type system actually captures this.

zelphirkalt 2 days ago

I guess many web developers would climb on a roof and throw stones, because then they really needed to learn HTML and using its elements semantically. And probably many of their web components would no longer type check either, forcing them to reimplement or use simpler elements.

tossandthrow 2 days ago

There was a time where front-end devs would have sat down and cried had they had to make closing tags.

joquarky 1 day ago

Ever heard of XHTML?

There's a reason it's dead.

tipiirai 2 days ago

This is a great idea!

troupo 2 days ago

Your views are not "naturally untyped spots like HTML or CSS". They are custom templates with custom syntax and logic. And they would definitely benefit from types.