Hacker News new | ask | show | jobs
by a_wild_dandan 2262 days ago
Extensibility. We may begin with simple hero image/call-to-action, but we might wind up with a sign up form with validation, a interactive map of office locations, maybe even fancy particles (who doesn't love particles!?[1]), etc.

The page load will be fast enough to dissuade no users, I can add server-side rendering & free code-splitting (e.g. Next.Js), etc. Seems like a good deal.

[1] https://vincentgarreau.com/particles.js/

3 comments

So... premature optimization?
Premature optimization would be doing things in static HTML even though the rest of your code is in React because static HTML is "lighter" or "faster."

Also, Next.js does static HTML export out of the box if that's your preferred end target.

Over-engineering perhaps, but not premature optimization. You don't have to reach for that stuff until you need it.

As a side note, I do often advocate for somewhat over-engineering projects by starting with familiar frameworks. They strongly constrain the solution space yet give power to quickly meet inevitable feature creep. Strong KISS/YAGNI proponents might balk at that endorsement, but I've had far more trouble handling growing pains from adapting codebases that don't use frameworks than I have working in such over-engineered framework-based projects.

This is fascinating. If you ever feel like writing about your experiences adapting codebases, I'd read it in a heartbeat! :)
I would argue that if it's just for one or a few components, it's straight-forward to just drop in react parts there while leaving the rest of the page static. If the whole page should suddenly become dynamic, the work of migrating to react will probably be dwarfed by the work for actually building the new functionality.

So there is little reason to start out with react for a static page, unless one already knows they are soon going to extend it to something radically more dynamic.

> who doesn't love particles!?

I don’t. Please don’t waste my cycles and battery on pointless visual effects (unless you’re a vfx company).

Right - I get pretty angry when I watch activity on my CPU cores spike with opening a "pretty" website. If my CPU fan is revving because you're doing silly particle effects (usually sans WebGL) I'm not happy with your solution.