Commit Graph
406 Commits
Author SHA1 Message Date
Christopher Serr df51936aea Update livesplit-core (#716)
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.
2022-09-28 20:27:36 +02:00
Chris Santamaria 82341eb7b5 Close potential WS connection on unmount 2021-12-31 15:54:35 -05:00
Christopher Serr e8eeb3698e Fix error message about unsupported browsers
The try catch block was surrounding the wrong code.
2021-10-16 15:26:27 +02:00
Christopher Serr 91361d14ea Update livesplit-core and use keydown event
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.
2021-10-06 17:56:13 +02:00
Christopher Serr 87fcc2dc67 Use smaller bundles again
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.
2021-07-02 19:41:11 +02:00
Christopher Serr f6901fdd2b Inline the main JS bundle into the HTML
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.
2021-07-02 18:48:44 +02:00
Christopher Serr 28d777c48f Implement Support for Custom Fonts
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.
2021-07-01 18:15:55 +02:00
Christopher Serr f81697adfa Activate the WASM Sign Extension Instructions
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.
2021-05-27 00:46:55 +02:00
RektrothandChristopher Serr c90fa8ad15 Update src/index.tsx
Co-authored-by: Christopher Serr <[email protected]>
2021-01-27 18:08:27 -05:00
RektrothandChristopher Serr d625e695cf Update src/index.tsx
Co-authored-by: Christopher Serr <[email protected]>
2021-01-27 18:08:14 -05:00
Rektroth 288bd666fe Alert for #493 2021-01-27 17:08:04 -05:00
wooferzfg b708b30dc5 Make hotkey button blur element always appear above the sidebar 2021-01-18 21:19:39 -06:00
Christopher Serrandwooferzfg b2431c81f3 Update src/ui/LiveSplit.tsx
Co-authored-by: wooferzfg <[email protected]>
2020-06-14 18:55:44 +02:00
Christopher Serr e464f96b5a Apply all the recent performance improvements
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
2020-06-14 15:27:01 +02:00
wooferzfg c7115daecc Add parent param to twitch embeds 2020-06-11 18:38:37 -05:00
Christopher Serr 822021106a Improve Paint Times
In most frames only the timer will be redrawn. By moving it into its own
browser layer, we can reduce the amount of work the browser needs to do
to redraw that layer.

You can read more about this here:

https://developers.google.com/web/fundamentals/performance/rendering/simplify-paint-complexity-and-reduce-paint-areas#promote_elements_that_move_or_fade

This improves our paint times from 0.71ms

![https://i.imgur.com/3Asf2gu.png](https://i.imgur.com/3Asf2gu.png)

to about 60us

![https://i.imgur.com/fL2xCES.png](https://i.imgur.com/fL2xCES.png)
2020-06-06 15:23:19 +02:00
wooferzfg 67dbd64e59 Only re-render components when necessary 2020-05-16 10:33:32 -05:00
Christopher Serr 4cbfa08f9e Merge pull request #361 from wooferzfg/fix-toggle-state
Fix toggles not properly updating when switching views
2020-05-03 14:17:49 +02:00
Sergey Papushin 7a342a3310 Add keys to settings rows 2020-05-02 16:38:55 -05:00
Sergey Papushin a85b5ea4a8 Make toggle state always match the passed in prop 2020-05-02 16:38:39 -05:00
Sergey Papushin f9f739de1b Fix hotkey buttons keeping the listener even after a blur 2020-05-02 16:23:22 -05:00
Christopher Serr a7dda56a6c Resolve Keys based on the Keyboard Layout
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
2020-05-02 19:59:54 +02:00
Sergey Papushin 576ecc1a95 Clean up settings table styling 2020-05-01 22:27:49 -05:00
Sergey Papushin 59065b9e6a Implement ToggleCheckbox 2020-05-01 19:14:53 -05:00
Sergey Papushin 1a5b623138 Make HotkeyButton be a default export 2020-05-01 19:14:53 -05:00
Sergey Papushin b7b402e006 Fix empty columns affecting columns to the left 2020-05-01 17:18:06 +02:00
Sergey Papushin 7593917604 Make hotkey buttons not rely on focus and blur anymore 2020-05-01 16:05:53 +02:00
Christopher Serr 26870bcdf2 Disambiguate the import in the WASM bindings
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.
2020-05-01 14:57:35 +02:00
Sergey Papushin 15aaedeafa Fix resizing logic when switching between mobile and desktop 2020-04-24 23:15:39 -05:00
Sergey Papushin f2ca3b8379 Separate the Timer and Layout views into separate components 2020-04-19 13:11:36 -05:00
Christopher Serr 46549b4fdd Migrate the splits key from localStorage too 2020-04-18 21:13:33 +02:00
Christopher Serr 8c548c778e Set the splits key when migrating
Otherwise we don't have the migrated splits loaded.
2020-04-18 20:58:30 +02:00
Sergey Papushin 94b3079858 Fix the table still being displayed when there are no splits 2020-04-18 13:18:03 -05:00
Sergey Papushin 8490c9e647 Update array-type tslint rule to use array-simple 2020-04-18 13:01:52 -05:00
Christopher Serr 661a97ac99 Add more exporting options
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.
2020-04-18 12:57:34 -05:00
Christopher Serr 16c8a60120 Show defaults for empty game & category names 2020-04-18 12:57:34 -05:00
Christopher Serr d1ab967071 Import splits via dragging 2020-04-18 12:57:34 -05:00
Christopher Serr d1ffc676bf Fix a lot of remaining issues
- 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.
2020-04-18 12:57:34 -05:00
wooferzfg 5b3ae3837e Switch to flexbox to support mobile 2020-04-18 12:57:34 -05:00
wooferzfg d5f769a26c Clean up styles 2020-04-18 12:57:34 -05:00
Christopher Serr d420592291 Mostly finish up the Splits Selection 2020-04-18 12:57:34 -05:00
wooferzfg 0dd6e88d3e Add styling to splits selection tables 2020-04-18 12:57:34 -05:00
wooferzfg b46a034437 Resolve button height TODO 2020-04-18 12:57:34 -05:00
Christopher Serr f691836bc5 Implement some operations in the view 2020-04-18 12:57:34 -05:00
Christopher Serr d4543238f8 Initial Changes for a Splits Selection View
This makes some changes to the IndexedDB to differentiate between
different splits and shows a very unstyled view of them already.
2020-04-18 12:57:34 -05:00
Sergey Papushin b3003e6419 Fix linter errors 2020-04-16 18:53:43 -05:00
wooferzfg 8dbd428f51 Extract SidebarContent to each view 2020-04-13 19:53:20 -05:00
wooferzfg 754a64a6f8 Change splits/io to Splits.io 2020-03-15 23:41:54 -05:00
Christopher Serr 2211ad3ba3 Migrate from localStorage to Indexed DB early
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.
2020-03-13 15:00:54 +01:00
wooferzfg 8e2886be60 Add support for localStorage 2020-03-12 22:11:32 -05:00