Remix.run Logo
austin-cheney 10 hours ago

This has never been true for me. I never end up writing any kind of internal framework. Instead I write libraries that solve specific problems and achieve code reuse, which are really either functions or data storage objects restricted to their own files. At least, that’s how I think about code universally, libraries, but specifically in the browser this comes up less because the problem space is much smaller. Really in the browser it’s all about organizing code around event handling and putting text on screen. Let’s not over think this.

Anyways this idea of internal frameworks has always been weird to me. Nobody says this of code outside the browser, so why would they say this inside the browser? When I think about in those terms this clearly becomes a simple organizational problem and I don’t need a framework telling me how to organize things like a parent telling me to do chores.

WA 8 hours ago | parent [-]

What code are you using to reactively render state? Or do you write all DOM manipulations manually and just accept the problem of state explosion?

austin-cheney 7 hours ago | parent [-]

Here is an example: /lib/dashboard/dashboard_script.ts

https://github.com/prettydiff/webserver

When you aren’t using framework like components state restoration is a single function that runs only on page load. There is no state explosion and on localhost the SPA fully renders and finishes state restoration in about 105ms from http request.

WA 5 hours ago | parent | next [-]

Thanks, but this is a server-side thing and has nothing to do with client-side DOM manipulation?! Sure, you can put stuff on the server and do HTTP over the wire. It's oftentimes the better solution. But there are apps/tools that are rightfully an SPA (like tldraw or excalidraw for example) and can run local-first and offline in a browser. You build the entire app in JS and you'd need a bit more than vanilla Web components for that if you want to avoid client-side state explosion.

austin-cheney 4 hours ago | parent [-]

Look at the file path I specified. That file runs only in the browser.

brazukadev 5 hours ago | parent | prev [-]

Mate, if you are proud and happy to code this way, congratulations. That code is an absolute nightmare tho. Your eyes are trained on it so you think this is as good as an ergonomic framework.

austin-cheney 4 hours ago | parent [-]

How would you refactor it?

brazukadev 36 minutes ago | parent [-]

Is it some bundled code or those ~4k lines are written just for that case? You don't reuse even your own code?

I would start by organizing the code in a sane and logical way. But that's why I said, if you enjoy coding this way, great.