Lurker News

Comments (568) 81 threads

Show all comments

Showing thread 2 of 81

davedx5 replies#
This is what they're replacing react with: https://nuejs.org/docs/view.html

It's an untyped view layer kind of along the lines of early angular 2.0.
The model files are plain javascript.
So no typings anywhere. Which is fine, I guess this is targeting the vuejs crowd. Maybe their marketing should pivot a little bit in that direction, most react people now use TypeScript because first class types in your view layer are super useful

bigjump#
Most of the Vue devs I know, also use TypeScript for the same reasons.
tipiirai22 replies#
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?
seivan#
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.
isqueiros1 reply#
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.

joquarky#
WebStorm and the like do a fine job inferring types, saving me a lot of time.
dalmo3#
That's one way to find a niche audience.
tossandthrow1 reply#
> ... 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.

mplanchard11 replies#
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.

Continue this thread — 11 replies

mmkos1 reply#
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.
joquarky#
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.

jack_riminton#
Uh oh, you've summoned the typesetters
ko273 replies#
Having the author come out and say that being untyped is a feature, is definitely one way to kill of any potential interest for that framework.
CharlieDigital34 replies#
For the record, author is not crazy.

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.

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

Continue this thread — 34 replies

tipiirai7 replies#
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.

Continue this thread — 7 replies

joquarky#
Some people like things that you might not like.
anentropic#
I am not on the React bandwagon, currently using HTMX

But I would very much prefer to see TypeScript in a framework. Optional TS is ok but "untyped by design" feels like an anti-pattern, even HTMX has TS types available.

davedx#
I worked with react before typescript, react with flow, angular 1 (large projects), and these days I mostly use react with typescript.

I don’t use it for css, but for the view components and code I find typescript actually makes me both faster and my code is more reliable. To me this is one of the killer features of react that other libraries are in various stages of catching up to: full static type checking end to end. (Also through the API to the backend with a little more work).

turnsout#
At that point, why not just use vanilla JS and no framework? Literally zero build time and zero bytes of framework code. And it's fast as hell.
herrherrmann#
I agree with most other commenters: Type safety is a great feature to have. And to intentionally dismiss it or only grant it to certain aspects of the application (where does business logic start and end anyway?) is a really bad sign for me.
arewethereyeta#
how can "not typed" be "by design" and presented to us as a feature. Your project looked interesting but your presentation here makes me have big doubts
mexicocitinluez1 reply#
> React’s ecosystem has devs slapping TypeScript on everything—even CSS—which is overkill

"We don't use Typescript because there are people that exist who use it for CSS when using React" is one hell of an argument that makes absolutely zero sense.

ellinoora4 replies#
Making zero sense of your own take of the argument makes absolutely zero sense

Continue this thread — 4 replies

littlecranky67#
I pretty much enjoy using MaterialUI with React (MUI) and have statically typed CSS: `` - I get full IntelliSense/autocompletion for the sx props (i.e. alignItems when typing 'al') and their value (i.e. 'center' when typing 'c') etc. Sx-props are composable, so you can centralize common used sx/css etc.

Any typos or invalid props/value will result in a compiler error.

madeofpalk#
> slapping TypeScript on everything—even CSS—which is overkill

Nope. Hard disagree. I want the developer experience of autocompletion of CSS variables, and I want build errors when someone makes a mistake.
Type everything.

Continue this thread — 7 more replies

Continue this thread — 3 more replies