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

🐛 should trigger scripts loading before them executing #2389

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

kuitos
Copy link
Member

@kuitos kuitos commented Feb 9, 2023

Thus we could make sure that all assets are fetched while beforeLoad lifecycle calling, and the execScripts overhead is just js execution timing.

@vercel
Copy link

vercel bot commented Feb 9, 2023

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

Name Status Preview Updated
qiankun ✅ Ready (Inspect) Visit Preview Feb 9, 2023 at 1:31PM (UTC)

@kuitos kuitos merged commit 52b1a3c into master Feb 9, 2023
@kuitos kuitos deleted the feat/tigger-scripts-loading-before-exec_ branch February 9, 2023 13:58
stefango pushed a commit to stefango/qiankun that referenced this pull request Jul 11, 2023
@eightHundreds
Copy link

eightHundreds commented Aug 18, 2023

为什么? beforeLoad的时间点变化了, 影响性能指标采集, 算破坏性更新。

这样改之后,beforeLoad与beforeMount之间只差一个 微应用 js文件的同步执行时间。不符合直觉

@kuitos
Copy link
Member Author

kuitos commented Aug 18, 2023

loadMicroApp 调用 -> beforeLoad 是静态资源(HTML、css、js)请求&预处理时间
beforeLoad -> beforeMount 是子应用的所有 js 的执行时间

如果你之前通过 beforeLoad -> beforeMount 的方式采集,那你就会漏掉 HTML 的请求+预处理时间

@mmmmmmmgo
Copy link

loadMicroApp 调用 -> beforeLoad 是静态资源(HTML、css、js)请求&预处理时间 beforeLoad -> beforeMount 是子应用的所有 js 的执行时间

如果你之前通过 beforeLoad -> beforeMount 的方式采集,那你就会漏掉 HTML 的请求+预处理时间

原先是
loadMicroApp ---> 触发beforeLoad -> 执行execScripts , import-html-entry内部调用getExternalScripts 加载html,js资源-> 微应用代码执行 -> 触发beforeMount

在beforeLoad和beforeMount中埋点,可以统计 html和main.js的加载耗时。

现在是
loadMicroApp ---> getExternalScripts 加载html,js资源 -> 触发beforeLoad -> 执行execScripts -> 微应用代码执行 -> 触发beforeMount

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants