Evan You
a0e2c12874
fix(warning): always check for component instance presence when formatting traces
2020-04-29 14:41:22 -04:00
Evan You
892fb6d229
types: use more consistent naming for apiWatch type exports
...
BREAKING CHANGE: Some watch API types are renamed.
- `BaseWatchOptions` -> `WatchOptionsBase`
- `StopHandle` -> `WatchStopHandle`
2020-04-27 13:33:57 -04:00
Evan You
8ab44e1f80
types: expose ComponentOptionsBase
2020-04-27 13:31:40 -04:00
Evan You
ca84f46cd0
chore: add tip about Suspense being experimental
2020-04-24 16:13:44 -04:00
Evan You
ded92f93b4
fix(runtime-core): dynamic component should support falsy values without warning
2020-04-24 15:32:47 -04:00
Carlos Rodrigues
f3a9b516bd
fix(types): make return type of defineComponent
assignable to Component
type ( #1032 )
...
fix #993
2020-04-24 13:22:58 -04:00
Carlos Rodrigues
28b4c317b4
feat(types): expose ToRefs
type ( #1037 )
2020-04-24 13:10:16 -04:00
Evan You
c9f10be9de
refactor(runtime-core): extract key/ref normalization logic
2020-04-24 13:06:56 -04:00
Evan You
d7379c7647
fix(runtime-core): fix key/ref resolution for cloneVNode
...
fix #1041
2020-04-24 12:42:46 -04:00
Evan You
dcf2458fa8
fix(runtime-core): fix dynamic node tracking in dynamic component that resolves to plain elements
...
fix #1039
2020-04-24 12:18:51 -04:00
underfin
63c8444d4a
Update packages/runtime-core/src/components/BaseTransition.ts
...
Co-Authored-By: Carlos Rodrigues <david-181@hotmail.com>
2020-04-23 06:53:46 +08:00
Evan You
2acf3e84b9
feat(reactivity): add triggerRef API
...
Also make shallowRef assignment behavior consistent with normal ref
2020-04-22 18:00:10 -04:00
underfin
2b19965bcf
fix(slots): compiled slot fallback should be functions ( #1030 )
...
This avoids it being collected as dynamic children when it's not used.
fix #1021
2020-04-22 16:52:41 -04:00
Evan You
ff4d1fcd81
fix(runtime-core): mixin options that rely on this context should be deferred
...
Also ensure consistent option apply order with Vue 2, close #1016 , close #1029
2020-04-22 16:36:18 -04:00
Evan You
e422b8b082
fix(runtime-core): only infer component name for object components
...
close #1023
2020-04-22 04:39:12 -04:00
likui
9bddf3820e
types(runtime-core): improve types for transition hook
...
fix #1000
2020-04-21 12:06:10 +08:00
Andrew Talbot
cebad64d22
feat(runtime-core): improve warning for extraneous event listeners ( #1005 )
...
fix #1001
2020-04-20 16:40:59 -04:00
Evan You
dece6102aa
feat(warn): infer anonymous component named based on resolve name
2020-04-20 16:17:29 -04:00
Evan You
0278992f78
fix(warn): fix component name inference in warning trace
2020-04-20 16:06:51 -04:00
Andrew Talbot
054ccecd58
perf(core): use startsWith
instead of indexOf
( #989 )
2020-04-20 15:44:20 -04:00
Evan You
ab844fd169
feat(runtime-core): more specific warning for failed v-on fallthrough
...
close #1001
2020-04-20 15:32:21 -04:00
Evan You
e954ba21f0
feat(build): provide more specific warnings for runtime compilation
...
close #1004
2020-04-20 15:23:26 -04:00
Evan You
171cfa404f
fix(runtime-core): should not cast prop value if prop did not change
...
fix #999
2020-04-20 14:16:25 -04:00
Evan You
36d77f9a9e
refactor(hmr): simplify usage
2020-04-20 13:39:47 -04:00
Evan You
19223f5462
build: remove __BUNLDER__ flag so that HMR is available for all builds
2020-04-20 13:39:47 -04:00
Jian Zhang
a51b052672
chore: remove a dead if branch ( #986 )
2020-04-17 18:41:33 -04:00
Evan You
d7ca1c5c6e
fix(runtime-core): fix user attched public instance properties that start with "$"
2020-04-17 10:23:10 -04:00
Carlos Rodrigues
99fd158d09
fix(watch): fix deep watchers on refs containing primitives ( #984 )
2020-04-17 09:55:41 -04:00
Evan You
c0adb67c2e
feat(types): expose ComponentCustomOptions for declaring custom options
2020-04-17 09:41:36 -04:00
Evan You
be21cfb1db
feat(types): feat(types): add ComponentCustomProperties
interface ( #982 )
2020-04-17 09:12:50 -04:00
Cédric Exbrayat
4cf5e07608
feat(types): expose ExtractPropTypes ( #983 )
2020-04-17 09:00:25 -04:00
Evan You
370fc820cc
refactor(runtime-core): refactor instance public proxy context object
2020-04-16 12:49:50 -04:00
Evan You
b2662a62c5
wip: separate setupState
2020-04-16 11:50:33 -04:00
Evan You
0709380c5f
feat(runtime-core): skip emit warn if has equivalent onXXX prop
2020-04-16 11:27:52 -04:00
Evan You
bfd6744fb1
perf(runtime-core): use raw context on component options init
2020-04-16 10:39:51 -04:00
Evan You
24e5ab33f5
refactor(runtime-core): remove need for internal instance sink
2020-04-16 10:09:20 -04:00
Evan You
09b4202a22
refactor(reactivity): adjust APIs
...
BREAKING CHANGE: Reactivity APIs adjustments:
- `readonly` is now non-tracking if called on plain objects.
`lock` and `unlock` have been removed. A `readonly` proxy can no
longer be directly mutated. However, it can still wrap an already
reactive object and track changes to the source reactive object.
- `isReactive` now only returns true for proxies created by `reactive`,
or a `readonly` proxy that wraps a `reactive` proxy.
- A new utility `isProxy` is introduced, which returns true for both
reactive or readonly proxies.
- `markNonReactive` has been renamed to `markRaw`.
2020-04-15 16:45:20 -04:00
Evan You
3178504273
refactor(reactivity): make readonly non-tracking
2020-04-14 23:49:46 -04:00
Evan You
486dc188fe
feat(reactivity): add support for toRef
API
2020-04-14 20:49:18 -04:00
Evan You
b83c580131
feat(reactivity): add support for customRef
API
2020-04-14 20:45:46 -04:00
Evan You
4046f0bc03
chore: revert debugging dev flag
2020-04-14 18:32:27 -04:00
Evan You
8ae362400e
types: fix public instance $root and $parent type
2020-04-14 18:13:53 -04:00
Evan You
2e06f5bbe8
feat(runtime-core): detect and warn against components made reactive
...
close #962
2020-04-14 18:07:47 -04:00
Evan You
3e7bb7d110
feat(runtime-core): warn async data()
2020-04-14 17:40: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
Evan You
c80b857eb5
fix(runtime-core): should resolve value instead of delete for dynamic props with options
2020-04-14 16:17:35 -04:00
Evan You
e8a866ec99
refactor(reactivity): remove stale API markReadonly
...
BREAKING CHANGE: `markReadonly` has been removed.
2020-04-13 17:39:48 -04:00
Evan You
9e9d264412
Revert "feat(reactivity): add effect to public api ( #909 )" ( #961 )
...
This reverts commit 6fba241850
.
2020-04-13 17:13:06 -04:00
Evan You
7cbf684611
fix(runtime-core): fix kebab-case props update
...
fix #955
2020-04-13 12:37:31 -04:00
Evan You
5968cff3a8
refactor: make sure setupContext.emit always reference current emit on instance
...
This is dev only and for internal use by vue-test-utils.
2020-04-13 10:06:51 -04:00
Evan You
6eb3399311
fix(runtime-dom): fix patching for attributes starting with on
...
fix #949
BREAKING CHANGE: Only props starting with `on` followed by an uppercase
letter or a non-letter character are considered event listeners.
2020-04-10 11:57:07 -04:00
Evan You
55566e8f52
refactor(runtime-core): remove emit return value
...
BREAKING CHANGE: this.$emit() and setupContext.emit() no longer
return values. For logic that relies on return value of listeners,
the listener should be declared as an `onXXX` prop and be called
directly. This still allows the parent component to pass in
a handler using `v-on`, since `v-on:foo` internally compiles
to `onFoo`.
ref: https://github.com/vuejs/rfcs/pull/16
2020-04-10 10:59:46 -04:00
Evan You
a6e2b1052a
fix(compiler-core): should not generate CLASS/STYLE patch flags on components
...
ref #677
2020-04-10 10:19:26 -04:00
Evan You
cda50ea788
refactor(runtime-core): move updateCompnent into separate function
2020-04-10 10:19:26 -04:00
Evan You
84440780f9
fix(slots): should update compiled dynamic slots
2020-04-08 12:23:44 -04:00
likui
a27e9ee9ae
fix(runtime-core): set fragment root children should also update dynamicChildren ( #944 )
...
fix #943
2020-04-08 09:32:09 -04:00
Evan You
42278317e1
fix(transition): should ship props declarations in production
2020-04-07 17:19:37 -04:00
Evan You
b8da8b2dfa
fix(transition): fix dynamic transition update on nested HOCs
2020-04-07 16:08:15 -04:00
Evan You
e804463492
feat(asyncComponent): add onError
option for defineAsyncComponent
...
BREAKING CHANGE: `retryWhen` and `maxRetries` options for
`defineAsyncComponent` has been replaced by the more flexible `onError`
option, per https://github.com/vuejs/rfcs/pull/148
2020-04-07 14:34:42 -04:00
Evan You
cb504c287f
refactor(runtime-core): refactor slots resolution
...
Get rid of need for setup proxy in production mode and improve console
inspection in dev mode
2020-04-06 21:06:53 -04:00
Evan You
c5f0f63b91
refactor(runtime-core): make setup attrs proxy dev only
2020-04-06 17:57:27 -04:00
Evan You
ec4a4c1e06
refactor(runtime-core): refactor props resolution
...
Improve performance in optimized mode + tests
2020-04-06 17:37:47 -04:00
Evan You
c28a9196b2
fix(runtime-core): fix globalProperties in check on instance render proxy
2020-04-06 11:41:28 -04:00
Rahul Kadyan
4d196366c8
types(runtime-core): Adds type signature for renderList helper ( #924 )
2020-04-06 09:57:32 -04:00
Evan You
899287ad35
feat(runtime-core): improve component public instance proxy inspection
2020-04-05 18:39:22 -04:00
Evan You
f42d11e8e1
fix(v-model): handle dynamic assigners and array assigners
...
close #923
2020-04-04 20:51:42 -04:00
Evan You
c1d5928f3b
fix(types): accept generic Component type in h()
...
fix #922
2020-04-04 13:29:29 -04:00
Evan You
e42cb54394
fix(runtime-core): support attr merging on child with root level comments
...
fix #904
2020-04-03 21:37:58 -04:00
Evan You
c7c3a6a3be
feat(runtime-core): emits validation and warnings
2020-04-03 20:40:34 -04:00
Evan You
24e9efcc21
refactor(runtime-core): extract component emit related logic into dedicated file
2020-04-03 19:08:17 -04:00
Evan You
bf473a64ea
feat(runtime-core): type and attr fallthrough support for emits option
2020-04-03 12:05:52 -04:00
Robbin Baauw
6fba241850
feat(reactivity): add effect to public api ( #909 )
2020-04-03 09:30:58 -04:00
Carlos Rodrigues
026eb729f3
fix(types): allow use PropType with Function ( #915 )
...
close #748
2020-04-03 09:28:13 -04:00
Evan You
4b03b922e2
chore: remove debugger
2020-04-03 09:21:21 -04:00
Evan You
21bcdec943
refactor(runtime-core): adjust attr fallthrough behavior
...
BREAKING CHANGE: attribute fallthrough behavior has been adjusted
according to https://github.com/vuejs/rfcs/pull/154
2020-04-03 09:20:37 -04:00
Cédric Exbrayat
2103a485d7
refactor(runtime-core): remove unnecessary tracing check ( #912 )
...
The check for `config.performance` is already done inside `endMeasure` and is not done anywhere else `endMeasure` is called.
2020-04-03 09:19:53 -04:00
Evan You
eee5095692
refactor: rename <portal>
to <teleport>
...
BREAKING CHANGE: `<portal>` has been renamed to `<teleport>`.
`target` prop is also renmaed to `to`, so the new usage will be:
```html
<Teleport to="#modal-layer" :disabled="isMobile">
<div class="modal">
hello
</div>
</Teleport>
```
The primary reason for the renaming is to avoid potential naming
conflict with [native portals](https://wicg.github.io/portals/ ).
2020-04-01 21:55:19 -04:00
Evan You
e93e426bfa
feat(runtime-core): config.performance tracing support
2020-04-01 21:36:50 -04:00
Evan You
449ab039fe
feat(templateRef): should work with direct reactive property
...
close #901
2020-03-31 10:35:49 -04:00
Evan You
55b364decc
feat(templateRef): support template ref for all vnode types
2020-03-31 10:30:12 -04:00
Eduardo San Martin Morote
94562daea7
fix(inject): allow default value to be undefined
( #894 )
...
Close #892
2020-03-30 15:24:55 -04:00
Evan You
573bcb2e11
refactor(runtime-core): remove the need for currentSuspense
2020-03-30 11:49:51 -04:00
Evan You
b74bab216c
feat(portal): hydration support for portal disabled mode
2020-03-30 11:24:29 -04:00
Evan You
9ed9bf3687
feat(portal): SSR support for portal disabled prop
2020-03-30 11:24:29 -04:00
Evan You
8ce3da0104
feat(portal): support disabled prop
2020-03-30 11:24:28 -04:00
Evan You
e866434f0c
feat(portal): SSR support for multi portal shared target
2020-03-27 20:49:01 -04:00
Evan You
aafb880a0a
feat(portal): support multiple portal appending to same target
2020-03-27 18:42:57 -04:00
Evan You
b1d0b046af
fix(runtome-dom): properly support creating customized built-in element
2020-03-27 12:39:00 -04:00
Eduardo San Martin Morote
412ec86128
fix(types): export missing types from runtime-core ( #889 )
2020-03-27 09:30:49 -04:00
Evan You
c01930e60b
feat(asyncComponent): retry support
...
BREAKING CHANGE: async component `error` and `loading` options have been
renamed to `errorComponent` and `loadingComponent` respectively.
2020-03-26 20:58:31 -04:00
Cédric Exbrayat
ebc587376c
refactor(runtime-core): rename createAsyncComponent
to defineAsyncComponent
( #888 )
...
BREAKING CHANGE: `createAsyncComponent` has been renamed to `defineAsyncComponent` for consistency with `defineComponent`.
2020-03-26 11:59:54 -04:00
Evan You
16cd8eee78
fix(portal): portal should always remove its children when unmounted
2020-03-25 17:27:55 -04:00
Evan You
cb31eb4d0a
feat(runtime-core): failed component resolution should fallback to native element
2020-03-25 15:08:15 -04:00
Evan You
27873dbe1c
feat(runtime-core): support app.config.globalProperties
...
per https://github.com/vuejs/rfcs/pull/117/
2020-03-25 09:28:43 -04:00
Evan You
d99437f870
chore: rmeove debugger [ci skip]
2020-03-24 18:18:59 -04:00
Evan You
10ad965100
fix: fix option merge global mixins presence check
2020-03-24 12:59:33 -04:00
Evan You
528621ba41
feat(runtime-core): support config.optionMergeStrategies
...
Note the behavior is different from Vue 2:
- merge strategies no longer apply to built-in options.
- the default value is now an empty object and no longer exposes merge
strategies for built-in options.
2020-03-24 11:59:00 -04:00
Evan You
123738727a
fix(keep-alive): should update re-activated component with latest props
2020-03-24 10:28:00 -04:00
Evan You
bfae9b2e55
types: fix createVNode dts generation
2020-03-23 17:36:19 -04:00
Evan You
455a1534c9
refactor: transformHArgs -> transformVNodeArgs
2020-03-23 16:54:28 -04:00
Evan You
cba2f1aadb
feat(asyncComponent): SSR/hydration support for async component
2020-03-23 16:14:56 -04:00
Evan You
4c1a193617
fix: do not drop SFC runtime behavior code in global builds
...
fix #873
2020-03-23 15:10:35 -04:00
Evan You
f529dbde23
fix: dynamic component fallback to native element
...
fix #870
2020-03-23 14:47:04 -04:00
Yang Mingshan
dff2fbab93
types(watch): export watchEffect types ( #866 )
2020-03-23 11:11:27 -04:00
Evan You
b8c1be18f3
refactor(types): use stricter settings
...
fix #847
2020-03-23 11:08:22 -04:00
Evan You
b3890a93e3
fix(runtime-core): fix component proxy props presence check
...
fix #864
2020-03-21 16:25:33 -04:00
Evan You
c3bb3169f4
feat(runtime-core): async component support
2020-03-21 16:01:08 -04:00
Jessica Sachs
b7d1e0fa2f
feat: add hook for transforming h's arguments ( #851 )
...
Note: this is for internal use (e.g. `@vue/test-utils`) only
2020-03-19 10:54:03 -04:00
Evan You
ba9a91c48c
refactor: remove null comparisons
2020-03-18 18:14:51 -04:00
Evan You
811f28a7d1
test(runtime-core): tests for vnode hooks
2020-03-18 16:35:04 -04:00
Evan You
ebc1ca8eff
fix(suspense): clear effects on suspense resolve
2020-03-18 15:40:20 -04:00
Evan You
be91b43564
types: improve directive hook argument types
2020-03-18 12:30:26 -04:00
Evan You
aa4ab39c1a
refactor: separate vnode hooks and directive hooks
2020-03-18 12:30:26 -04:00
Evan You
6679799540
refactor: refactor vnode hooks invocation
2020-03-18 12:30:26 -04:00
Evan You
3b282e7e3c
fix(runtime-core): fix boolean props validation
2020-03-17 10:35:32 -04:00
yang
3d38e6faf3
refactor(componentProps): extract validate prop name logic ( #825 )
2020-03-16 18:45:08 -04:00
yang
703c9bc61f
types(ComponentInternalInstance): ComponentInternalInstance.type could reuse Component type ( #824 )
2020-03-16 18:41:11 -04:00
Evan You
c450ede12d
feat(ssr): support getSSRProps for vnode directives
2020-03-16 18:36:19 -04:00
Evan You
4dc8ffc378
fix: simplify and use correct ctx in withCtx
2020-03-16 13:06:46 -04:00
Evan You
23701666cb
Revert "refactor(directives): remove binding.instance"
...
This reverts commit 52cc7e8231
.
2020-03-16 13:06:46 -04:00
Evan You
19228a469a
refactor: simplify resolveDyanmicComponent
2020-03-16 13:06:46 -04:00
Evan You
9ad65b1653
refactor(template-ref): improve template ref handling
...
close #836 , close #839
2020-03-16 13:06:46 -04:00
Evan You
8a58dce603
feat(runtime-core): set context for manual slot functions as well
2020-03-16 13:06:46 -04:00
Evan You
ecd7ce60d5
feat(compiler-core): wrap slot functions with render context
2020-03-16 13:06:46 -04:00
sqal
d9dd1d8a0a
fix(runtime-core): pass instance proxy as data() argument ( #828 )
...
Match current behaviour of vue 2
2020-03-16 10:28:17 -04:00
jods
c7ae269972
fix(runtime-core): empty boolean props ( #844 )
...
close #843
2020-03-16 10:19:06 -04:00
likui
760c3e0fd6
feat(types): export ErrorTypes
( #840 )
2020-03-15 11:40:58 -04:00
djy0
58bc51991e
chore(runtime-core): fix typo in warning ( #841 ) [ci skip]
2020-03-15 11:29:21 -04:00
Evan You
60ed4e7e08
feat(ssr): improve fragment mismatch handling
2020-03-13 18:02:53 -04:00
Evan You
eb1d538ea2
test(ssr): hydration suspense tests
2020-03-13 13:05:05 -04:00
Evan You
a05d41c940
refactor(ssr): adjust ssr fragment anchor content
2020-03-13 13:05:05 -04:00
Evan You
cad5bcce40
feat(ssr): hide comment anchors during hydration in dev mode
2020-03-13 13:05:05 -04:00
Evan You
a3cc970030
feat(ssr/suspense): suspense hydration
...
In order to support hydration of async components, server-rendered
fragments must be explicitly marked with comment nodes.
2020-03-13 13:05:05 -04:00
Evan You
bb7fa3dabc
feat(runtime-core): implement RFC-0020
...
BREAKING CHANGE: data no longer supports object format (per RFC-0020)
2020-03-12 16:13:12 -04:00
Katashin
dd17fa1c90
feat(runtime-core): add special property to get class component options ( #821 )
2020-03-12 11:46:32 -04:00
hareku
1e9d1319c3
fix(types): app.component should accept defineComponent return type ( #822 )
...
fix #730
2020-03-12 10:19:30 -04:00
Cédric Exbrayat
28a9beed16
fix(runtime-core): always set invalid vnode type ( #820 )
...
Currently, when a component used is not properly registered, we have a warning and the vnode type is set to a Comment type in DEV mode. But in prod mode, we have no default value, making such an application broken and throw a strange error (`can not read _isSuspense of undefined`).
This commit avoids such an error in prod mode (as it is currently the case in Vue 2.x).
2020-03-11 16:44:14 -04:00
Evan You
206640a2d8
fix(build): remove __RUNTIME_COMPILE__ flag
...
behavior should be consistent in all builds. fix #817
2020-03-11 16:39:26 -04:00
Cédric Exbrayat
f59779706b
refactor(Suspense): remove unnecessary casts ( #819 )
2020-03-11 11:17:10 -04:00
Evan You
47ead3b33a
refactor(ssr): improve ssr async setup / suspense error handling
2020-03-10 16:52:31 -04:00
Dmitry Sharshakov
589aeb402c
feat(server-renderer): render suspense in vnode mode ( #727 )
2020-03-09 18:20:30 -04:00
Evan You
ca5f39ee35
refactor(runtime-core): adjust patchProp value arguments order
...
BREAKING CHANGE: `RendererOptions.patchProp` arguments order has changed
The `prevValue` and `nextValue` position has been swapped to keep it
consistent with other functions in the renderer implementation. This
only affects custom renderers using the `createRenderer` API.
2020-03-09 16:15:49 -04:00
hareku
cd34603864
fix(runtime-core): pass prev value to hostPatchProp ( #809 )
...
fix #808
2020-03-09 16:08:10 -04:00
djy0
54a0e93c27
fix(runtime-core): should allow empty string and 0 as valid vnode key ( #807 )
2020-03-09 16:03:57 -04:00
hareku
257727569a
types(runtime-core): update error type to unknown ( #798 )
2020-03-09 15:58:52 -04:00
Evan You
dd2d25fee1
test(ssr): test for hydration mismatch handling
2020-03-06 15:39:54 -05:00
Evan You
3be3785f94
fix(ssr): fix ssr on-the-fly compilation + slot fallback branch helper injection
2020-03-06 14:52:15 -05:00
Evan You
08bba093af
test(ssr): more hydration tests
2020-03-05 10:29:50 -06:00
Evan You
fb4856b363
test(ssr): hydratioon tests (wip)
2020-03-04 17:06:50 -06:00
Evan You
91269da52c
feat(ssr): hydration mismatch handling
2020-03-03 15:12:38 -06:00