Commit Graph

54 Commits

Author SHA1 Message Date
Evan You 1279b17300 fix(types): remove short syntax support in defineSlots()
ref: https://github.com/vuejs/language-tools/issues/2758
2023-05-08 11:53:49 +08:00
Evan You 94fa67a4f7 fix(hmr): force update cached slots during HMR
close #7155
close #7158
2023-04-20 10:06:06 +08:00
Evan You af563bf428 fix(types): more public type argument order fix 2023-04-06 11:12:49 +08:00
Evan You bdf557f6f2 fix(types): retain type parameters order for public types 2023-04-05 22:30:50 +08:00
三咲智子 Kevin Deng 5a2f5d59cf
feat(types/slots): support slot presence / props type checks via `defineSlots` macro and `slots` option (#7982) 2023-04-03 16:49:16 +08:00
Evan You 4c9bfd2b99 feat(dx): improve readability of displayed types for props 2023-03-24 15:06:43 +08:00
Evan You 58e5c51149 build: upgrade to TypeScript 5.x 2023-03-23 17:11:35 +08:00
Evan You f73925d76a fix(sfc): ensure `<script setup>` binding behavior consistency on `this` between prod and dev
close #6248
2022-11-10 16:02:45 +08:00
Evan You 4c3203b9b7 chore: run prettier 2022-11-08 14:25:48 +08:00
Rudy e4de623ea7
fix(types): support inferring injected properties in options api (#6804)
close #3031
close #5931
2022-11-08 01:09:53 -05:00
webfansplz 41d9c47300
fix(types): `$watch` callback parameters type (#6136)
fix #6135
2022-10-26 05:43:42 -04:00
Evan You 8071ef47b5 fix(types): restore DefineComponent argument order
This is necessary for compatibility w/ tsc-generated component types
using DefineComponent.

revert #5416
reopen #3796
fix #5967
2022-05-21 00:55:51 +08:00
edison 2a9e9a4096
refactor(runtime-core): extract function `isReservedPrefix` (#3265)
* chore(runtime-core): extract function isReservedKey

* chore: improve code

Co-authored-by: Evan You <yyx990803@gmail.com>
2022-05-13 04:52:19 -04:00
Evan You d52907f4eb fix(runtime-core): ensure consistent identity of $forceUpdate and $nextTick instance methods
fix #5556
2022-05-10 14:17:04 +08:00
Zclhlmgqzc 98b821d94a
fix(types): preserve and expose original options on defineComponent return type (#5416)
fix #3796
2022-05-06 05:44:05 -04:00
Evan You f641c4b228 fix(runtime-core): fix use of non-existent-in-prod internal property in defineProperty trap
fix #5710
2022-04-14 10:00:53 +08:00
Thorsten Lünborg 1612971471
fix(compat): copy additional properties for functions bound via globalProperties (#4873)
close #4403
2022-04-13 05:53:07 -04:00
宋铄运 (Alan Song) c6eb3cccce
build: improve treeshakeability (#5682) 2022-04-13 05:39:02 -04:00
lidlanca 1574edd490
fix(runtime-core): allow spying on proxy methods regression (#5417)
fix #5415 (regression by #4216)
2022-02-13 20:40:12 -05:00
Cédric Exbrayat 8457d8b980
fix(runtime-core): allow spying on proxy methods (#4216)
Since Jest v26.6.1, the mock method changed (see this commit 30e8020362)  to rely on `Object.defineProperty` in some cases.

This breaks spying on proxy's methods, because even if Jest is properly calling `Object.defineProperty`, the cached value in the `get` section of the proxy is never updated, and the spy is in fact never used.
This is easily reproducible as vue-next already uses a version of jest with these changes.

This is blocking projects (like vue-test-utils-next and vue-cli) to update to recent Jest versions.

This commit adds a `defineProperty` method to the proxy handler, that properly updates the defined value in the cache.
2022-02-12 03:35:05 -05:00
Evan You 6cfd72e760 refactor: move type utils to shared 2022-01-16 15:47:00 +08:00
Evan You aac0466cb8 fix(runtime-core): fix component public instance has check for accessed non-existent properties
close #4962
2021-11-25 18:15:06 +08:00
ygj6 14fcced281
fix(runtime-core): avoid script setup bindings overwriting reserved ctx properties (#4570) 2021-09-16 11:16:07 -04:00
edison 380608bd44
fix(types): fix forceUpdate type (#4302) 2021-08-11 10:46:18 -04:00
Evan You 8681c12c0c chore: rename method to make it more explicit it is dev only 2021-07-27 17:52:37 -04:00
Evan You dd1439e711 build: reduce runtime build size 2021-07-21 11:11:40 -04:00
Evan You 47f488350c chore: run updated prettier 2021-07-19 18:24:18 -04:00
Austin Keener 12cf9f4ea1
fix(runtime-core): fix instance accessed via $parent chain when using expose() (#4048) 2021-07-02 07:51:54 -04:00
Evan You b0203a3092 feat(expose): always expose $ instance properties on child refs 2021-06-24 21:28:09 -04:00
Evan You 0b8b576428 fix(sfc): allow variables that start with _ or $ in `<script setup>` 2021-06-23 10:13:23 -04:00
Evan You 056ef2a7d2 refactor: use markRaw instead of internal flag check 2021-06-11 18:46:31 -04:00
Evan You 1e35a860b9 refactor: adjust component options merge cache strategy
BREAKING CHANGE: optionMergeStrategies functions no longer receive
the component instance as the 3rd argument. The argument was technically
internal in Vue 2 and only used for generating warnings, and should not
be needed in userland code. This removal enables much more efficient
caching of option merging.
2021-06-02 10:42:52 -04:00
Evan You 6f8fe4eac9 wip: more compat tweaks 2021-04-22 17:30:54 -04:00
Evan You 62bfdae043 wip: Vue.util compat 2021-04-11 16:53:43 -04:00
Evan You 53b8127a9c wip: progress 2021-04-07 16:19:24 -04:00
Evan You 40e3dd28e1 wip: restructure compat code + global api alignment 2021-04-07 16:19:24 -04:00
Evan You e2d6ff845b wip: root mount api compat 2021-04-07 16:19:24 -04:00
HcySunYang 2b588cf1bc
fix(types): unwrap refs on public instance data (#3319)
fix #3315
2021-03-25 17:30:10 -04:00
HcySunYang 6e88156934
fix(runtime-core): should not cache property access during data() invocation (#3299)
fix #3297
2021-03-25 15:48:12 -04:00
Evan You aea88c3280 refactor: fix implementation of SFC :slotted id handling
fix #2892
2021-03-05 18:28:12 -05:00
HcySunYang f43a3b0beb
fix(runtime-core): align $parent/$root with the template ref when using expose (#3158) 2021-02-07 14:39:52 +01:00
Cédric Exbrayat 73117f6b5b
fix(runtime-core): allow overriding properties other than props (#3105)
This is useful for testing, as Jest can't spy on an object without `hasOwnProperty`.
VTU can add it, but this commit is needed first.
2021-02-05 19:59:46 +01:00
Thorsten Lünborg 288ae0a8d9
feat(runtime-core): improve render context warning (#2496)
Co-authored-by: Thorsten Luenborg <t.luneborg@googlemail.com>
2021-02-05 19:55:45 +01:00
Evan You 53f4885d9e fix(runtime-core): skip functional components in public $parent chain traversal
fix #2437
2020-11-27 10:10:25 -05:00
Evan You 6ba7ba47d5 feat: custom formatters 2020-10-13 11:50:24 -04:00
Evan You 5c3e8e9840 fix(runtime-core): ensure this context for $nextTick callback
fix #2282
2020-10-05 18:18:38 -04:00
wonderful-panda 89e9ab8a2a
fix(types/tsx): optional props from Mixin/Extends are treated as required (#2048) 2020-09-16 10:09:35 -04:00
Carlos Rodrigues 4fd468aced
types(runtime-core): refactor defineComponent (#1883) 2020-09-15 11:46:11 -04:00
HcySunYang 24fcf6ae7c
fix(types): properly infer return type from async setup (#2051)
fix #2049
2020-09-14 11:28:56 -04:00
Evan You fa7ab0a7f7 fix(runtime-core): warn reserved prefix for setup return properties and ensure consistent dev/prod behavior
close #2042
2020-09-03 11:21:14 -04:00