Commit Graph

595 Commits

Author SHA1 Message Date
Evan You
79cbf21c3e wip: generate codeframe for compiler deprecations 2021-04-16 11:51:47 -04:00
Evan You
d974adb327 wip: is usage compat 2021-04-16 11:43:05 -04:00
Evan You
e130c7db23 wip: compiler deprecation config 2021-04-12 19:43:53 -04:00
Evan You
af9e6999e1 feat: support casting plain element to component via is="vue:xxx"
In Vue 3's custom elements interop, we no longer process `is` usage on
known native elements as component casting. (ref:
https://v3.vuejs.org/guide/migration/custom-elements-interop.html)
This introduced the need for `v-is`. However, since it is a directive,
its value is considered a JavaScript expression. This makes it awkward
to use (e.g. `v-is="'foo'"`) when majority of casting is non-dynamic,
and also hinders static analysis when casting to built-in Vue
components, e.g. transition-group.

This commit adds the ability to cast a native element to a Vue component
by simply adding a `vue:` prefix:

```html
<button is="vue:my-button"></button>
<ul is="vue:transition-group" tag="ul"></ul>
```
2021-04-12 13:08:07 -04:00
Evan You
422b13e798 wip: testing compiler deprecation warnings 2021-04-12 09:09:00 -04:00
Evan You
f0cf14bcc5 release: v3.0.11 2021-04-01 19:52:45 -04:00
Evan You
7f7dcc9f7d fix(compiler-sfc): fix wrong scopeId for nested <script setup> components 2021-04-01 18:11:04 -04:00
Evan You
ad6c124e6c release: v3.0.10 2021-03-30 20:05:45 -04:00
Calvin Liang
0fe567abfc
fix(compiler-core): properly transform replaced nodes (#2927) 2021-03-29 18:08:10 -04:00
Evan You
f5827fdf78 fix(compiler-sfc): do not resolve assets from setup bindings
when not using script setup

fix #3270, fix #3275
2021-03-29 16:11:38 -04:00
HcySunYang
555b016dcb
fix(compiler-core): allow PascalCase dynamic component tag usage (#3508)
fix #3507
2021-03-29 15:18:25 -04:00
Evan You
67039b3434 release: v3.0.9 2021-03-27 11:30:12 -04:00
Johnson Chu
e752bddb33
fix(compiler-core): fix slot source location (#3494) 2021-03-27 11:20:39 -04:00
Evan You
37c17091fd fix: ensure backwards compat for pre-compiled sfc components
fix #3493
2021-03-27 10:53:45 -04:00
Evan You
9ff70be2b3 release: v3.0.8 2021-03-26 17:35:44 -04:00
Evan You
abd129d845 fix(component): prioritize registered component over implicit self-reference via filename
ref: #2827
2021-03-26 10:04:36 -04:00
HcySunYang
ebedcccdc0
fix(compiler-core): allow unicode to appear in identifiers (#3443)
fix #3440
2021-03-25 17:24:18 -04:00
HcySunYang
7715c49af9
fix(compiler-core): avoid generating useless createVNode helper (#2938)
close #2739
2021-03-25 17:01:50 -04:00
funkyfun
c8aed13711
chore(types): remove redundant 'undefined' type (#3484) 2021-03-25 16:19:02 -04:00
HcySunYang
b4b82159e2
fix(compiler-core): should not condense whitespace in RCDATA text mode (#3482)
fix #3479
2021-03-25 15:53:03 -04:00
HcySunYang
4bf7ba19bf
fix(compiler-core): detect v-if branch root with comment as dev fragment (#2785)
fix #2780
2021-03-25 15:43:44 -04:00
HcySunYang
602b58ebd1
fix(compiler-core): fix the detection of forwarded slots with v-if or v-for (#3353)
fix #3347
2021-03-22 16:34:46 -04:00
Evan You
ff4d4ec249 chore: fix all test cases 2021-03-05 18:28:12 -05:00
Evan You
02cbbb718c perf: support only attaching slot scope ids when necessary
This is done by adding the `slotted: false` option to:

- compiler-dom
- compiler-ssr
- compiler-sfc (forwarded to template compiler)

At runtime, only slotted component will render slot fragments with
slot scope Ids. For SSR, only slotted component will add slot scope Ids
to rendered slot content. This should improve both runtime performance
and reduce SSR rendered markup size.

Note: requires SFC tooling (e.g. `vue-loader` and `vite`) to pass on
the `slotted` option from the SFC descriptoer to the `compileTemplate`
call.
2021-03-05 18:28:12 -05:00
Evan You
f74b16ccfe fix(compiler): properly bail stringfication for nested slot elements 2021-03-05 18:28:12 -05:00
Evan You
aea88c3280 refactor: fix implementation of SFC :slotted id handling
fix #2892
2021-03-05 18:28:12 -05:00
Evan You
1a955e2278 release: v3.0.7 2021-03-01 10:59:29 -05:00
Evan You
d9f91e26f9 release: v3.0.6 2021-02-24 15:19:31 -05:00
Evan You
c69f4ea857 fix(compiler-ssr): avoid duplicated asset imports merged from component slot client branch
fix vitejs/vite#2034
2021-02-15 12:12:50 -05:00
Evan You
03360cefa1 fix(compiler-sfc): treat const reactive() bindings as mutable 2021-02-10 11:39:07 -05:00
Evan You
734c65badd fix(compiler-core): do not mark v-for as stable on const bindings
since the source value may be a reactive array

fix vitejs/vite#1956
2021-02-09 11:57:09 -05:00
xiejiahe
1cc8712235
chore: comment initial space (#3192) [skip ci]
fix(typo): Comment add spaces.
2021-02-08 12:32:12 +01:00
Evan You
5a5d037dbb release: v3.0.5 2020-12-30 15:50:28 -05:00
Evan You
338d869c70 test(compiler-core): test expression transform w/ bindingMetadata 2020-12-04 16:46:00 -05:00
edison
47b3652ecd
chore(compiler-core): improve types (#2428) 2020-12-04 16:28:26 -05:00
Evan You
a8352506f6 refactor: cache constant check result on transform context
also fix edge case for missed createVNode import on static svg nodes
2020-12-03 11:10:40 -05:00
Evan You
ad4d3915d3 fix(compiler-core): fix missing createVNode import on nested v-for
fix #2718
2020-12-03 11:03:06 -05:00
Evan You
d067fb2dbb release: v3.0.4 2020-12-02 17:23:43 -05:00
Evan You
11a76ebd94 chore: fix snapshot 2020-12-01 09:21:39 -05:00
Evan You
e4f09c1419 fix(compiler-core/v-on): handle falsy values when caching v-on handlers
fix #2605
2020-11-30 16:30:36 -05:00
Evan You
9db7095962 fix(compiler-core): fix scope var reference check for v-on expressions
fix #2564
2020-11-30 15:19:32 -05:00
Evan You
e41b46c396 chore: annotate generated slot flag 2020-11-30 15:19:32 -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
Evan You
a76e58e5fd build: avoid shipping patch flag name strings in prod 2020-11-27 18:13:04 -05:00
Evan You
3bc2914e32 fix(attr-fallthrough): ensure consistent attr fallthrough for root fragments with comments
fix #2549
2020-11-27 18:04:26 -05:00
Evan You
55d99d729e fix(compiler-core): fix unintended imports in esm-bundler builds
fix #2258, fix #2515
2020-11-27 11:04:15 -05:00
Evan You
7cd85be2db refactor(compiler-core): reduce slot props check iterations
ref: #2490
2020-11-27 10:00:43 -05:00
edison
ef59a30cab
fix(compiler-core): transform kebab case props to camelcase on slots (#2490)
fix #2488
2020-11-27 09:48:30 -05:00
Evan You
bd6e211287 release: v3.0.3 2020-11-25 11:16:21 -05:00
Evan You
69d5c6887e wip: update directive scope variable mapping 2020-11-24 19:04:21 -05:00