View transitions on a multi-page site
There's one argument for building a client-side app I've never had a good answer to: a real page navigation looks worse. The answer turns out to be a browser feature rather than a rebuttal.
13 posts filed under JavaScript, newest first.
There's one argument for building a client-side app I've never had a good answer to: a real page navigation looks worse. The answer turns out to be a browser feature rather than a rebuttal.
I added a date library out of pure habit, for one line of formatting, then removed it. Then I read what's actually built in and found four things I've been doing badly for years.
Everybody meets this as the way to cancel a fetch. The more interesting thing it does has nothing to do with the network at all.
Most of the web is brochures, and a brochure doesn't need a client-side runtime, a router, or a build pipeline that stops working the moment you look away from it.
I took the last jQuery out of a project this month, six years after writing about only using it for one selector. The one thing I carried across was a pattern I'd only ever known as a jQuery feature.
It was in the proposal as a bullet point, in a list of things we believe in. The client asked what it meant in practice and nobody in the room could answer.
For about eight years the standard way to find out whether something was on screen was to ask, repeatedly, on every scroll event, in a way that forced the browser to stop and recalculate layout each time.
A full page load does a small piece of housekeeping nobody has ever had to think about. Swap content with JavaScript and you have quietly taken it on, almost certainly without noticing.
Two weeks old, and the reaction has been the usual mixture of delight and grief. Having used them on something real, the interesting part is the problem they were built for. It isn't the problem everyone's arguing about.
A new package manager, three projects moved across, and the distinct feeling that I have written this post before under a different noun.
Five pages, a contact form, updated roughly twice a year, and I spent an evening giving it an offline experience. I've been trying since to work out honestly whether that was worth doing or just fun.
Most of what jQuery was invented to fix has been fixed in the browsers, and a lot of us are still loading the whole library to avoid typing a slightly longer method name.
ES6 is arriving all at once through a transpiler, which means that adopting it is a series of individual choices rather than one and some of those features have earned it more than others.