ENGINEERING ★ 91 upvotes 2021

The new browser-based puppeteer REPL, and how we built it

Retrospective Overview & Key Insights

Distilled analysis of the business dynamics, operational challenges, and strategic takeaways:

In this technical retrospective (2021), @mrskitch 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.

Founder's Discussion Replies (@mrskitch)

Direct clarifications and follow-up comments shared by the author during the live discussion:

OP @mrskitch Original Author
2021

Hey, Joel here, mostly responsible for this tool. Happy to answer questions — one thing not well covered is getting puppeteer to run in the browser, especially a webworker. Can talk more about it if there’s interest!

Community Discussions & Critical Reviews

High-signal perspectives, counter-arguments, and peer founder insights debated on Hacker News (30 total discussions):

CE @celerity Peer Contributor

Nice! We built something like this 3 years ago while I was still at Intoli. Instead of Puppeteer we used our own Web Extensions API based framework called Remote Browser [1], the core of which was written by my cofounder.

The tour is still up at [2]. The servers that actually run the Remote Browser have since gone down, but interestingly you can still run the tour. That's because if you don't change the code in the REPL window, you get cached results (except step 7/7 which scrapes Hacker News and won't work). To get those results, we built a little tour "recorder" that would be run on every release. If I remember correctly, we allowed some dynamic ES6 imports through a custom Babel compiler for the code that's input, which also allows first level async stuff, which still works :)

[1]: https://github.com/intoli/remote-browser [2]: https://intoli.com/tour/

HA @haolez Peer Contributor

I've used Puppeteer extensively and its the most unstable tool that I've come across in recent years. Its full of race conditions and the waitForSomething functions will sometimes work, sometimes not.

It's usable, but it's very aggravating and uncomfortable to use.

NI @nicwhittle Peer Contributor

Could you elaborate a little on ‘puppeteer in the browser’?

Is puppeteer running on a webserver then the repl connecting to it? Or is puppeteer completely contained within each users browser?

SL @slig Peer Contributor

Hey, I have a question. On your home page it says that the usage-based plan doesn't offer the Live Debug, how does one debug scripts on that plan?

HT @httgp Peer Contributor

Does this run Puppeteer on Lambda/Docker? One thing that I’m struggling to do is run Chromium on AWS Lambda as the new container image.

HISTORICAL ERA Pandemic Bubble (2020–2022)
COMMUNITY SCORE ★ 91 points
TOTAL DISCUSSIONS 30 comments
TOPICS & TECH STACK: