Remove things that no longer exist or are covered by built-in TypeScript
libraries. Also switch to webpack-provided types instead of defining
them manually.
Remove polyfill functions for Element, CharacterData and DocumentType
classes, as these methods are all Baseline Widely Available. Also get
rid of redundant IIFE for the Math "polyfills".
This is not a big optimization but an optimization nonetheless. Mostly
based on awesome work by @Xiving. Further work should be done to get
most out of these changes.
Add a --watch command line flag to be used in tandem with --load-mod.
Chokidar is used to detect file updates, and a page reload is triggered
when there are any changes to watched mod files. Only mods loaded via
--load-mod are affected.
This implementation has a minor issue with how cache is cleared -
removing disk cache is a bit too aggressive - but the only alternative I
could find is to use a non-persistent Electron session, which would get
rid of disk cache entirely (this is not a concern).
While the browser engine can clean up workers automatically, it's a good
idea to terminate them as soon as we don't need those anymore. It's
generally suggested to reuse a single worker for repetitive operations,
but implementing such a system is much harder. In addition, spawning a
new worker for each operation allows (de)compressing multiple blobs in
parallel :)
Implement DefaultCompression class along with a generic interface to
facilitate easy to use compression in a background thread, and make use
of this class in Storage implementation by default.
Does not fix the savegame list bugs. Note that savegame index
serialization happens a few times for some reason, this is out of scope
for this commit though.
Keep track of the storage ID in each renderer Storage instance and pass
it to the IPC bridge. Jobs are dispatched to the relevant handler (only
saves/ for now) and all (de)compression is handled there.
Add dedicated fs-job types to read or write and (de)compress data
from/to the file picked by the user. Remove redundant utility functions
that used web APIs instead.
Make it slightly easier to replace the storage interface used for
app_settings.bin and savegames.bin in case it's ever needed. Savegames
always use app.storage for now, but this should be easier to change as
well.
Also fix a few issues in Electron code. This is not as polished yet, UI
from old mod support was reused for now and is likely broken. Mods can
be loaded, but there isn't much QoL around the support for now.
Only load the mod with highest priority for now. Proper behavior would
be to keep metadata for all duplicates and load the first that isn't
disabled. This allows easy mod source switching (for example, user mods
and development mods)
The linkApp method is removed as it was unused. A getter is used to
ensure best development experience. It can be further improved by adding
a guard for cases where GLOBAL_APP is not set yet.
* Switch to npm in electron/
May change resolved package versions.
* Remove redundant electron-notarize dependency
The number of dependencies stays the same. Only direct mention in
package.json is removed.
* Assume Node.js 22.x and clean up dependencies
Targeting Node.js 22.x allows using the new fs.glob* functions, which
can replace the glob module. It is still downloaded as there are other
packages using it, but is no longer included in devDependencies.
Also remove @types/filesystem, as this API is not used anywhere in the
code, it is non-standard and some of it was removed from Chromium. Was
likely used with Cordova for YORG.io 3 mobile support.
* Update linting stack
Install the latest versions of the following packages:
- @eslint/js (^9.24.0)
- eslint (^9.24.0)
- typescript-eslint (^8.29.1)
and remove packages that are no longer used:
- @types/eslint__js
- yarn
Config files were not modified.
* Switch root package to npm
npm is able to resolve packages using yarn.lock as a resolution hint.
Note that files other than those included in this commit are
intentionally kept outdated, as they may need a bigger change.
Keep some that are either still used but shouldn't be or those that may
be used in the future. Files other than base-en.yaml are first synced
with the sync-translations.js script, then formatted with prettier-all.
Can have minor effect on game appearance, most importantly the removal
of letter-spacing by default. Styles are now much lighter though.
Changes all keybinding code to use kbd instead of code as well.