Author here: It’s true—Nue’s view layer is untyped. That’s by design. React’s ecosystem has devs slapping TypeScript on everything—even CSS—which is overkill. Nue flips it: presentation stays clean and semantic, web standards do the heavy lifting, and real static typing (like Rust or Go) shines in business logic where it counts. Thoughts on this?
Jesus, this is a regression not a feature, for christ sake.
Typed CSS via emotion/styled-components is an amazing feature to call it overkill. This alone is enough to dismiss nue.
This seems incredibly shortsighted. If you're building an application by yourself you're gonna remember the relations and dependencies - but even on a small team (say ~4 devs) or even if you don't pick it up after a while, there is going to be stuff you forget.
It's also nice when you move stuff around, you can rely on the LSP to rename and fix everything that breaks. If you have a simple website it's fine, but when you start to have multiple components... Losing typing is a huge deal.
> ... slapping TypeScript on everything—even CSS—which is overkill
Yikes, this framework will never fare well in any decent sized or above project. Even Typescript is problematic sometimes, as it has several forms of coercion. I manage 2 large scale production apps using Typescript (Along with the rest of the infrastructure) with a small team. This simply would not be possible, had I not been guaranteed that things at least type check when reading diffs from PRs.
This is a silly take. There were certainly plenty of large projects written in JS before Typescript existed or became popular, some maintained by small teams or single individuals. There are plenty of large projects written in Python pre-typing, in PHP, etc.
I personally choose to work with typed languages most of the time, and I’m thoroughly convinced of their value, but acting like it is literally impossible to write a large project without types is just inaccurate.
But it would be significantly more expensive. So I should probably preface and say that it is not possible within the budget I have (We are ~2 full time developing and maintaining everything on a 140k LOC platform spanning from infrastructure, backend, multiple frontends).
> There are plenty of large projects written in Python.
There are, but they are certainly a pain in the ass to work with. I once had to work on a semi-large Python codebase and got so frustrated that I wanted to port the code to some other language. The best part? I wrote the majority of that codebase myself, just months earlier. I ranted about it here: https://avi.im/blag/2023/refactoring-python/
I honestly can't see what's wrong with using TypeScript anywhere in place of JavaScript. Unless you're making a simple script or a throwaway prototype, then you're pretty much always better off with it. It's invaluable during development and it's compiled away at build time.
I respect those who use and enjoy TS, but I have less respect for the argument that it should be used in place of JS everywhere.
You’re replacing runtime trust with compile-time trust, but at the cost of flexibility and speed. That’s not always worth it. TypeScript solves problems I stopped having 20 years ago.
Svelte team also switched to JS with JSDoc a few months back[0]. You can see the majority of their repo is JS and not TS[1] The cited reason[2]:
> As a Svelte compiler developer, debugging without a build step greatly simplifies compiler development. Previously, debugging was complicated by the fact that we had to debug using the build step. In addition, using JSDoc does not affect compiler’s development safety because the type is almost equivalent to TS.
There was a lot of noise when this happened. Rich Harris (Svelte team) even had a comment on this on HN[3]. Dev sphere similarly thought they were crazy. But Svelte seems fine and no one seems bothered by this now.
> If you're rabidly anti-TypeScript and think that us doing this vindicates your position, I'm about to disappoint you. Rich and the rest of the Svelte team are still using typscript, just through JSDoc + type definition files. In contrast the Nue team seems to want to keep the view layer untyped. From the parent comment > real static typing (like Rust or Go) shines in business logic where it counts it seems they don't consider typescript to be "real" static typing.
Svelte is a bad example. They have roughly identical type checking before and after that switch. The switch is mostly just an aesthetic preference for one syntax over another and an ideological stance about being able to run code directly in a browser without a build step.
> Svelte team also switched to JS with JSDoc a few months back
1. They still use types via JS Doc 2. They only switched to that for their internal development 3. User-facing code has all the type support and TS support you'd expect > Rich Harris (Svelte team) even had a comment on this on HN[3]. And here's literally what he said: --- start quote --- Firstly: we are not abandoning type safety or anything daft like that — we're just moving type declarations from .ts files to .js files with JSDoc annotations. As a user of Svelte, this won't affect your ability to use TypeScript with Svelte at all — functions exported from Svelte will still have all the same benefits of TypeScript that you're used to (typechecking, intellisense, inline documentation etc). Our commitment to TypeScript is stronger than ever --- end quote --- Compare that to Nue's author's take
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.
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. is not allowed to hold all types of elelemts. How awsome weould it be, if th type system actually captures this.
It's also nice when you move stuff around, you can rely on the LSP to rename and fix everything that breaks. If you have a simple website it's fine, but when you start to have multiple components... Losing typing is a huge deal.
Yikes, this framework will never fare well in any decent sized or above project.
Even Typescript is problematic sometimes, as it has several forms of coercion.
I manage 2 large scale production apps using Typescript (Along with the rest of the infrastructure) with a small team.
This simply would not be possible, had I not been guaranteed that things at least type check when reading diffs from PRs.
I personally choose to work with typed languages most of the time, and I’m thoroughly convinced of their value, but acting like it is literally impossible to write a large project without types is just inaccurate.
But it would be significantly more expensive.
So I should probably preface and say that it is not possible within the budget I have (We are ~2 full time developing and maintaining everything on a 140k LOC platform spanning from infrastructure, backend, multiple frontends).
Continue this thread — 3 replies
I've worked on one of those, and I would not recommend it.
There are, but they are certainly a pain in the ass to work with.
I once had to work on a semi-large Python codebase and got so frustrated that I wanted to port the code to some other language. The best part? I wrote the majority of that codebase myself, just months earlier.
I ranted about it here: https://avi.im/blag/2023/refactoring-python/
Continue this thread — 3 replies
Just a nit. Modern PHP is typed and has been for years.
You’re replacing runtime trust with compile-time trust, but at the cost of flexibility and speed. That’s not always worth it.
TypeScript solves problems I stopped having 20 years ago.
Svelte team also switched to JS with JSDoc a few months back[0].
There was a lot of noise when this happened. Rich Harris (Svelte team) even had a comment on this on HN[3]. Dev sphere similarly thought they were crazy. But Svelte seems fine and no one seems bothered by this now.You can see the majority of their repo is JS and not TS[1]
The cited reason[2]:
As long as author ships type def, it should behave just like a TypeScript library for all intents and purposes.
[0] https://news.ycombinator.com/item?id=35932617
[1] https://github.com/sveltejs/svelte
[2] https://github.com/sveltejs/svelte/pull/8569
[3] https://news.ycombinator.com/item?id=35892250
> If you're rabidly anti-TypeScript and think that us doing this vindicates your position, I'm about to disappoint you.
Rich and the rest of the Svelte team are still using typscript, just through JSDoc + type definition files.
In contrast the Nue team seems to want to keep the view layer untyped.
From the parent comment
> real static typing (like Rust or Go) shines in business logic where it counts
it seems they don't consider typescript to be "real" static typing.
Continue this thread — 22 replies
Continue this thread — 1 reply
Continue this thread — 5 replies
I don’t use svelte, that’s just my understanding from when the TS -> JS switch was announced
1. They still use types via JS Doc
2. They only switched to that for their internal development
3. User-facing code has all the type support and TS support you'd expect
> Rich Harris (Svelte team) even had a comment on this on HN[3].
And here's literally what he said:
--- start quote ---
Firstly: we are not abandoning type safety or anything daft like that — we're just moving type declarations from .ts files to .js files with JSDoc annotations. As a user of Svelte, this won't affect your ability to use TypeScript with Svelte at all — functions exported from Svelte will still have all the same benefits of TypeScript that you're used to (typechecking, intellisense, inline documentation etc). Our commitment to TypeScript is stronger than ever
--- end quote ---
Compare that to Nue's author's take
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. is not allowed to hold all types of elelemts.
How awsome weould it be, if th type system actually captures this.
Continue this thread — 4 replies
Continue this thread — 2 more replies
Continue this thread — 1 more reply
Continue this thread — 13 more replies