Hacker News new | ask | show | jobs
by throwaway0asd 1285 days ago
* Transmission - I am using HTTP to request assets into the page, I have managed to reduce my total asset requests down to only 4. Other than that I am using websockets for absolutely everything, because the way I am using websockets is 8x faster than HTTP. Its like all the benefits of gRPC without the frustration of protobuf. It isn't just faster its also way easier to manage from the application code because there is no round trip and no callback/promise/await on transmission. Just fire and forget.

* Automation - I am automating the shit out of it. I am automating my documentation, bundling, compilation, and a few other things as much as possible in my build step, which is under 4 seconds. I use TypeScript to type absolutely every declaration. I use TypeScript-ESLint to enforce use of TypeScript declarations and a bunch of custom rules to eliminate known bad practices like "this", bind, call, and apply.

* Framework - What a dirty word. I am not using any of this nonsense. TypeScript is good enough. I have a simple 4 step solution for state management, otherwise I just work directly to the DOM and my current application is an OS GUI. Don't knock it til you try it.

* Performance - You don't know how slow you are until you measure things with numbers. Today I managed to reduce my page load time with state restoration (an OS GUI in the browser) from about 300ms to 192ms by eliminating a CSS reflow and removing 90%+ instances of innerHTML. In the browser the performance tab/graph in the developer tools is fantastic. In Node I prefer to write my own performance tools that typically intertwine with test automation. I eliminated the css reflow by visually hiding all dynamically rendered elements until everything is fully built into the DOM. To dynamically size things vertically I removed some JavaScript arithmetic based upon parent container clientHeight and instead am using CSS min-height:100%.