Commit Graph

231 Commits

Author SHA1 Message Date
Evan You e2d6ff845b wip: root mount api compat 2021-04-07 16:19:24 -04:00
Richard Cooke 4549e65bae
fix(runtime-core): remove dev-only props property from setup context for consistency (#3492) 2021-03-27 11:23:10 -04:00
Evan You 2e71f07bc1 fix(ssr): ensure async setup error handling work with suspense during ssr 2021-03-26 11:00:30 -04:00
edison d668d48e9e
fix(runtime-core): handle error in async setup (#2881) 2021-03-26 10:26:30 -04:00
HcySunYang 44166b43d9
fix(runtime-core): cache props default values to avoid unnecessary watcher trigger (#3474)
fix #3471
2021-03-25 17:26:58 -04:00
Evan You 7cf143dd4f chore: fix test 2021-03-25 16:06:02 -04:00
HcySunYang 0a583d5ca2
fix(ssr): respect render function from extends/mixins in ssr (#3006)
fix #3004
2021-03-25 10:32:17 -04:00
Evan You aea88c3280 refactor: fix implementation of SFC :slotted id handling
fix #2892
2021-03-05 18:28:12 -05:00
HcySunYang 354966204e
dx(runtime-dom): warn config.isCustomElement usage in runtime-only build (#2945) 2021-02-24 16:18:55 -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
Guillaume Chau 4fecb27f86 fix(devtools): send instance to devtools when it's mounted instead of created 2021-01-29 16:48:37 +01:00
Godpu f2228a87d4
chore: typo (#2953) 2021-01-06 10:46:51 +01:00
edison 82bf7ebf36
refactor(runtime-core): extract common getComponentName function (#2454) 2020-12-04 17:03:03 -05:00
Evan You 67d1aac6ae feat(sfc): allow sfcs to recursively self-reference in template via name inferred from filename
e.g. A file named `FooBar.vue` can refer to itself as `<FooBar/>`. This gets rid of the need for the `name` option.
2020-11-30 12:30:51 -05:00
HcySunYang 0ff2a4f1c1
fix(runtime-core): should pause tracking when initializing legacy options (#2524)
fix #2521
2020-11-27 14:01:01 -05:00
Evan You 46d80f4d58 fix: allow hmr in all builds
close #2571
2020-11-27 10:36:09 -05:00
Thorsten Lünborg 735af1c7b7
fix(runtime-core): ensure watchers are always registered to correct instance owner (#2495)
close: #2381
2020-11-27 09:31:50 -05:00
Evan You 73cdb9d420 fix(script-setup): ensure useContext() return valid context 2020-11-26 09:25:56 -05:00
Evan You 47d73c23e1 wip: defineOptions -> defineProps + defineEmit + useContext 2020-11-24 19:04:21 -05:00
Evan You 8ac2241b22 wip: more consistent compiler-sfc usage + inline mode for ssr 2020-11-20 14:23:09 -05:00
Evan You 468e0d95cf chore: Merge branch 'feat/expose' into script-setup-2 2020-11-14 12:50:32 -05:00
Evan You 0e59770b92 feat(runtime-core): explicit expose API 2020-11-14 12:49:35 -05:00
Evan You 6a9b56ca60 wip: defineContext() 2020-11-12 14:10:39 -05:00
ShaoDamao 288c764e52
chore(runtime-core): fix typo (#2442)
Co-authored-by: shaoziwei <ziwei.shao@cloudchef.io>
2020-10-20 08:51:05 +02:00
龙腾道 ba881f9190
fix(runtime-core): avoid object prototype keys in property access cache (#2416) 2020-10-19 17:11:28 -04:00
Evan You a66e53a24f fix(runtime-core): fix SSR memoery leak due to props normalization cache
fix #2225

The previous props/emits normlaization was caching normalized result per
app instance, but during SSR there is a new app instance created for
every request.

The fix now de-opts props/emits normlaization caching when there are
props/emits declared in global mixins - which is a very rare use case.
2020-10-06 15:31:29 -04:00
Katashin 422f05e085
fix(hmr): make hmr working with class components (#2144) 2020-09-18 00:14:59 -04:00
Evan You 5ae7380b4a
feat: update Suspense usage (#2099)
See https://github.com/vuejs/vue-next/pull/2099 for details.
2020-09-15 12:45:06 -04:00
Carlos Rodrigues 4fd468aced
types(runtime-core): refactor defineComponent (#1883) 2020-09-15 11:46:11 -04:00
Pick 09a939d37c
Revert "refactor(runtime-core): add @internal for instance.proxy (#1849)" (#2024)
This reverts commit 4d51be73d3.
2020-09-14 20:56:04 -04:00
Evan You 8ed0b342d4 fix(runtime-core): fix props/emits resolving with global mixins
fix #1975
2020-08-31 18:32:07 -04:00
Evan You 0cb7f7f880 fix(runtime-core): fix resolving assets from mixins and extends
fix #1963
2020-08-26 18:09:54 -04:00
Guillaume Chau 31b99a9139 feat(devtools): expose setupState target object 2020-08-22 16:40:04 +02:00
Evan You eb2ae44d94 refactor(types): widen `Component` type to include consutructor types
returned from `defineComponent`

ref: https://github.com/vuejs/vue-router-next/pull/421
also close #1880

Previous `Component` type is now exported as `ConcreteComponent`.

This introduces a minor breaking change when calling `h(comp, { ... })`
will now fail if `comp` is a of generic `Component` type, since it does
not specify what props it expects.
2020-08-19 16:19:25 -04:00
Carlos Rodrigues 4baf852a34
types(runtime-core): make `FunctionalComponent` with emit string[] to be `Component` (#1879)
fix #1847
2020-08-19 10:00:48 -04:00
Pick 4d51be73d3
refactor(runtime-core): add @internal for instance.proxy (#1849) 2020-08-18 11:12:26 -04:00
Evan You aa06b1034d
feat(reactivity): `proxyRefs` method and `ShallowUnwrapRefs` type (#1682)
* feat(reactivity): `proxyRefs` method and `ShallowUnwrapRefs` type

BREAKING CHANGE: template auto ref unwrapping are now applied shallowly,
i.e. only at the root level. See https://github.com/vuejs/vue-next/pull/1682 for
more details.
2020-07-28 16:30:56 -04:00
Evan You b3b65b4058 fix: runtime compilation marker should be applied in exposed compile function 2020-07-28 11:11:26 -04:00
Evan You 354d79c42b fix(runtime-core): respect render function from mixins
fix #1630
2020-07-27 17:44:17 -04:00
Evan You 3d2bdafd2f chore: revert accidentally commented line 2020-07-23 14:53:09 -04:00
Evan You a75b8a268f fix(build): fix component resolution when disabling options API
fix #1688
2020-07-23 14:33:15 -04:00
Evan You ba17c871d8 feat: support delimiters option for runtime compilation
close #1679
2020-07-23 14:27:17 -04:00
Evan You 54727f9874 feat: provide ability to overwrite feature flags in esm-bundler builds
e.g. by replacing `__VUE_OPTIONS_API__` to `false` using webpack's
`DefinePlugin`, the final bundle will drop all code supporting the
options API.

This does not break existing usage, but requires the user to explicitly
configure the feature flags via bundlers to properly tree-shake the
disabled branches. As a result, users will see a console warning if
the flags have not been properly configured.
2020-07-20 21:51:30 -04:00
Evan You 03c681e396 refactor(types): move component props interfaces + expose `AllowedComponentProps`
fix #1632
2020-07-19 14:09:53 -04:00
Stanislav fa5ddf8d06
chore(types): convert type literals to records (#1615) 2020-07-18 22:56:28 -04:00
Guillaume Chau 568b6db12b
feat: Initial devtools support (#1125) 2020-07-16 18:18:52 -04:00
Evan You 32a4cb804b test: improve coverage 2020-07-15 10:38:45 -04:00
Carlos Rodrigues d78a6821f5
types(runtime-core): default `SetupContext` generic argument to `EmitsOptions` (#1584) 2020-07-15 09:19:20 -04:00
Evan You 380c6792d8 fix(v-on): refactor DOM event options modifer handling
fix #1567

Previously multiple `v-on` handlers with different event attach option
modifers (`.once`, `.capture` and `.passive`) are generated as an array
of objects in the form of `[{ handler, options }]` - however, this
makes it pretty complex for `runtime-dom` to properly handle all
possible value permutations, as each handler may need to be attached
with different options.

With this commit, they are now generated as event props with different
keys - e.g. `v-on:click.capture` is now generated as a prop named
`onClick.capture`. This allows them to be patched as separate props
which makes the runtime handling much simpler.
2020-07-14 11:48:05 -04:00
Evan You ba3b3cdda9 fix(runtime-core/emits): merge emits options from mixins/extends
fix #1562
2020-07-13 11:55:46 -04:00