Commit Graph

55 Commits

Author SHA1 Message Date
Evan You d9162dfc2e fix(scheduler): sort nested postFlushCbs
close #10003
2024-01-08 18:20:29 +08:00
Doctorwu 68e5cc6ac8
chore(runtime-core): remove console comment (#9989) 2024-01-07 03:26:38 +08:00
三咲智子 Kevin Deng bfe6b459d3
style: update format & lint config (#9162)
Co-authored-by: 丶远方 <yangpanteng@gmail.com>
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
Co-authored-by: Guo Xingjun <99574369+Plumbiu@users.noreply.github.com>
2023-12-26 19:39:47 +08:00
AlanYu 1d79b64ebc
feat(runtime-core): throw real error when scheduler detects infinite loop during dev (#7447)
close #7437
2023-12-19 16:59:47 +08:00
Rudy 6784f0b1f8
fix(watch): should not fire pre watcher on child component unmount (#7181)
close #7030
2023-12-08 12:24:44 +08:00
skirtle a8f663867b
fix(scheduler): ensure jobs are in the correct order (#7748)
close #7576
2023-10-21 10:38:54 +08:00
丶远方 6a22b1f6c2
fix(types): ensure nextTick return type reflect correct Promise value (#8406) 2023-07-11 17:56:02 +08:00
Evan You 6aaf8efeff fix(runtime-core): avoid double firing when mounting inside a watcher callback
fix #6614
2022-09-08 09:59:51 +08:00
Evan You 78c199d6db fix(watch): flush:pre watchers should not fire if state change causes
owner component to unmount

fix #2291
2022-08-15 19:00:55 +08:00
Evan You 74d2a76af6 fix(watch): fix flush: pre watchers triggered synchronously in setup
fix #5721
2022-04-15 18:08:44 +08:00
宋铄运 (Alan Song) c6eb3cccce
build: improve treeshakeability (#5682) 2022-04-13 05:39:02 -04:00
Evan You a31303f835 build: generate more treeshaking friendly code 2021-09-16 10:56:34 -04:00
王嘉欣 36ae23d27e
chore(types): remove unnecessary assertions (#4168) 2021-07-21 15:55:31 -04:00
Evan You 33c2fbfdc8 fix(reactivity): revert computed scheduler change
fix #4157
2021-07-20 16:45:29 -04:00
Evan You d810a1a569 fix(scheduler): fix insertion for id-less job
fix #4148
2021-07-19 13:37:38 -04:00
Evan You ebaac9a56d perf(reactivity): avoid triggering re-render if computed value did not change 2021-07-16 14:30:49 -04:00
Evan You 87f69fd0bb perf(reactivity): improve reactive effect memory usage (#4001)
Based on #2345 , but with smaller API change

- Use class implementation for `ReactiveEffect`
- Switch internal creation of effects to use the class constructor
- Avoid options object allocation
- Avoid creating bound effect runner function (used in schedulers) when not necessary.
- Consumes ~17% less memory compared to last commit
- Introduces a very minor breaking change: the `scheduler` option passed to `effect` no longer receives the runner function.
2021-07-16 14:30:49 -04:00
Carlos Rodrigues 18911abb91
fix(type): infer parent as `this` on `nextTick` function (#3608)
fix #3599
2021-07-15 16:28:20 -04:00
Evan You 03a7a73148 fix(reactivity): ensure computed always expose value
fix #3099

Also changes the original fix for #910 by moving the fix from
reactivity to the scheduler
2021-05-27 20:53:21 -04:00
Evan You b57e995edd fix(scheduler): handle preFlush cb queued inside postFlush cb
fix #3806
2021-05-26 14:21:49 -04:00
Evan You 66b6b4226b chore: include component info in recursive update warning 2021-04-21 15:20:15 -04:00
edison bf34e33c90
fix(runtime-core): ensure only skip unflushed job (#3406) 2021-03-25 11:13:35 -04:00
HcySunYang 45fae9d308
fix(scheduler): ensure updates are always inserted in ascending id order (#3184)
fix #2768, fix #2829
2021-02-25 09:37:25 -05:00
underfin af9560455d
fix(runtime-core): ensure scheduler queue is always non-null (#2567)
fix https://github.com/vitejs/vite/issues/1021
2020-11-09 09:19:32 -05:00
Evan You 5c3e8e9840 fix(runtime-core): ensure this context for $nextTick callback
fix #2282
2020-10-05 18:18:38 -04:00
Evan You 59e58cd4a5 chore: remove console.log [ci skip] 2020-08-24 21:16:13 -04:00
Evan You 36fa42a88c fix(runtime-core/scheduler): handle nested flushPostFlushCbs calls
fix #1947
2020-08-24 18:47:15 -04:00
Evan You cfa7636bbe chore: comments 2020-08-19 18:02:17 -04:00
Necmettin Karakaya 86187ca907
chore: typos (#1670) 2020-08-14 17:05:12 -04:00
HcySunYang caccec3f78
fix(runtime-core/scheduler): sort postFlushCbs to ensure refs are set before lifecycle hooks (#1854)
fix #1852
2020-08-14 09:50:23 -04:00
Evan You 611437a3fe fix(runtime-core/scheduler): allow component render functions to trigger itself
fix #1801
2020-08-13 17:42:47 -04:00
Evan You 3692f2738f refactor(runtime-core/scheduler): dedicated preFlush queue
properly fix #1763, #1777, #1781
2020-08-05 10:55:23 -04:00
Evan You 74a1265fea chore: remove debugger 2020-08-05 09:32:18 -04:00
Evan You a0e34cee4a fix(watch): exhaust pre-flush watchers + avoid duplicate render by pre-flush watchers
close #1777
2020-08-04 13:20:23 -04:00
Yang Mingshan b2a91429ed
fix(runtime-core/scheduler): prevent duplicate queue (#1767) 2020-08-03 17:19:06 -04:00
Evan You d4c17fb48b fix(watch): pre-flush watcher watching props should trigger before component update
fix #1763
2020-08-03 16:49:30 -04:00
Evan You 09702e95b9 fix(runtime-core/scheduler): only allow watch callbacks to be self-triggering
fix #1740

Previous fix for #1727 caused `watchEffect` to also recursively trigger
itself on reactive array mutations which implicitly registers array
`.length` as dependencies and mutates it at the same time.

This fix limits recursive trigger behavior to only `watch()` callbacks
since code inside the callback do not register dependencies and
mutations are always explicitly intended.
2020-07-30 17:57:20 -04:00
Evan You 4ef5c8d424 fix(runtime-core): fix scheduler dedupe when not flushing 2020-07-28 13:23:09 -04:00
Evan You c27dfe1d09 fix(runtime-core): scheduler should allow intentional self triggering effects
fix #1727
2020-07-28 12:29:43 -04:00
Evan You 7e8b26eba8 refactor(runtime-core): make nextTick() promise reject on scheduler flush error 2020-07-28 10:40:25 -04:00
Evan You 165068dbc2 perf(runtime-core): avoid duplicate postFlushCb invocation
Also improve flush performance by using for loop instead of shift()

fix #1595
2020-07-15 22:36:41 -04:00
Evan You 78977c3997 fix(scheduler): sort jobs before flushing
This fixes the case where a child component is added to the queue before
its parent, but should be invalidated by its parent's update. Same logic
was present in Vue 2.

Properly fixes #910
ref: https://github.com/vuejs/vue-next/issues/910#issuecomment-613097539
2020-04-14 17:31:35 -04:00
Yang Mingshan fe9da2d0e4
fix(runtime-core/scheduler): invalidate job (#717) 2020-02-11 07:30:25 -05:00
Evan You 8a87074df0 fix(runtime-core/scheduler): avoid duplicate updates of child component 2020-02-10 13:09:15 -05:00
JiZhi aa6c67ee2e fix(scheduler): warn recursive updates in postFlushCbs as well (#456) 2019-11-14 12:06:23 -05:00
Evan You 5fcb81050a test: tests for keep-alive 2019-10-30 21:41:28 -04:00
Jooger 312907c9d8 refactor(scheduler): replace try catch with callWithErrorHandling (#264) 2019-10-14 00:32:01 -04:00
Dmitry Sharshakov 7fd1fdde28 refactor(scheduler): minor refactors (#240) 2019-10-13 22:41:23 -04:00
月迷津渡 9d6783053c types: simplify types (#104) 2019-10-05 10:09:34 -04:00
Evan You 360f3b4f37 types: improve type exports 2019-09-06 12:58:31 -04:00