commits
This will likely end up being a game of whack-a-mole in the long run but
setting these headers seems to be sufficient to avoid getting a JS
challenge for now.
This is to fix an issue in Chromium browsers where they would offset the
page in a different direction to other browsers when the description was
show on hover, with a consequence being the cursor could be placed in a
way that would cause it to hover over the media image for one frame and
not for the next, resulting in a horrible flickering.
I think this new behaviour feels more natural, and allows users to go to
the linked media pages by clicking the description too, similar to how
it works on touch devices.
I was previously relying on the implicit `max-width` value set by
Tailwind's Preflight normalisation, which doesn't seem to be liked by
Firefox which appears to require a `width` to be set specifically.
Now that the Apple Music fetcher supports URLs as well we can remove
some messy templating logic.
Didn't consider this before as it would be nicer to link to somewhere
that shows my music history, but this is likely the best option
available for now.
I'm running the site on a Hetzner VPS via NixOS instead of in a docker
container now.
This is no longer needed as it's handled by the esbuild server locally
and the Caddy server in production.
I generated a random port using a random site.
Helpful when wanting to set `--release`.
Fly seems to struggle with storing secrets with newlines, so let's
base64 encode the PEM secret and configure Fly to mount that as a file
(decoded.)
It takes significantly longer than the rest of the script so it's
getting relegated to the lint script/checking via LSP.
This allows us to apply prettier formatting on the HTML templates in the
server code, including the Tailwind plugin to sort its classes
correctly.
This makes it easy to spin up a development server that will rebuild on
file changes.
Let's use Tailwind this time to quickly prototype styling. Might rip it
out later once things have settled down.
Recommended to do so in case any have released fixes to support the 2024
edition.
I was trying to reduce the number of clones before by moving into the
Vec fields of the Scrobble, but into_iter().next() still calls
ptr::read() under the hood which does a bitwise copy so you're still
beholden to the compiler as to whether it's optimised away or not and
you get more unreadable code.
RwLock uses interior mutability magic to ensure that you don't need a
&mut reference for write() to work.
This allows us to immediately return cached scrobbles in the rendered
HTML if available, but never waste any time waiting for the last.fm API
to give us new data if the cache is stale. The 200ms timeout that was
previously in place was never long enough for the last.fm API to return
so it was just an unnecessary delay on response times.
I guess the limit parameter I'm passing isn't good enough!!
The normalize.css package hasn't been updated in 7 years and I suspect
many of its changes are no longer necessary. modern-normalize is
slightly more opinionated, and resulted in some layout shifts due to it
defaulting to `box-sizing: border-box;`. But that's meant I've now gone
back and improved my CSS to rely less on padding when margins are more
appropriate, and made more use of flexbox to centre elements rather than
auto margins.
New HSTS preload guidelines suggest to me that any further changes
(including enabling preloading) are unnecessary these days as browsers
will automatically try to upgrade to HTTPS anyway.
This is to fix an issue in Chromium browsers where they would offset the
page in a different direction to other browsers when the description was
show on hover, with a consequence being the cursor could be placed in a
way that would cause it to hover over the media image for one frame and
not for the next, resulting in a horrible flickering.
I think this new behaviour feels more natural, and allows users to go to
the linked media pages by clicking the description too, similar to how
it works on touch devices.
This allows us to immediately return cached scrobbles in the rendered
HTML if available, but never waste any time waiting for the last.fm API
to give us new data if the cache is stale. The 200ms timeout that was
previously in place was never long enough for the last.fm API to return
so it was just an unnecessary delay on response times.
The normalize.css package hasn't been updated in 7 years and I suspect
many of its changes are no longer necessary. modern-normalize is
slightly more opinionated, and resulted in some layout shifts due to it
defaulting to `box-sizing: border-box;`. But that's meant I've now gone
back and improved my CSS to rely less on padding when margins are more
appropriate, and made more use of flexbox to centre elements rather than
auto margins.