Live data from Hacker News

Why I don't miss React: a story about using the platform

jackfranklin.co.uk

261–270 of 279 posts

Re: Why I don't miss React: a story about using the platform

#261

Earlier quoted context omitted.

I use Lit every day and I have no idea what you're talking about. Any property can be a full JS object. When the property is changed, it is re-rendered in your component. I have never touched innerHtml and my Lit apps pass and render all kinds of stuff into html`` tagged templates. It's really pure magic because you can freely mix regular old HTML and regular attributes with dynamic data and data binding. There's mor…

> I use Lit every day and I have no idea what you're talking about. I'm talking about how lit is implemented internally and that's why I provided links to relevant parts of lit's code. People having no idea how things work is the bane of our industry. And that's why we have objectively false statements like "regular old HTML and regular attributes with dynamic data and data binding". Lit is almost as far from "regula…

I do understand that string concatenation and DOM rewrites are happening under the hood. How could they not be? But the point of using an abstraction like Lit is that I don't have to worry about that part.

Are you suggesting that Lit is updating .innerHtml when it doesn't need to? And are you sure about that? Because that should be entirely under my control by setting properties or state of the component, not by Lit redrawing them willy-nilly.

Re: Why I don't miss React: a story about using the platform

#262

Earlier quoted context omitted.

> I use Lit every day and I have no idea what you're talking about. I'm talking about how lit is implemented internally and that's why I provided links to relevant parts of lit's code. People having no idea how things work is the bane of our industry. And that's why we have objectively false statements like "regular old HTML and regular attributes with dynamic data and data binding". Lit is almost as far from "regula…

I do understand that string concatenation and DOM rewrites are happening under the hood. How could they not be? But the point of using an abstraction like Lit is that I don't have to worry about that part. Are you suggesting that Lit is updating .innerHtml when it doesn't need to? And are you sure about that? Because that should be entirely under my control by setting properties or state of the component, not by Lit…

> Are you suggesting that Lit is updating .innerHtml when it doesn't need to?

Literally nowhere did I say that. I was responding to a specific thing.

Re: Why I don't miss React: a story about using the platform

#263

Earlier quoted context omitted.

> This will not allow you to build very rich apps without implementing a significant chunk of the frameworks you dislike so much I am currently working on an app at work that wants SPA functionality, but they won't let me use any of the frameworks. Tons of vanilla JS and Jquery. I am sure what I have written is probably considered a crime against humanity in some place. Does it work? Yes. Is it an elegant and maintai…

That raises an interesting question: what would be the declarative framework easiest to minimally reimplement? I’m thinking you could have a single file, jQuery-based, hand rolled version of some framework and get many of the benefits while still technically complying with the “no frameworks” rule. In the same way that you could reimplement Redux easily if you for some reason weren’t allowed to use it. I suspect diff…

I would love something like this, but I do not think I am at the level to be able to build something like this, at least not in a reason amount of time.

I've not used Redux for anything before, but I will look into for sure. I've heard the name thrown around a few times on here, and I could probably use something like that. Just nothing that would require a staunch learning curve to use.

Re: Why I don't miss React: a story about using the platform

#264
post #252

Earlier quoted context omitted.

> This will not allow you to build very rich apps without implementing a significant chunk of the frameworks you dislike so much I am currently working on an app at work that wants SPA functionality, but they won't let me use any of the frameworks. Tons of vanilla JS and Jquery. I am sure what I have written is probably considered a crime against humanity in some place. Does it work? Yes. Is it an elegant and maintai…

Look at the Mithril or Preact codebases and make a basic version of your own.

I will look into these. Thank you for sharing.

I doubt I will be able to roll my own version of whatever these project due mainly because of time constraints and because I am the only developer working on it. Since we have adopted all the Agile stuff, Sprints are basically deadlines and not very...Agile.

Re: Why I don't miss React: a story about using the platform

#265

Earlier quoted context omitted.

Quoting absolutes expressed by highly opinionated people is also for fighting. Not saying you shouldn’t, but maybe there’s some nuance missing. Not even saying the particular analogy was devoid of conflict, it has plenty of room for disagreement. But it didn’t feel to me like it was inviting any which wasn’t already present.

I would classify Scott Adam's statement as a trueism -- true for most people, under most circumstances, for most times. Unfortunately, couching a trueism in its most precise linguistic form with associated probabilities and error margins is a path to simply being ignored. Once a thread switches to rhetoric, dialectic responses are like pissing in the wind, forgive the analogy :-)

Well I’ll give you this: quoting Scott Adams then correctly using and understanding the word dialectic is definitely not on my HN comment threads bingo card.

Re: Why I don't miss React: a story about using the platform

#266

Earlier quoted context omitted.

This is why I felt out with Elm. It is harder to escape the hatches with it.

You can use the ports system and interoperate with js in Elm. I used it in the past and it is quite a clean abstraction.

That is what I mean! You need static top-level declarations of every out-of-elm iteration you want to do.

React on the other hand can wrap a JQuery calendar in a React component and from a programming point of view, using that component you would be none the wiser.

Also ports force everything to be async - and I am not talking just promises - I mean a new render per call response! So calculating 1+1 on a port requires generate a new render, and intercepting the result in a Redux-style handler, bubbling that into a component.

While you won't need to do 1+1 via ports, you might need to use a synchronous web-api feature that has not been ported to elm, or even use a math package to multiply some matrices.

Re: Why I don't miss React: a story about using the platform

#267
post #188

Earlier quoted context omitted.

This is why I felt out with Elm. It is harder to escape the hatches with it.

you dont escape hatches; you escape THROUGH the hatches

So not \h\a\t\c\h\e\s ?

Re: Why I don't miss React: a story about using the platform

#268

Earlier quoted context omitted.

I mean, not really? My naive implementation in Solid required a few tweaks understanding the model and performs updates perceptually instantaneously on a perf sensitive input I use as a smoke test, without any of the tricks I expected to need, just its built in reactive primitives. The existing implementation performs the same computations on that data in about half a second, which feels like an eternity without spec…

Every programming language and application has the chance to become unusable, thus every JavaScript application has the opportunity to become unusable, obviously most do not because otherwise nothing would be usable on the Internet which, snark aside, things are usable even if they might annoy me. >You just have to know how to use it, and when not to. So, you have never had a JS application delivered over the web bec…

> So, you have never had a JS application delivered over the web become unusable despite your attempts to only use it how and when you need to?

Of course I have, that’s not the point I was making. My point was that JS and the VMs it runs on are very fast, if you know how to use the language and when not to use it. That couldn’t possibly apply to apps you didn’t build. If I’d said C or whatever is fast if you know how to use it, I don’t think I’d get this comment about some horribly inefficient downloaded printer driver.

Re: Why I don't miss React: a story about using the platform

#269
post #215

Earlier quoted context omitted.

You can react to state changes with an astonishingly small amount of code with JS [0] [0]: https://github.com/curlywurlycraig/vdom-util/blob/master/src...

Link doesn't work for me. 404s

Apologies, should be good now.

Re: Why I don't miss React: a story about using the platform

#270

Both React and Lit's approach (that requires schedulers and user uncontrolled updates) are completely unnecessary for most if not all of the applications currently using React and I bet nobody even knows why they exist. Facebook made React like this because of these requirements: they wanted their chat application that requires various real time small updates to multiple parts of the page to run quickly where a wipe…

Would love to see some comparison between yours and React, Svelte, Riot, Angular and Vue (or others)

For comparison, just read this: https://mithril.js.org/framework-comparison.html

Personally I prefer mithril or Soild over all other front-end framework. They light and fast. And Mithril author had in depth knowelge of the other frameworks.

Post reply on HN