Migrate and upgrade local/extension mv3 storage

Repository details (talkie)
Project page
talkie
Project log category
(708 entries)
Repository
@joelpurra/talkie
Owner
@joelpurra
Contributors
Contributors on Github
Project status
⏲️ This project has had recent commits.
📂 This project is open.
🌠 This project is popular.
Repository activity period
🗓
Commits
751 commits
Stars
71 stars
Commit details (bf4ddfb2)
Author
Authored at
Committer
Joel Purra
Committed at

Commit message

Migrate and upgrade local/extension mv3 storage

  • Migrates to MV3 by loading data from window.localStorage and writing to chrome.storage.local.
    • Migration is only performed during webext upgrade/install events.
    • Migrates all stored data without any further checks.
  • After migration, settings are upgraded as usual.
    • Multi-version upgrades were broken and had to be fixed.
  • Chrome requires loading over the message bus.
    • Loading in chrome is only possible from the offscreen document.
    • Writing in chrome is not possible from the offscreen document.
    • Uses a proxy message bus implementation of IStorageProvider.
  • Expands IStorageProvider to cover migration, plus some extras.
Raw text
Migrate and upgrade local/extension mv3 storage

- Migrates to MV3 by loading data from `window.localStorage` and writing to `chrome.storage.local`.
  - Migration is only performed during webext upgrade/install events.
  - Migrates all stored data without any further checks.
- After migration, settings are upgraded as usual.
  - Multi-version upgrades were broken and had to be fixed.
- Chrome requires loading over the message bus.
  - Loading in chrome is only possible from the offscreen document.
  - Writing in chrome is not possible from the offscreen document.
  - Uses a proxy message bus implementation of `IStorageProvider`.
- Expands `IStorageProvider` to cover migration, plus some extras.

Changed files (33)

Path Additions Deletions
code/package-lock.json +1 -0
code/packages/browser-background/src/background.mts +4 -1
code/packages/browser-bricks/src/on-installed-manager-types.mts +3 -0
code/packages/browser-bricks/src/on-installed-manager.mts +37 -12
code/packages/browser-bricks/src/speaker.mts +1 -0
code/packages/browser-bricks/src/storage/message-bus-window-local-storage-provider.mts +91 -0
code/packages/{browser-groundwork/src => browser-bricks/src/storage}/migrate-storage-backend.mts +9 -9
code/packages/browser-bricks/src/storage/storage-backend-migrator.mts +92 -0
code/packages/browser-bricks/src/storage/window-local-storage-provider.mts +124 -0
code/packages/browser-bricks/src/voice-language-manager.mts +1 -1
code/packages/browser-bricks/src/voice-pitch-manager.mts +1 -1
code/packages/browser-bricks/src/voice-rate-manager.mts +1 -1
code/packages/browser-groundwork/src/get-dependencies.mts +15 -3
code/packages/browser-groundwork/src/groundwork.mts +0 -4
code/packages/browser-mason/src/mason.mts +80 -3
code/packages/browser-offscreen/package.json +1 -0
code/packages/browser-offscreen/src/offscreen.mts +4 -1
code/packages/browser-offscreen/tsconfig.json +3 -0
code/packages/browser-serviceworker/src/serviceworker/offscreen-document-provider.mts +6 -7
code/packages/browser-shared/src/hydrate/get-dependencies.mts +4 -2
code/packages/shared-application/src/settings-manager.mts +1 -1
code/packages/shared-application/src/storage-manager.mts +0 -429
code/packages/shared-application/src/{offscreen.mts => storage/default-storage-manager.mts} +12 -4
code/packages/shared-application/src/storage/storage-helper.mts +61 -0
code/packages/shared-application/src/storage/storage-keys.mts +177 -0
code/packages/shared-application/src/storage/storage-manager.mts +55 -0
code/packages/shared-application/src/storage/storage-upgrader.mts +330 -0
code/packages/split-environment-interfaces/src/imessage-bus.mts +4 -0
code/packages/split-environment-interfaces/src/istorage-provider.mts +8 -0
code/packages/split-environment-node/src/storage-provider.mts +48 -4
code/packages/split-environment-webextension/src/browser-specific/storage-backend-migrator.mts +0 -165
code/packages/split-environment-webextension/src/browser-specific/webextension-polyfill.d.mts +4 -1
code/packages/split-environment-webextension/src/storage-provider.mts +42 -0

Commit categories (3)