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

refactor(scheduler): remove invalidateJob #11650

Merged
merged 2 commits into from
Aug 19, 2024

Conversation

skirtles-code
Copy link
Contributor

Closes #7745.

I have an old PR, #7745, that fixes a minor bug in invalidateJob. However, since Vue 3.4, the external symptoms of the bug disappeared. The problem in the code is still present, but it can no longer be reproduced via the public API.

Longer explanation at #7745 (comment).

In short, I believe we no longer need to use invalidateJob to remove child jobs from the queue. We can just leave the job in the queue. Since 3.4, update jobs check their dirty flag before doing anything else, so running an unnecessary job is very cheap.

Removing the job involves calls to indexOf and splice, neither of which are cheap operations. Using a flag instead is similar to the approach used by invalidateMount (see #9370 (comment)).

The test for invalidateJob had to be removed too. I've added a couple of new tests to try to cover some of the relevant edge cases, but testing via the public API.

Copy link

github-actions bot commented Aug 18, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 98.6 kB (-64 B) 37.3 kB (-25 B) 33.6 kB (+13 B)
vue.global.prod.js 156 kB (-64 B) 57.1 kB (-25 B) 50.8 kB (-86 B)

Usages

Name Size Gzip Brotli
createApp 54 kB (-64 B) 20.9 kB (-23 B) 19.1 kB (-20 B)
createSSRApp 57.9 kB (-64 B) 22.5 kB (-26 B) 20.5 kB (-18 B)
defineCustomElement 58.6 kB (-64 B) 22.4 kB (-24 B) 20.4 kB (-76 B)
overall 67.6 kB (-64 B) 26 kB (-24 B) 23.6 kB (-19 B)

Copy link

pkg-pr-new bot commented Aug 18, 2024

commit: 2ec8d00

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@11650

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@11650

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@11650

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@11650

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@11650

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@11650

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@11650

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@11650

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@11650

vue

pnpm add https://pkg.pr.new/vue@11650

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@11650

Open in Stackblitz

@yyx990803
Copy link
Member

/ecosystem-ci run

@vue-bot

This comment was marked as outdated.

@yyx990803
Copy link
Member

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Aug 19, 2024

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools failure failure
nuxt success success
pinia success success
primevue success success
quasar success success
radix-vue success success
router success success
test-utils success success
vant success success
vite-plugin-vue success success
vitepress success success
vue-i18n success success
vue-macros success success
vuetify success success
vueuse success success
vue-simple-compiler success success

@yyx990803 yyx990803 merged commit 4b608a9 into vuejs:main Aug 19, 2024
13 checks passed
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