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

在多个子应用同时激活的情况下 ,打开页面出现白屏 #31

Closed
Hollelihanqi opened this issue Aug 5, 2022 · 4 comments
Closed
Labels
need info give more info and reopen the issue

Comments

@Hollelihanqi
Copy link

No description provided.

@Hollelihanqi
Copy link
Author

在多个子应用同时激活的情况下 ,第一次进入打开页面其它子应用加载比较,出现白屏

@Hollelihanqi Hollelihanqi changed the title 在多个子应用同时激活的清空下 ,打开页面其它子应用加载比较,出现白屏 在多个子应用同时激活的情况下 ,打开页面出现白屏 Aug 5, 2022
@yiludege
Copy link
Collaborator

yiludege commented Aug 5, 2022

一个子应用的加载可以分为三个过程:

1、静态资源的请求下载,2、资源的运行,包括html的解析、js的解析执行,3、子应用的实例mount

其中 过程 1 可以通过 preloadApp 来提前加载,2 和 3 可以通过 preloadApp 的 exec模式来提前执行,但是这个preloadApp是相当于将子应用的加载提前来做

如果子应用从来都没有加载也没有采用preloadApp预加载,那么就要经历过程1、2、3,白屏时间较长

如果子应用之前已经加载过了:

  • 运行的是保活模式(sync = true),那么子应用重新打开过程1、2、3都不需要,无白屏时间
  • 运行的是单例模式(sync = false && 做了生命周期适配),那么子应用会重新进行只会过程3,白屏时间很短
  • 运行的是重建模式(sync = false && 没有做生命周期适配),那么子应用重新打开会进行过程2、3,白屏时间较长

@jk4235
Copy link

jk4235 commented Aug 10, 2022

可以考虑增加loader,减少焦虑😄

@yiludege yiludege added the need info give more info and reopen the issue label Aug 13, 2022
@yiludege
Copy link
Collaborator

@jk4235 loader 已经全覆盖 html、css、js,用户主动性非常大了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need info give more info and reopen the issue
Projects
None yet
Development

No branches or pull requests

3 participants