Live data from Hacker News

Implementing React from Scratch

rob.directory

11–18 of 18 posts

Re: Implementing React from Scratch

#11
post #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 ent…

This is very cool, first time I'm hearing of Reactor, thanks for sharing

Re: Implementing React from Scratch

#12
Nice! I did a similar project, more focused on creating an Elm architecture framework in TypeScript here[1]). I based it on implementing virtual-dom logic for both Elm codebases and Derw's renderer. Since it's a decent amount of code, I couldn't find a good way to represent it in a blog post, and ended up making a commit-by-commit example on Github instead. Since it's FP-focused, it doesn't support useEffect/useState like this post, but rather has an external subscription/message system instead.

It does support server-side-rendering, hydratation, and async events. It's a bit different in implementation in the OP's post, but I think the most important thing any reader should take away is that at the core, virtual-doms can be quite simple with plenty of room for further optimization.

[1] - https://github.com/eeue56/make-your-own-tea/pull/1

Re: Implementing React from Scratch

#13
post #12

Nice! I did a similar project, more focused on creating an Elm architecture framework in TypeScript here[1]). I based it on implementing virtual-dom logic for both Elm codebases and Derw's renderer. Since it's a decent amount of code, I couldn't find a good way to represent it in a blog post, and ended up making a commit-by-commit example on Github instead. Since it's FP-focused, it doesn't support useEffect/useState…

Just went through each commit- this is an extremely engaging way to document a project, nice work

Re: Implementing React from Scratch

#14
post #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 ent…

This is very cool, first time I'm hearing of Reactor, thanks for sharing

Check https://docs.sciter.com/docs/Reactor/

Re: Implementing React from Scratch

#15
post #6

Earlier quoted context omitted.

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.

Yah lol, agreed

Re: Implementing React from Scratch

#16
post #12

Nice! I did a similar project, more focused on creating an Elm architecture framework in TypeScript here[1]). I based it on implementing virtual-dom logic for both Elm codebases and Derw's renderer. Since it's a decent amount of code, I couldn't find a good way to represent it in a blog post, and ended up making a commit-by-commit example on Github instead. Since it's FP-focused, it doesn't support useEffect/useState…

Just went through each commit- this is an extremely engaging way to document a project, nice work

Woah, you are so right. I should try this out sometime

Re: Implementing React from Scratch

#17
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.

Your boss will hate it much more when the React-Tailwind-DaisyUI-datatable that imports 150 other npm packages becomes a massive security liability

Re: Implementing React from Scratch

#18
post #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 ent…

This is cool, but how big are the practical advantages (performance?)?
Post reply on HN