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

Use indexedDB instead of localStorage #5439

Closed
tamaina opened this issue Sep 20, 2019 · 10 comments
Closed

Use indexedDB instead of localStorage #5439

tamaina opened this issue Sep 20, 2019 · 10 comments
Assignees
Labels
💬Discussion Being discussed or needs discussion ✨Feature This adds/improves/enhances a feature i18n Internationalization (i18n) related issue/PR packages/frontend Client side specific issue/PR
Projects

Comments

@tamaina
Copy link
Contributor

tamaina commented Sep 20, 2019

Summary

◎ Service Workerからもアクセスできる
通知をi18nできるようになる
◎ オブジェクトストア(テーブル)をいくつも作れる
軽量化できるかも
▼ 非同期
localeをindexedDBにするとなると、init.tsなどなどを全部async/awaitにしなければならなくなるが、ブロッキングだった部分が速くなるかもしれないし、ブロッキングな関数をPromiseな関数に変更できるきっかけになるかもしれない

コンポーネントでのi18n読み込み= setLocaleMessage()を使えばいけそう(未検証)
https://kazupon.github.io/vue-i18n/api/#methods

こういう 感じでラッパーライブラリがあるので実装はそこまで難しくはない気がする

@tamaina tamaina added 💬Discussion Being discussed or needs discussion ✨Feature This adds/improves/enhances a feature packages/frontend Client side specific issue/PR i18n Internationalization (i18n) related issue/PR labels Sep 20, 2019
@tamaina tamaina self-assigned this Sep 20, 2019
@syuilo syuilo added this to the v12 milestone Jan 15, 2020
@syuilo syuilo added this to Maybe in v12 Jan 15, 2020
@syuilo syuilo removed this from the v12 milestone Jan 17, 2020
@tamaina tamaina changed the title Suggestion: Use indexedDB instead of localStorage Use indexedDB instead of localStorage Aug 5, 2020
@tamaina
Copy link
Contributor Author

tamaina commented Aug 5, 2020

#6329 でi18nはindexeddbに保存されるようになった。

こんどはvuexを保存するようにしたい。

window.onstorageが使えないので、タブ間で値を共有するのに何か別の方法が必要になる

たとえば https://github.com/xanf/vuex-shared-mutations とか

@tamaina
Copy link
Contributor Author

tamaina commented Aug 5, 2020

vuex-persistedstateは robinvdvleuten/vuex-persistedstate#60 らしいので、永続化ライブラリを https://www.npmjs.com/package/vuex-persist とかに変える必要あり

@tamaina
Copy link
Contributor Author

tamaina commented Jan 21, 2021

Service Workerへの設定共有はpostMessageでもできるので、必要性は薄くなった

@tamaina
Copy link
Contributor Author

tamaina commented Nov 4, 2021

Service Workerへの設定共有はpostMessageでもできる

保存先が複数になるのでちょっと微妙

あと、ストアがpizzaxになったので独自実装にする必要はある

@tamaina
Copy link
Contributor Author

tamaina commented Nov 4, 2021

内容をメモリにロードしておくのは変えず(今と変わらない)、変更を適宜BroadcastChannelで通知してタブ間で同期……みたいな実装で良いかしら

@tamaina
Copy link
Contributor Author

tamaina commented Dec 29, 2021

ユーザーストレージ機能でデバイスを超えてリアルタイムに設定が変化するようになってしまった

@tamaina
Copy link
Contributor Author

tamaina commented Dec 29, 2021

いやでもwhere == accountだけじゃん

@tamaina
Copy link
Contributor Author

tamaina commented Jan 1, 2022

ColdDeviceStorageをIndexedDB化してasync/awaitでやってくのがつらいので、サウンド関連の設定はpizzax化したい

@Sayamame-beans
Copy link
Collaborator

triage: already resolved?

@tamaina
Copy link
Contributor Author

tamaina commented Jul 19, 2024

yep

@tamaina tamaina closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💬Discussion Being discussed or needs discussion ✨Feature This adds/improves/enhances a feature i18n Internationalization (i18n) related issue/PR packages/frontend Client side specific issue/PR
Projects
No open projects
v12
  
Maybe
Development

No branches or pull requests

3 participants