Commit Graph

31 Commits

Author SHA1 Message Date
Evan You a75b00c558 wip: treat compat model listener as already declared 2021-04-21 19:13:26 -04:00
Evan You 183f9b0013 wip: component v-model compat 2021-04-09 23:10:29 -04:00
Evan You f8e2361d83 wip: make tests pass again 2021-04-08 16:33:53 -04:00
Evan You 960e9deaed wip: vm.$listeners compat 2021-04-08 10:06:12 -04:00
Evan You db09805688 wip: instance event emitter api compat 2021-04-07 16:19:24 -04:00
Evan You c1cd42e627 fix(runtime-core): fix v-on object kebab-case event emit matching
fix #3527
2021-04-01 19:47:58 -04:00
Evan You 60d777d228 fix(runtime-core): fix erraneous emits warnings w/ mixins
fix #2651
2021-03-26 16:29:40 -04:00
shadowings-zy 3532b2b021
fix(runtime-core): fix emit listener check on kebab-case events (#2542)
fix #2540
2020-11-27 15:24:29 -05:00
Hunter 128ec460ec
fix(v-model): built in modifiers support on component (#2348)
close #2326
2020-10-20 09:59:27 -04:00
Evan You 4bbb2b2ee6 fix(runtime-core): fix component .once listener logic 2020-10-20 09:50:18 -04:00
ᴜɴвʏтᴇ 052a621762
feat(compile-core): handle falsy dynamic args for v-on and v-bind (#2393)
fix #2388
2020-10-19 17:15:53 -04:00
shadowings-zy 62f26173ba
fix(runtime-core): use consistent camelCase event casing for render functions (#2278)
close #2249
2020-10-06 18:28:56 -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
wonderful-panda 5dbd6b36a0
fix(types): fix using tuple type as EmitsOptions (#2160)
fix #2159
2020-09-22 10:05:37 -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
Guillaume Chau 23233dc8b8 feat(devtools): catch events 2020-08-24 01:33:12 +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
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 00ab9e2e85 refactor: adjust event options handling to be JSX friendly 2020-07-14 13:20:59 -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
Carlos Rodrigues 1e90605c15
types(runtime-core): provide valid type for default `$emit` (#1498) 2020-07-08 11:51:03 -04:00
Evan You 2417a0cb30 fix(runtime-core): respect props from mixins and extends
fix #1236, close #1250
2020-06-09 11:27:40 -04:00
doly mood d3c436ae2e
feat(types): mixins/extends support in TypeScript (#626) 2020-06-09 10:37:00 -04:00
Andrew Talbot 054ccecd58
perf(core): use `startsWith` instead of `indexOf` (#989) 2020-04-20 15:44:20 -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 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 c5f0f63b91 refactor(runtime-core): make setup attrs proxy dev only 2020-04-06 17:57:27 -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