Live data from Hacker News

Implementing React from Scratch

rob.directory

1–10 of 18 posts

Re: Implementing React from Scratch

#2
I started this project out of interest in building a UI framework for a completely different language/platform inspired by React. Quickly realized I didn’t understand everything React was doing to allow their API. Rebuilding React was extremely useful for learning more about the framework. Hopefully, this article is useful to other people in the same way.

Re: Implementing React from Scratch

#3

I started this project out of interest in building a UI framework for a completely different language/platform inspired by React. Quickly realized I didn’t understand everything React was doing to allow their API. Rebuilding React was extremely useful for learning more about the framework. Hopefully, this article is useful to other people in the same way.

Good on ya. I gave a presentation a few years ago on building Promise from scratch and learned a lot in the process. I’ve always wanted to do the same for React.

Re: Implementing React from Scratch

#4

I started this project out of interest in building a UI framework for a completely different language/platform inspired by React. Quickly realized I didn’t understand everything React was doing to allow their API. Rebuilding React was extremely useful for learning more about the framework. Hopefully, this article is useful to other people in the same way.

Yes, I love “from scratch” series as it follows the trend of Richard Feymans of I can’t do it I can’t understand it thing.

Abramov has a good and old but relevant video series on Redux from scratch too.

Re: Implementing React from Scratch

#6

I started this project out of interest in building a UI framework for a completely different language/platform inspired by React. Quickly realized I didn’t understand everything React was doing to allow their API. Rebuilding React was extremely useful for learning more about the framework. Hopefully, this article is useful to other people in the same way.

Yes, I love “from scratch” series as it follows the trend of Richard Feymans of I can’t do it I can’t understand it thing. Abramov has a good and old but relevant video series on Redux from scratch too.

At my work I try to build everything from scratch but my boss hates it.

Re: Implementing React from Scratch

#7
Just in case:

Sciter has Reactor - its own native and built-in implementation of React.

Main difference is that component is instanceof Element - components are DOM elements. This allows to unify React and WebComponent under the same umbrella/mechanism. Yet to extend standard DOM methods by use of JSX, so this

    someDomElement.append(Hello)
works just fine - appends content from the vDOM.

In fact Reactor is three entities implemented natively:

* JSX - embedded into JS compiler (830 LOC) - https://gitlab.com/c-smile/quickjspp/-/blob/master/quickjs-j... , produces vDOM literals

* Element.prototype.patch(JSX/vDOM) (420 LOC) - reconciliation / diff implementation

* Binding of lifecycle methods (200 LOC) - componentDidMount and Co.

There is also native implementation of Signal's (310 LOC) but they are optional for React'alike functionality.

Re: Implementing React from Scratch

#8
post #6

Earlier quoted context omitted.

Yes, I love “from scratch” series as it follows the trend of Richard Feymans of I can’t do it I can’t understand it thing. Abramov has a good and old but relevant video series on Redux from scratch too.

At my work I try to build everything from scratch but my boss hates it.

as he probably should. but building everything from scratch just is the autistic urge to actually understand what you're doing. not implying you're autistic or anything, but I am and I can't always stop myself from doing the same thing, hehe.

Re: Implementing React from Scratch

#9
post #6

Earlier quoted context omitted.

Yes, I love “from scratch” series as it follows the trend of Richard Feymans of I can’t do it I can’t understand it thing. Abramov has a good and old but relevant video series on Redux from scratch too.

At my work I try to build everything from scratch but my boss hates it.

Also sometimes known as “not invented here syndrome”.

Sometimes it’s useful to know how something works and to be easily able to change every piece of the stack, other times it’s a massive waste of time and the end result is a worse documented and worse developed solution than what hundreds if not thousands of people have built and tested over the years.

Depends on what you’re working on, really, I’ve seen some really unfortunate stuff once people start rolling their own security stuff and it’s not like you can ask StackOverflow about why some random bespoke library or framework is full of weird behaviour.

But for personal learning projects? Go wild!

Re: Implementing React from Scratch

#10
post #6

Earlier quoted context omitted.

Yes, I love “from scratch” series as it follows the trend of Richard Feymans of I can’t do it I can’t understand it thing. Abramov has a good and old but relevant video series on Redux from scratch too.

At my work I try to build everything from scratch but my boss hates it.

Well yeah, don't USE your janky from-scratch libraries at work of there's something written & maintained by a bigger team. It's a learning exercise.
Post reply on HN