Live data from Hacker News

Show HN: Under the hood ReactJS

bogdan-lyashenko.github.io

101–110 of 124 posts

Re: Show HN: Under the hood ReactJS

#101

Earlier quoted context omitted.

I appreciate your attempt, but we don't need any more astronaut-architects. We have the tools. It's 2017 and high time for JavaScript tooling to finally slow down a bit and settle into its bigger britches.

>Astronaut-architects Facebook can come out with a project that's over 40k lines of code, and it is "extremely simple". But no, it is me with my little 5kb function who is the "astronaut-architect". >It's 2017 I don't care what year it is, you act like the current frameworks are the only viable options in the future. Hint: they aren't.

Let's revisit this in 2020. I have a strange feeling that React will still be heavily used (though maybe encroached by some future framework, you are correct about the changing landscape!) with Angular still trying to follow the leader.

Re: Show HN: Under the hood ReactJS

#102
post #79

Earlier quoted context omitted.

this is exactly how CSS works as well I beg to differ. There is no mapping needed for CSS. CSS works by once defining where the style shall go: And once what the style is: .city {color: blue; font-family: arial;} Similar, template syntax once defines where the data shall go: {{NAME}} has {{POPULATION}} residents And once, what the data is: city={name: "New York", population: 8491000} Neither need additional mapping.

I'm not sure I understand what you mean by additional mapping. Here's all that's needed in the template: has residents And the mapping would be: [ 'city': [ '.city', { name: '.name', population: '.population' } ] ] If you don't want to manually define a mapping, you could do it automatically by assuming that some attribute like `data-bind` corresponds to a binding, but Simulacra.js doesn't make assumptions like that.

    you could do it automatically by assuming that some
    attribute like `data-bind` corresponds to a binding
Yes, that could be done. That would mean to extend Simulacra. Or do it outside of it.

To me personally, {{NAME}} is easier to read and reason about. Also, it enables you to do stuff like

    {{CITY}} has {{POPULATION}} residents 
Which is much shorter then

     has  residents
You can also do other useful stuff. For example:

    {{MACHINE}}
And then style different statuses via CSS.

Re: Show HN: Under the hood ReactJS

#103
post #35

Nice work, but some parts make as much sense as Lorem ipsum text. One of my favorites so far: > An instance of what should be created (03)? Component… right, but which one? Well, it’s a good point. No, not that’s 100% :) We actually should instantiate some internal class. Let’s check out the next scheme at first.

thanks, fixed that.

Re: Show HN: Under the hood ReactJS

#104

At this point I'm sure I and others sound like a broken record, but if you're new and just jumping into frontend component-based frameworks, please don't start with React. There are simpler ways to get reasonably fast re-usable components on your project that introduce less accidental complexity. Carefully consider which thing you actually need: - A view library that uses components as the main building block (this u…

I still love knockout. A simple view layer on top of whatever other architecture you want. Has worked really well for me for years.

Re: Show HN: Under the hood ReactJS

#105

Earlier quoted context omitted.

This is very specific architecture for a very specific product. I really don't think that I can learn anything from all these UML diagrams. I was just wondering what the author had in mind.

Still not really a UML diagram. It's a flow chart. Of course if javascript programmers encapsulated things with actual objects then maybe UML would be applicable.

flow chart != UML activity diagram?

Re: Show HN: Under the hood ReactJS

#108
I don't know how long it will take, but I'd bet that within a few years everyone will be hating on React like they hate on jQuery now.

"Seriously dude, you're still using React? That slow, bloated pig that creates a call stack 75 frames deep to change the label text of a button? Sheesh, get with the times, and use _____.js! It rocks!"

Re: Show HN: Under the hood ReactJS

#109
post #77
post #8

Earlier quoted context omitted.

FWIW a React lead said Inferno is how they would've designed React if they had to do it from scratch, and it's author joined Facebook to push React efforts forward.

So does that mean inferno is both theoretically better and already dead? :(

Hehe. I think it's Open Source at play: X publishes an innovative method, Y iterates with a cleaner version benefiting from lessons-learnt, X says "awesome, let's join forces!" and they live together happily thereafter. Inferno passed over to another lead who's pushing it forward.

IMO this is a good outcome: there is some marginal value in yet another "React-like but faster" library, but the same energy could help a lot more people if applied directly to the source of the madness.

Re: Show HN: Under the hood ReactJS

#110

Earlier quoted context omitted.

>Astronaut-architects Facebook can come out with a project that's over 40k lines of code, and it is "extremely simple". But no, it is me with my little 5kb function who is the "astronaut-architect". >It's 2017 I don't care what year it is, you act like the current frameworks are the only viable options in the future. Hint: they aren't.

Let's revisit this in 2020. I have a strange feeling that React will still be heavily used (though maybe encroached by some future framework, you are correct about the changing landscape!) with Angular still trying to follow the leader.

If Angular is trying to follow React (which I'm supposing is "the leader"), it is doing a very crap job of it. I'd say Mithril is following React, but I wouldn't say that about Angular.
Post reply on HN