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

feat: remove webpack chunk cache attributes just while there are multi instances loaded on document #2873

Merged
merged 2 commits into from
Jan 4, 2024

Conversation

kuitos
Copy link
Member

@kuitos kuitos commented Jan 3, 2024

当且仅当文档上同时挂载同一个应用多次时,需要移除 webpack 的缓存,从而避免后续挂载的子应用实例因为命中了 webpack 的缓存,从而不再新建对应的 chunk script,导致 chunk 缺失

Copy link

changeset-bot bot commented Jan 3, 2024

🦋 Changeset detected

Latest commit: 474a6b0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
qiankun Patch
@qiankunjs/shared Patch
@qiankunjs/loader Patch
@qiankunjs/sandbox Patch
@qiankunjs/react Patch
@qiankunjs/vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jan 3, 2024

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

Name Status Preview Comments Updated (UTC)
qiankun ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 1:29pm

@@ -71,13 +80,16 @@ export default async function loadApp<T extends ObjectType>(
unmountSandbox = () => sandboxContainer.unmount();
}

if (instanceId > 1) {
removeWebpackChunkCacheWhenAppHaveMultiInstance(appName);
Copy link
Contributor

Choose a reason for hiding this comment

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

为什么改成第二次 load 的时候才移除 data-webpack 的标识呀?以前的形式有什么问题吗?

Copy link
Member Author

Choose a reason for hiding this comment

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

data-webpack 本身是有用的,可以做一些 chunk 提前加载的优化,不能无脑删掉

@kuitos kuitos merged commit 56fef69 into next Jan 4, 2024
7 checks passed
@kuitos kuitos deleted the fix/webpack]= branch January 4, 2024 09:41
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.

2 participants