Commit Graph

2029 Commits

Author SHA1 Message Date
Evan You 355c052622 fix(runtime-core): dev root resolution should differentiate user comments vs v-if comments
fix #1704
2020-07-28 14:16:09 -04:00
underfin 578f25c34e
fix(compiler-sfc): `less` and `stylus` output deps path is absolute p… (#1685) 2020-07-28 13:45:24 -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 730e39eb76 refactor: remove unnecessary conditions and test case 2020-07-28 12:26:14 -04:00
Evan You b7ef38b773 fix(reactivity): fix ref mutation debugger event values 2020-07-28 12:01:34 -04:00
Evan You 0b3b1cfa48 fix(v-model): enable v-model type detection on custom elements 2020-07-28 11:44:39 -04:00
underfin 04a4ebaaeb
fix(runtime-core): use correct container for moving `Teleport` content (#1703) 2020-07-28 11:23:39 -04:00
Evan You fbf865d9d4 fix(compiler-core): always compile Teleport and Suspense as blocks 2020-07-28 11:12:43 -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 7e8b26eba8 refactor(runtime-core): make nextTick() promise reject on scheduler flush error 2020-07-28 10:40:25 -04:00
Evan You 3cc768f9f2 refactor(runtime-core): adjust error handling behavior
- Crash in dev to make the errors more noticeable
- Recover in prod to reduce impact on end users
2020-07-28 10:40:25 -04:00
Evan You 5c74243211 test: move mockWarn into setup files 2020-07-27 22:58:51 -04:00
underfin d4527230e4
fix(compiler-core): prevent generating invalid code for v-bind with empty expression (#1720) 2020-07-27 18:31:08 -04:00
Evan You 5fbd1f4ccb fix(compiler-core/v-on): only cache empty handler when the option is used
fix #1716

The original idea is that the empty handler can be cached in all cases,
but this contradicts with the assumption that `hasCachedProps` check in
the static hoist transform can simply return `false` in the browser
build.
2020-07-27 18:28:39 -04:00
Evan You c930f2ee8a chore: update snapshot 2020-07-27 17:45:30 -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 71c3c6e2a0 fix(v-model): allow v-model usage on declared custom elements
fix #1699
2020-07-27 17:09:30 -04:00
underfin 2a633c84ff
fix(transition): should call transition hooks inside already resolved suspense (#1698)
fix #1689
2020-07-27 16:47:07 -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 7edfdf7e23 fix(reactivity): avoid tracking internal symbols in has trap
fix #1683
2020-07-22 21:23:32 -04:00
underfin 452edb73cb
fix(compiler-sfc): fix rewrite named export default (#1675) 2020-07-22 21:00:41 -04:00
Evan You d63daaf9b6 release: v3.0.0-rc.4 2020-07-21 15:40:46 -04:00
Evan You 11c2ad4a04 fix(deps): move @babel/types back to dependencies 2020-07-21 15:39:54 -04:00
Evan You 7753485baa release: v3.0.0-rc.3 2020-07-21 15:27:26 -04:00
Rahul Kadyan 615dccd00e
feat(compiler-core/internal): add `onContextCreated` option to `generate` (#1672) 2020-07-21 15:16:20 -04:00
Evan You 4951d43526 fix(compiler-sfc): `<style vars scoped>` prefixing should only apply to pre-transform source
fix #1623
2020-07-21 15:05:28 -04:00
Evan You a28a11ef22 chore: make app root attribute consistent with scopeId attributes 2020-07-21 14:56:28 -04:00
Evan You c852bf18d7 fix(v-model): v-model listeners should not fallthrough to plain element root
fix #1643
2020-07-21 14:17:48 -04:00
Bjarki Hall 304830a764
feat(runtime-core): respect function name when using `defineComponent` function shorthand (#1661) 2020-07-21 13:15:26 -04:00
Evan You 1af3531719 fix(runtime-core): fix attr fallthrough on compiled framgent w/ single static element + comments 2020-07-21 13:11:19 -04:00
Evan You 6390ddfb7d fix(runtime-core): do not use bail patchFlag on cloned vnodes
fix #1665

- cloned vnodes with extra props will receive only the full props flag
- this commit affects `cloneVNode` behavior when used in manual render
  functions.
  - ok for normal elements since elements only use patchFlags for own
    props optimization
  - full props flag is skipped for fragments because fragments use
    patchFlags only for children optimization
  - this also affects `shouldUpdateComponent` where it should now only
    respect patchFlags in optimized mode, since component vnodes use
    the patchFlag for both props and slots optimization checks.
2020-07-21 13:11:19 -04:00
learningMaster 324167d3d2
test(runtime-dom): add test for vModel composition session (#1631) 2020-07-21 10:34:08 -04:00
Zardddddd60 3e412c10e0
refactor(reactive): reduce code size by assigning to a local variable (#1634) 2020-07-21 10:33:09 -04:00
Evan You fb8e83f0c2 chore: update link for the feature flag warning [ci skip] 2020-07-21 10:26:16 -04:00
Evan You 7ae07f718d docs: details on esm-bundler feature flags [ci skip] 2020-07-21 10:11:33 -04:00
Evan You be4df124e6 refactor: move @babel/types to dev deps, reduce install size 2020-07-20 22:14:05 -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
Carlos Rodrigues dabdc5e115
feat(computed): add readonly flag if no setter is provided (#1654) 2020-07-20 17:35:31 -04:00
Evan You ad199e1a25 fix(build): make transition tree-shakeable again 2020-07-20 16:17:14 -04:00
underfin 6f148d0b9a
fix(compiler-sfc): use correct importer with `useCssVars` (#1658)
fix #https://github.com/vitejs/vite/issues/578
2020-07-20 12:46:33 -04:00
Liaogming 19e41eaddc
chore(compiler-sfc): delete empty file in fixture (#1649) 2020-07-20 12:43:58 -04:00
Tan Li Hau 288b4eab9e
fix(watch): fix watching reactive array (#1656)
fixes #1655
2020-07-20 12:39:22 -04:00
Evan You 1f4045a086 release: v3.0.0-rc.2 2020-07-19 14:52:42 -04:00
Evan You af7e100ef2 fix(compiler-core): fix v-if + v-for on `<template>`
fix #1637
2020-07-19 14:36:01 -04:00
underfin 0526e5d7fa
fix(compiler-sfc): use `filename` from options when compile styl preprocessor (#1635)
fix #https://github.com/vitejs/vite/issues/577
2020-07-19 14:17:31 -04:00
Evan You 03c681e396 refactor(types): move component props interfaces + expose `AllowedComponentProps`
fix #1632
2020-07-19 14:09:53 -04:00
zhangzhonghe 2deb0c7a74
fix(keep-alive): handle "0" as cache key (#1622)
fix #1621
2020-07-19 13:31:07 -04:00
Carlos Rodrigues 8facaefcc3
fix(watch): callback not called when using `flush:sync` (#1633) 2020-07-19 13:30:24 -04:00
Evan You 4655d69983 fix(runtime-core/hmr): only use cloneNode mount optimization in prod
fix #1626
2020-07-19 13:22:58 -04:00
Evan You b3af5dbe5d chore: more detailed teleport target warning
close #1629
2020-07-19 11:52:03 -04:00
HcySunYang f9826fa963
fix(compiler-core/v-on): fix codegen for event handler with newlines (#1640) 2020-07-19 11:48:26 -04:00
Stanislav fa5ddf8d06
chore(types): convert type literals to records (#1615) 2020-07-18 22:56:28 -04:00
motao b8db7ab889
test(runtime-dom): improve v-on system key modifiers test (#1597) 2020-07-18 22:55:39 -04:00
Evan You 0ea14cade9 release: v3.0.0-rc.1 2020-07-17 15:30:17 -04:00
HcySunYang 5d8a64d53a
feat(types): deny unknown attributes on component by default (#1614)
close #1519
2020-07-17 11:43:28 -04:00
leyale e626caa4d1
chore(shared): menuitem tag has been deprecated (#1613) 2020-07-17 11:26:12 -04:00
underfin a8966457d3
refactor(devtools): extract same logic into `createDevtoolsHook` (#1608) 2020-07-17 11:25:33 -04:00
ezshine 2c3427413d
chore: typo [ci skip] (#1604) 2020-07-17 11:24:53 -04:00
lawvs a935998b33
chore: better comment hovers preview [ci skip] (#1612) 2020-07-17 11:24:12 -04:00
Evan You 341b30c961 fix(watch): post flush watchers should not fire when component is unmounted
fix #1603
2020-07-17 11:17:29 -04:00
Evan You 024a8f10f5 chore: also expose DeepReadonly in runtime-core 2020-07-17 09:29:44 -04:00
Pick 527c2c8bbb
feat(types): expose DeepReadonly type (#1606) 2020-07-17 09:28:50 -04:00
Guillaume Chau 568b6db12b
feat: Initial devtools support (#1125) 2020-07-16 18:18:52 -04:00
Evan You 5ed73cd874 release: v3.0.0-beta.24 2020-07-16 13:51:52 -04:00
Evan You d5055cd8dd refactor(compiler-sfc): simplify style preprocessors 2020-07-16 13:38:46 -04:00
Evan You 9cb29eea3a fix(compiler-sfc): fix preprocessor filename access 2020-07-16 13:36:31 -04:00
Sohaib Alam 6136cf874e
chore: fix error message (#1602)
make the error message in `compiler-dom` and `compiler-ssr` a bit
cleaner and fix grammar
2020-07-16 13:36:16 -04:00
Evan You 8b5d153d7f release: v3.0.0-beta.23 2020-07-16 12:48:56 -04:00
underfin e41d8310de
feat(compiler-sfc): export dependencies for css and css preprocessors (#1278) 2020-07-16 12:33:37 -04:00
Zardddddd60 ecf872fc95
refactor(reactive): remove unnecessary args handling in reactiveEffect (#1593) 2020-07-15 23:19:15 -04:00
无忧 22973b418b
chore: remove deprecated elements from dom tag config (#1596) 2020-07-15 23:16:28 -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 aab99abd28 fix(slots): properly force update on forwarded slots
fix #1594
2020-07-15 20:12:49 -04:00
Evan You 44e6da1402 fix(runtime-dom): unref when setting useCssVars 2020-07-15 18:31:10 -04:00
Evan You 9b5ff2b567 fix(compiler-sfc): fix useCssVars codegen 2020-07-15 18:05:35 -04:00
Evan You af4b0c2cf1 fix(compiler-sfc): prohibit src usage for `<script setup>` + do not
process non js/ts blocks in compileScript
2020-07-15 17:44:02 -04:00
Evan You 4535b1bde8 chore: remove outdated options 2020-07-15 17:05:00 -04:00
Evan You 11727b9e1e refactor(compiler-sfc): adjust sfc compileScript usage 2020-07-15 16:27:21 -04:00
Evan You 03f924e48a refactor(compiler-sfc): move sfc parse errors into return result
Also warn against `<script setup src>` usage
2020-07-15 16:00:53 -04:00
Evan You fcbefdb769 release: v3.0.0-beta.22 2020-07-15 12:43:41 -04:00
cexbrayat 9146cc485e fix(compiler-sfc): `<script setup>` warning
The warning was showing even if the component is only using a classic `<script>`
2020-07-15 12:32:11 -04:00
Evan You 5f61aa0f71 fix(hmr): fix hmr updates for reused hoisted trees
fix https://github.com/vitejs/vite/issues/514
2020-07-15 12:26:44 -04:00
Evan You 32a4cb804b test: improve coverage 2020-07-15 10:38:45 -04:00
Evan You 056a13142f test: fix fragment unkeyed fragment test flag 2020-07-15 10:10:38 -04:00
Jacob Müller fe1b27b7f8
fix(v-model): handle more edge cases in `looseEqual()` (#379) 2020-07-15 09:37:51 -04:00
春去春又来 379a8af288
test(runtime-core): add test for rendererComponent (#1393) 2020-07-15 09:34:23 -04:00
Pick b772bba558
feat(types/reactivity): use `DeepReadonly` type for `readonly` return type (#1462)
close #1452
2020-07-15 09:27:21 -04:00
underfin 246ec5c594
fix(runtime-core): do not call transition enter hooks when mounting in suspense (#1588)
fix #1583
2020-07-15 09:24:16 -04:00
HcySunYang 64c7b2f9ce
fix(compiler-core): generate incremental keys for v-if/else-if/else chains (#1589)
fix #1587
2020-07-15 09:21:40 -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 9188e9ea74 release: v3.0.0-beta.21 2020-07-14 17:18:07 -04:00
Evan You f49f95344b chore: fix types 2020-07-14 17:07:36 -04:00
underfin 583a1c7b45
fix(runtime-core): avoid scopeId as attr for slot nodes with same scopeId (#1561)
fix vitejs/vite#536
2020-07-14 17:06:39 -04:00
Pick 2b60870f8a
refactor(types): improve code readability & friendly to type hints (#1560) 2020-07-14 16:33:30 -04:00
Evan You cb6a0915c5 fix(runtime-dom): remove attrs with nullish values
fix #1576
2020-07-14 16:25:21 -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