Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Persistence Engine #6

Merged
merged 13 commits into from
Nov 21, 2024
Merged

New Persistence Engine #6

merged 13 commits into from
Nov 21, 2024

Conversation

officialMECH
Copy link

This PR introduces lots of necessary infrastructural changes to the storage and persistence solutions, such that any breaking changes to application state in future updates can be performed safely with less friction for existing users.

Technical Changes

  • Replaced localforage with unstorage for more flexibility in where and how key-value relationships are stored.
    • A custom driver based on idb was added to introduce better support for table management and migrations for existing IndexedDB-based databases.
  • The file service has been recomposed into a new class-based helper to support custom storage drivers and reduce fragmentation of logic.
    • The beat-mapper-files IDB has been migrated to version 3, which features improvements to filename resolutions, raw JSON values for info/beatmap metadata, and correct types for Blob files.
  • Replaced redux-storage with a new custom storage middleware, which uses an observable-based architecture for better control over where and how application state is persisted and hydrated.
    • The beat-mapper-state IDB has been migrated to version 3, where the original "snapshot" of persisted state has been broken up and relocated across different storage engines:
      • All non-critical state that does not warrant persistence (editor, navigation) has been moved to session storage.
      • All persistable state that can be safely cleared (user) has been moved to local storage.
      • All entity-based state (songs, grids) has been moved into their own dedicated tables in IndexedDB, and is stored as raw JSON values.
  • Added new dedicated keybind (SHIFT + F5) to rehydrate state from values in storage, which can serve useful for debugging/troubleshooting purposes or power users.

@officialMECH officialMECH changed the base branch from master to staging/compatibility November 20, 2024 01:02
@officialMECH officialMECH merged commit 29d3372 into staging/compatibility Nov 21, 2024
2 checks passed
@officialMECH officialMECH deleted the chore/storage branch November 21, 2024 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant