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

refactor(core): optimize the usage of indexedDB #33

Merged
merged 4 commits into from
Mar 5, 2024
Merged

Conversation

Chilfish
Copy link
Owner

@Chilfish Chilfish commented Mar 4, 2024

正如 https://github.com/jakearchibald/idb-keyval/blob/main/custom-stores.md 里一直在强调的,idb-keyval 实在是太过于精简了,难以发挥 indexedDB 的全部实力)看了眼源码,也只是对 https://github.com/jakearchibald/idb 的封装,所以还是迁移到 idb 好了🧐

这是一个很大的重构,pinia 实例再也不用存所有的微博数据了,转为使用 indexedDB 的游标 cursor 来实现分页。

同时对 text 和时间建立索引,全文搜索再也不用傻傻地全部加载再正则匹配了😅

Copy link

vercel bot commented Mar 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
weibo-archiver ✅ Ready (Inspect) Visit Preview Mar 5, 2024 0:08am

@Chilfish
Copy link
Owner Author

Chilfish commented Mar 4, 2024

全文搜索还有些小问题,似乎做分词索引才是比较好的方式……?

@Chilfish
Copy link
Owner Author

Chilfish commented Mar 5, 2024

看了眼,打算用 wasm jieba 在 worker 里做分词索引

@Chilfish
Copy link
Owner Author

Chilfish commented Mar 5, 2024

最后还是用 https://www.fusejs.io/ 来全文搜索了,也支持特定的搜索语法,默认采用的是关键字匹配,待会再加到搜索指南中)

@Chilfish Chilfish marked this pull request as ready for review March 5, 2024 12:14
@Chilfish Chilfish added the enhancement New feature or request label Mar 5, 2024
@Chilfish Chilfish merged commit 2faca5f into main Mar 5, 2024
1 check passed
@Chilfish Chilfish mentioned this pull request Mar 5, 2024
17 tasks
@Chilfish Chilfish deleted the refactor/indexedDB branch March 5, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant