-
Notifications
You must be signed in to change notification settings - Fork 8k
docs: add third-party libraries to check update methods #5819
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
Conversation
|
WalkthroughThis PR updates the documentation by adding a new section that explains how to implement the third-party Changes
Sequence Diagram(s)sequenceDiagram
participant App as Application
participant VP as VersionPolling Library
participant UI as Notification System
App->>VP: Initialize createVersionPolling(options)
VP-->>App: Perform regular update checks
VP->>App: Trigger callback on update detection
App->>UI: Display update notification
UI->>App: User accepts and refreshes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
docs/src/guide/in-depth/check-updates.md (2)
50-53
: Documentation Section Addition: Third-Party Update CheckThe new section titled "替换为第三方库检查更新方式" clearly introduces an alternative update checking mechanism using the
version-polling
library. The explanation is concise and highlights various strategies (chunkHash, version.json, Web Worker, etc.) which offer flexibility over the default etag approach.
58-93
: Integration Code Sample: Clear and FunctionalThe provided TypeScript integration snippet for
apps/web-antd
is well-structured and demonstrates the use ofcreateVersionPolling
along with proper configuration:
- The use of
silent: import.meta.env.MODE === 'development'
ensures that update checks are appropriately muted during development.- The
onUpdate
callback is neatly implemented with a dynamic key generation and the use ofant-design-vue
for notifications.- Leveraging Vue’s
h
function for rendering the notification button is a good practice.A few suggestions for further clarity:
- Consider adding inline comments within the snippet to explain the roles of critical variables (e.g., the dynamic
key
and theself
parameter) for newcomers to the code.- Optionally, a note on potential configuration prerequisites (for instance, any specific version requirements or extra steps needed for production usage) could enhance the documentation.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/src/guide/in-depth/check-updates.md
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: post-update (windows-latest)
- GitHub Check: post-update (ubuntu-latest)
🔇 Additional comments (1)
docs/src/guide/in-depth/check-updates.md (1)
54-57
: Installation Command InstructionThe bash code snippet for installing the
version-polling
library usingpnpm add version-polling
is clear and correct. It effectively communicates the installation step required before integrating the library into the project.
2c155c6
to
aa664fd
Compare
Description
提供更加灵活的应用版本检查更新策略:
version-polling
,使用 http etage方案有缺陷,前端不可控。
不清楚作者大大对于“项目检查更新”这块功能安排,我的最初想法增加一个第三方扩展的选项,对项目有侵入性。
所以没有提交项目修改代码,只添加了文档使用实例。
效果:

Type of change
Please delete options that are not relevant.
pnpm-lock.yaml
unless you introduce a new test example.Checklist
pnpm run docs:dev
command.pnpm test
.feat:
,fix:
,perf:
,docs:
, orchore:
.Summary by CodeRabbit