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

✨ hijack the dynamic stylesheet injection during development phase #129

Merged
merged 1 commit into from
Nov 5, 2019

Conversation

kuitos
Copy link
Member

@kuitos kuitos commented Nov 4, 2019

针对 bootstrap 阶段添加的副作用 (如 style-loader 在应用 mount 前动态插入的样式) 的处理

close #118


This change is Reviewable

@kuitos kuitos requested review from howel52 and Ariel-Cheng November 4, 2019 09:30
src/hijackers/index.ts Show resolved Hide resolved
freers.forEach(free => sideEffectsRebuilders.push(free()));
freers = [];
// note that the frees of mounting phase are one-off as it will be re-init at next mounting
sideEffectsRebuilders = [...bootstrappingFreers, ...mountingFreers].map(free => free());

Choose a reason for hiding this comment

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

freers ==> freeres ?

// for gc
dynamicStyleSheets = [];
if (!bootstrapping) {
// for gc

Choose a reason for hiding this comment

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

为什么开发阶段需要 gc,其他阶段不需要?

Copy link
Member Author

Choose a reason for hiding this comment

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

因为 bootstrapping 阶段拦截到的副作用会被多次 rebuild

@kuitos kuitos merged commit 23322e9 into master Nov 5, 2019
@kuitos kuitos deleted the feat/bootstarp-hijack branch November 5, 2019 10:06
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.

[Bug]似乎不支持hash路由
3 participants