Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

refactor: app provider #644

Merged
merged 9 commits into from
Nov 2, 2022
Merged

refactor: app provider #644

merged 9 commits into from
Nov 2, 2022

Conversation

luhc228
Copy link
Member

@luhc228 luhc228 commented Oct 28, 2022

Close #607

  • basic-project example 的修改是消除 warning 和 路由组件 Layout 命名是 Anonymous 的问题
  • with-store 添加了示例代码以检查路由切换是否会导致全局 Provider 重新渲染

@vercel
Copy link

vercel bot commented Oct 28, 2022

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

Name Status Preview Updated
ice-v3 ✅ Ready (Inspect) Visit Preview Nov 2, 2022 at 3:54AM (UTC)

@luhc228 luhc228 changed the title [WIP] refactor: app provider refactor: app provider Oct 31, 2022
wssgcg1213
wssgcg1213 previously approved these changes Oct 31, 2022
answershuto
answershuto previously approved these changes Oct 31, 2022
</AppDataProvider>
</AppContextProvider>
<AppDataProvider value={appData}>
<AppProvider>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有没有觉得 AppProvider 插在这里看着有点语义不太明确,不知道是做什么的。其他的 AppDataProvider、 AppContextProvider 对比起来,一看就知道是提供了 app 的 data 和 context

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppProvider -> AppRuntimeProvider

chenjun1011
chenjun1011 previously approved these changes Oct 31, 2022
</AppContextProvider>
<AppDataProvider value={appData}>
<AppRuntimeProvider>
<AppContextProvider value={appContext}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个顺序建议调整为 Context > Data > Runtime

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runClientApp 中路由切换时候要把 appContext 的值更新到最新的

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@luhc228 luhc228 merged commit c43fcb9 into release-next Nov 2, 2022
@luhc228 luhc228 deleted the refactor/app-provider branch November 2, 2022 07:03
@ClarkXia ClarkXia mentioned this pull request Nov 7, 2022
15 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants