This updates `livesplit-core` to the latest version. This mostly adds
custom variable columns and allows for the timer to visualize the delta
for the background. There's some performance improvements as well.
Also we now build `livesplit-core` in debug mode by default when
building locally. So compilation is a little bit
faster and additional debug checks are active, such as integer
overflows.
Turns out that `keypress` is deprecated and only reacts to key presses
that results in actual visible characters. `keydown` however reacts to
all key presses and is not deprecated. Also this generally bumps
`livesplit-core`, so this brings other improvements as well.
Turns out that compiling a large bundle is really slow and apparently
also not parallelized. I thought it might make sense to not split the
bundle to not create any unnecessary requests. But JavaScript is
apparently really slow to compile, so any sort of parallelization we can
get definitely outweighs the slight cost to the additional requests.
By inlining a tiny amount of JS into the HTML, we can request the WASM
and other JS bundles much sooner, reducing the latency a bit. This also
inlines the most important styling, so that the loading screen is always
properly styled. We unfortunately have to use `syncWebAssembly` here as
it allows requesting the WASM file sooner than the other setting. It's
not a whole lot sooner, so once they remove the setting, we can switch
back without taking too much of a hit.
This implements support for custom fonts. Additionally it updates
livesplit-core and all our npm dependencies to the latest version. This
also switches how we propagate colors and fonts through the layout. We
are now using custom CSS variables instead of passing them through the
component tree.
All browsers now support the new WebAssembly Sign Extension Instructions
which improve code that casts around between small integer types. We'd
like to activate a bunch more new WASM instructions, but Safari is
really lacking behind quite a lot. Even just activating these requires
the latest Safari / iOS version that came out just a month ago. We
notify the user to update their browser / iOS version in case they have
an outdated browser. iOS updates on its own over night, so I believe
most people should be on the latest version and shouldn't have any
problem updating in case it didn't happpen yet.
This updates livesplit-core which brings a variety of performance
improvements:
- The Layout State is now being reused and thus most frames don't
require any heap allocations anymore. However we still serialize
everything over into a JSON string for now, which puts a lot of
garbage on the JS heap.
https://github.com/LiveSplit/livesplit-core/pull/334
- The frequent performance.now() calls we do, first lookup up the window
and performance object every time. This tripled the amount of calls we
do over into JavaScript, with each call into JavaScript being quite
expensive in Chrome.
https://github.com/LiveSplit/livesplit-core/pull/335
- By introducing a timer snapshot mechanism we further reduce the calls
to performance.now() to a single time.
https://github.com/LiveSplit/livesplit-core/pull/339
- Rust 1.44 regressed the performance of 128-bit integer multiplications
by accident. Those are used for hashing the comparisons when looking
up the times for a comparison, which is something we do very
frequently. We however don't have many comparisons, so a simple Vec
that we loop through is a bit faster, even in native code, and quite a
bit faster in the web, because of the Rust 1.44 regression.
https://github.com/LiveSplit/livesplit-core/pull/338
- We delay registering the Gamepad Hook Interval until the first gamepad
button is registered. Most people won't use a gamepad, so the interval
just waits cpu time for no reason.
https://github.com/LiveSplit/livesplit-core/pull/340
Instead of showing user unfriendly key codes, we want to show the actual
characters that the keys resolve to based on the user's keyboard layout.
This is a fairly experimental Web API, but it's the best we can do at
the moment.
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardLayoutMap
It seems like wasm-bindgen generates both `livesplit_core_bg.wasm` as
well as a `livesplit_core_bg.js` now. We used to import from
`livesplit_core_bg` in our bindings before, which is now ambiguous.
We now show a context menu for exporting any of the unloaded splits in
the list. There you can choose between uploading to splits.io or
exporting to a file.
- The sidebar updates the table properly now.
- Switching between splits shows a warning if you haven't saved your
changes.
- Fixed memory leaks when splits parsing failed.
- Lots of additional cleanup.
Instead of always looking for localStorage, we do it once while we
create the Indexed DB and then wipe all the localStorage, never looking
at it again.