4 ms·
I've found the way to reduce churn the most is discard frameworks and DSLs whenever possible. This morning, I rewrote a page of frontend code for a scheduling
by the__alchemist 5y ago
I've found the way to reduce churn the most is discard frameworks and DSLs whenever possible.
This morning, I rewrote a page of frontend code for a scheduling webapp. I'd initially built it in TS/React years ago. Switched to Rust/WASM with a custom VDOM-based framework a year ago.
I'm reasonably confident I won't rewrite it again in a new framework: the new page is an HTML document with an included JS script that performs standard DOM manipulations using the API described on MDN. The code's now insulated from changing dependencies because it has none. And the page loads fast.
- 71a54xd 5y agoInteresting, I'd never thought about niche front-end frameworks from the rust / elixir live-view camps in this way. Totally makes sense though! I'm still mildly convinced there's a front-end engineering bootcamp / JS framework industrial complex operating behind the scenes.
- quickthrower2 5y agoWhy was the TS/react rewrite needed? Had react or ts broken it’s api?
- the__alchemist 5y agoReact didn't substantially improve code flow, and added a dependency, config, a build step, and DSL. Typescript added a build step and config. Stated another way: The new page is a single file written in web standards. The React/TS way is more complicated, requires a bigger download, and is slower.
- Rd6n6 5y agoWasm and rust sound amazing. Are there any downsides? Performance issues? I heard there can be issues with dom manipulation but might be misremembering
- the__alchemist 5y agoCurrently, WASM calls ultimately execute DOM API commands, so there is no performance benefit for DOM manipulation. This is expected to change, but I don't know the details. I can't explain why, but WASM files end up much larger than an equivalent JS file. (And often larger than a NPM/framework-based etc JS bundle) Also, a build step. Perhaps someone else who's used WASM more recently, or used it with a language other than Rust can comment. It's nice being able to use whichever language you wish, but IMO not worth the downsides in its current state.
- robertoandred 5y agoIs this custom VDOM-based framework not a dependency? Doesn’t sound like a web standard.
- jimmaswell 5y agoYeah, it seems to me they took a dependency out of plain sight and replaced it with an opaque binary that has to be built externally with its own dependencies and declared victory.
- the__alchemist 5y agoCorrect - which is why I replaced it with HTML/CSS/JS.
- zebraflask 5y agoCompletely agree. After healthy doses of React / Angular / Vue development, you kind of reach a point where wrestling with the quirks and overhead of the framework, when it's not strictly necessary, seems like more work than just tossing up some plain standards-compliant code. I like getting rid of dependencies whenever possible. I think I read something a little while ago that that's actually what Netflix sometimes tries to do with their front end - plain, dep-free code wherever they can make it work.