Hacker News new | ask | show | jobs
by sstangl 2325 days ago
Here's a simple no-framework points calculator for the sport of Powerlifting: https://www.ipfpointscalculator.com/

The page is 11KB, loads in 96ms, and makes three requests to one network, two of which are favicon-related.

This turns out to actually matter in practice because many of our users are from countries with extremely slow connections.

1 comments

I love vanilla/minimal js frontends, but I don't think this is a prime example. The basic function of it could basically be a math function, and it does not not include any accessibility features, and if smallness is what you prioritize it could be smaller by using the form API's more, especially for things like radiobuttons (for example, a selected radio value for `units` can be found with `form.units.value`, the same can be done for other inputs).

My point is mostly: do vanillajs but also understand what api's are actually available for you from the start. There is a lot built into the browser, use it. Usually it already has better performance and accessibility than whatever you would write yourself.