ENGINEERING 45 upvotes 2018

How I built a fast JavaScript framework

45 pts
Hacker News Signal
2018 · Shared by @krapans
How I built a fast JavaScript framework by @krapans

Retrospective Overview & Key Insights

Distilled reflections, business mechanics, and tactical takeaways:

In this technical retrospective (2018), @krapans shares practical architectural lessons learned from running, scaling, or migrating production software under lean constraints.

Core Principles for Independent Builders:
1
Defaulting to simpler architectures (such as monolithic frameworks, SQLite, or managed VPS) prevents early engineering bankruptcy.
2
Evaluating true compute and egress costs reveals that high cloud bills can often be slashed by 80%+ through judicious re-platforming.
3
Code you write at 2 AM as a solo engineer must be easy to debug six months later without complex microservice dependencies.
Community Debate Themes:

HN engineers debated the tradeoffs between cloud convenience and raw server economics, database indexing strategies, and resisting premature architectural complexity.

Community Discussions & Critical Reviews

Key perspectives, counter-arguments, and peer founder insights debated on Hacker News (61 total discussions):

EV @evmar Peer Contributor
JB @jbob2000 Peer Contributor

The reason diffing and virtual doms are used are to prevent unnecessarily repainting the browser window 1000 times a second. If I have 5 updates to make, I want to do those in one paint, instead of 5. So the process is change -> change -> change -> paint.

With this framework's model, the process would be change -> paint -> change -> paint etc. etc. Sure, you get nice FPS (because it's painting a LOT), but that will destroy battery performance on mobile phones and I don't need 60 FPS in my shopping web app.

IA @iamleppert Peer Contributor

I recently did a project with morphdom (https://github.com/patrick-steele-idem/morphdom ↗) using only ES6 template strings and a render loop that checked for changes to a global state object and patched a re-computed DOM string using morphdom. Couldn’t have been an easier and more pleasurable experience.

FW @fwilliams Peer Contributor

I'm not a frontend developer and don't know really know JavaScript frameworks. That said, it seems like something very well established like React would choose to have a virtual DOM for a good reason.

Surely there must be some tradeoffs that the author makes for his design to get better performance. Could somebody explain the cost/benefit of doing things one way versus the other?

HISTORICAL ERA Cloud & Mobile Era (2014–2019)
COMMUNITY SCORE 45 points
TOTAL DISCUSSIONS 61 comments
TOPICS & TECH STACK: