Commit Graph

1147 Commits

Author SHA1 Message Date
Herrington Darkholme 4502a0eab5
refactor(compiler): refine CDATA endTokens (#4459) 2021-09-01 16:43:10 -04:00
Herrington Darkholme 7178716b4c
chore: fix typo in error message (#4434) [ci skip] 2021-09-01 16:42:24 -04:00
Evan You 935b4e2210 fix(compiler-core): remove no longer necessary withScopeId import in generated code 2021-09-01 11:30:34 -04:00
Evan You 72d2b26e96 release: v3.2.6 2021-08-24 12:54:30 -04:00
Evan You 4c468eb30a fix(build): avoid imports to @babel/types in client build of compiler-core 2021-08-24 12:39:38 -04:00
Evan You a137d73e91 release: v3.2.5 2021-08-24 11:54:22 -04:00
shadowings-zy 32827506ff
fix(compiler-core): fix duplicated component identifier for names with non-ascii chars (#4429)
fix #4422
2021-08-24 11:48:08 -04:00
Evan You f1fa30adc3 refactor(ref-transform): improve algorithm into one pass 2021-08-23 18:22:21 -04:00
Evan You 06051c4bf2 feat(experimental): support ref transform for sfc normal `<script>` 2021-08-23 16:00:46 -04:00
Evan You 986681568f chore: export extractIdentifiers 2021-08-23 12:18:43 -04:00
Evan You e565831c98 feat(experimental): shouldTransform for ref-transform 2021-08-23 10:45:58 -04:00
Evan You db8dc753c0 feat(experimental): standalone ref transform 2021-08-22 22:21:42 -04:00
Evan You 84b24a71f0 chore: bump deps 2021-08-22 15:33:21 -04:00
Evan You 73f8cae465 refactor(compiler): further extract babel ast utilities 2021-08-22 14:51:16 -04:00
Evan You 62f752552a refactor(compiler): extract shared ast transform utils
Also improve referenced identifier check using isReferenced from  @babel/types
2021-08-22 13:24:16 -04:00
Evan You 6be6c268e8 test(compiler-core): include test case for expression prefixing in assignments 2021-08-22 12:33:00 -04:00
Evan You ceace3a8cc release: v3.2.4 2021-08-17 12:26:50 -04:00
Evan You 03abc2573c release: v3.2.3 2021-08-16 18:25:32 -04:00
fishDog 092bdcdf58
fix(compiler-core): fix style binding edge case (#4319)
where static `style` attribute and `:style` with constant binding are used together

fix #4317
2021-08-16 16:37:31 -04:00
Evan You a6c1db2728 fix(compiler-core): fix hoisting logic for elements with cached handlers + other bindings
fix #4327
2021-08-16 15:57:10 -04:00
Evan You 7ffa225aa3 release: v3.2.2 2021-08-11 11:40:25 -04:00
Evan You 2749c15170 release: v3.2.1 2021-08-09 16:29:53 -04:00
Evan You 5a7a43cc3d release: v3.2.0 2021-08-09 15:51:53 -04:00
Evan You 4781965cc2 release: v3.2.0-beta.8 2021-08-06 23:12:27 -04:00
fishDog abb3a81e87
fix(compiler-core): detected forwarded slots in nested components (#4268)
fix #4244
2021-08-06 22:37:55 -04:00
edison a211e271ee
fix(v-memo): ensure track block when returning cached vnode (#4270)
fix #4253
2021-08-06 21:44:45 -04:00
Evan You b357009a82 release: v3.2.0-beta.7 2021-07-29 13:21:30 -04:00
Evan You 204e194d2b release: v3.2.0-beta.6 2021-07-27 18:56:02 -04:00
Evan You 4b595a3ea1 release: v3.2.0-beta.5 2021-07-23 16:10:22 -04:00
Evan You fe58bae412 release: v3.2.0-beta.4 2021-07-21 17:40:25 -04:00
webfansplz 9c931d8154
chore(types): remove unnecessary non-null assertion (#4169) 2021-07-21 15:50:08 -04:00
Evan You 9d5dd2da8c release: v3.2.0-beta.3 2021-07-20 17:47:03 -04:00
Evan You 1034546a4c release: v3.2.0-beta.2 2021-07-19 19:36:55 -04:00
Evan You a21ca3dccc fix(compiler-core): fix self-closing tags with v-pre 2021-07-19 19:29:28 -04:00
Evan You 7e75b4105a refactor: better fix for ec6abe8d 2021-07-19 19:23:44 -04:00
Evan You ec6abe8d5e fix(compiler-sfc): fix whitespace preservation when block contains single self-closing tag 2021-07-19 18:54:35 -04:00
Evan You 47f488350c chore: run updated prettier 2021-07-19 18:24:18 -04:00
Austin Keener dd0f9d1ce6
feat(compiler): allow 'comments' option to affect comment inclusion in dev (#4115)
Close: #3392
Replace: #3395
2021-07-19 11:40:37 -04:00
webfansplz df0ce21836
chore(types): improve of type assertion (#4141) 2021-07-19 10:32:07 -04:00
Evan You d4c67dd253 release: v3.2.0-beta.1 2021-07-16 14:44:06 -04:00
Evan You 317654b34f chore: fix codegen error due to scopeId deprecation change 2021-07-16 14:30:49 -04:00
fishDog eca4d7891a chore(compiler-core): reduce unnecessary cache inside v-once (#4112) 2021-07-16 14:30:49 -04:00
Evan You e5a4412764 feat(sfc): support namespaced component tags when using `<script setup>` 2021-07-16 14:30:49 -04:00
Evan You a8edf2bdff refactor: remove outdated slot ctx wrapper codegen 2021-07-16 14:30:49 -04:00
Evan You 29732c2c86 fix: ignore .prop/.attr modifiers in ssr 2021-07-16 14:30:49 -04:00
Evan You f596e008ef refactor: remove deprecated scopeId codegen
BREAKING CHANGE: Output of SFC using `<style scoped>` generated by 3.2+
will be incompatible w/ runtime <3.2.
2021-07-16 14:30:49 -04:00
Evan You 1c7d737cc8 feat: support v-bind .prop & .attr modifiers
Also allows render function usage like the following:

```js
h({
  '.prop': 1, // force set as property
  '^attr': 'foo' // force set as attribute
})
```
2021-07-16 14:30:49 -04:00
Evan You 3b64508e3b feat: v-memo 2021-07-16 14:30:49 -04:00
Evan You b7ea7c1485 perf: also hoist all-static children array 2021-07-16 14:30:49 -04:00
Evan You 02339b67d8 perf: hoist dynamic props lists 2021-07-16 14:30:49 -04:00
Evan You 63a51ffcab chore: fix test failing types 2021-07-16 14:30:49 -04:00
HcySunYang ceff89905b perf: improve VNode creation performance with compiler hints (#3334) 2021-07-16 14:30:49 -04:00
Evan You 31abdc8ada release: v3.1.5 2021-07-16 12:38:01 -04:00
Evan You 5af718ba41 fix(v-model): support calling methods in v-model expression
close #3993
2021-07-15 13:34:42 -04:00
Evan You 395572b593 fix(v-on): proper member exp detection for bracket assignment
fix #4097
2021-07-15 13:26:09 -04:00
Evan You 963085d18c fix(v-on): properly detect member expressions with optional chaining
fix #4107
2021-07-15 12:23:07 -04:00
edison c23153d82e
fix(compiler-core): fix forwarded slots detection on template slots (#4124)
fix #4123
2021-07-15 11:37:11 -04:00
Evan You 348c3b01e5 release: v3.1.4 2021-07-02 08:37:50 -04:00
Evan You a44d528af1 fix(codegen): ensure valid types in genreated code when using global directives
fix #4054
2021-07-02 07:59:47 -04:00
Evan You fc7b640041 release: v3.1.3 2021-07-01 19:28:06 -04:00
Evan You d2df28dca4 fix(compiler-core): properly exit self-closing pre tag
fix #4030
2021-07-01 15:34:12 -04:00
Evan You d35e0b1468 feat(sfc): change `<script setup>` directive resolution to require v prefix
close #3543
2021-06-28 17:35:31 -04:00
Evan You 6b6d566861 release: v3.1.2 2021-06-22 14:24:50 -04:00
Evan You 08e93220f1 fix(compiler-core/compat): fix is prop usage on components
also fix v-bind:is usage on plain element in compat mode

fix #3934
2021-06-21 16:16:49 -04:00
Evan You bc100c5c48 fix(compiler-core): improve member expression check
fix #3910
2021-06-09 11:57:48 -04:00
Evan You ade9bd9daa release: v3.1.1 2021-06-07 16:26:54 -04:00
Evan You ac15df46c5 release: v3.1.0 2021-06-07 12:38:42 -04:00
Evan You 71f7c25fbe release: v3.1.0-beta.7 2021-06-02 16:12:54 -04:00
edison 2c7bd42801
fix(compiler-sfc): fix template expression assignment codegen for script setup let refs (#3626)
fix #3625
2021-05-28 17:58:46 -04:00
Evan You aa96a0e88a release: v3.1.0-beta.6 2021-05-28 16:58:54 -04:00
HcySunYang 9b2e894017
fix(compiler-core): improve the isMemberExpression function (#3675) 2021-05-27 21:07:26 -04:00
Evan You f0eb1978b2 release: v3.1.0-beta.5 2021-05-26 16:06:51 -04:00
Evan You f1f52300e6 release: v3.1.0-beta.4 2021-05-24 19:16:44 -04:00
HcySunYang 7c74feb3dc
fix(compiler-dom): comments in the v-if branchs should be ignored when used in Transition (#3622)
fix #3619
2021-05-24 17:10:29 -04:00
HcySunYang 47da92146c
fix(compiler-core): fix whitespace management for slots with whitespace: 'preserve' (#3767)
fix #3766
2021-05-13 18:24:43 -04:00
Evan You b663aa8a81 release: v3.1.0-beta.3 2021-05-12 17:37:04 -04:00
HcySunYang a56ab148fd
fix(compiler-core): bail out to array children when the element has custom directives + only one text child node (#3757) 2021-05-12 16:12:32 -04:00
Evan You 99a5ccf6b2 release: v3.1.0-beta.2 2021-05-08 16:59:12 -04:00
Evan You ed6c5fe903 release: v3.1.0-beta.1 2021-05-08 16:24:34 -04:00
Evan You 61edb700d7 wip: only generate non-scope slot flag when compatConfig is present 2021-05-05 16:36:16 -04:00
Evan You 7a8cee8688 wip: remove v-if key warning as there are legit use cases 2021-05-05 16:35:44 -04:00
Evan You 7f93c76b96 wip: exclude legacy slots from $scopedSlots 2021-05-05 11:06:15 -04:00
Evan You ae0fb14305 wip: fix native template compat 2021-05-04 18:26:28 -04:00
Evan You bd3cc4d2c7 wip: tests for compiler compat 2021-04-30 15:50:32 -04:00
Evan You b4c92ccf6b wip: move compat test cases + filter tests 2021-04-29 16:58:14 -04:00
Evan You e486254431 fix(compiler-core): preserve comment content in production when comments option is enabled 2021-04-28 11:22:16 -04:00
Evan You 86703c23a6 wip: ref v-for compat 2021-04-26 17:35:41 -04:00
Evan You b047a0864c refactor(compiler): improve whitespace: 'preserve' behavior from #1600
- discard leading/ending whitespace inside an element
- condense preserved whitesapce into single space
2021-04-26 11:46:17 -04:00
CodeDaraW dee3d6ab8b feat(compiler-core): whitespace handling strategy 2021-04-26 09:44:27 -04:00
Evan You 7dc681c196 wip: filters compat 2021-04-19 12:29:55 -04:00
Evan You 3ea68691e2 wip: inline-template compat 2021-04-17 23:19:40 -04:00
Evan You 1390ece04f wip: refactor 2021-04-17 22:50:16 -04:00
Evan You 505269405e wip: plain template tag compat 2021-04-17 22:16:48 -04:00
Evan You 048ac299f3 perf(compiler): skip unncessary checks when parsing end tag 2021-04-17 22:05:18 -04:00
Evan You 2c31227e7c wip: warn v-bind object ordering 2021-04-17 20:53:55 -04:00
Evan You bf41354abd wip: remove unncessary deprecation messages 2021-04-17 16:13:57 -04:00
Evan You c5c304af14 wip: compiler should default to v3 behavior 2021-04-17 15:55:14 -04:00
Evan You 3528ced0b4 wip: warn key usage of v-if branches 2021-04-17 15:35:44 -04:00
Evan You ab21468982 wip: warn v-if/v-for co-usage 2021-04-17 14:38:30 -04:00
Evan You 7ceb873783 wip: v-bind.sync compat 2021-04-16 17:11:44 -04:00
Evan You ad97bbab85 wip: invert compiler compat behavior default during tests 2021-04-16 12:26:17 -04:00
Evan You bbf708dbe9 wip: support configuring compiler deprecations at runtime + warn invalid deprecation configs 2021-04-16 12:19:12 -04:00
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
Evan You ae2caad740 wip: support resolving directives from setup scope variables by naming convention
v-my-dir can be resovled from setup scope variable named "vMyDir".
2020-11-24 19:04:21 -05:00
Evan You 90bdf59f4c refactor(compiler): better constant hoist/stringify checks 2020-11-20 19:26:07 -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 4c6078ce25 fix(compiler-core/compiler-sfc): handle destructure assignment expressions 2020-11-18 22:39:08 -05:00
Evan You 4d5242128e chore: fix tests 2020-11-18 22:34:55 -05:00
Evan You 64160e89cc wip: ignore non-ref const mutation cases in codegen 2020-11-18 21:16:09 -05:00
Evan You 8567feb2aa wip: properly handle assignment/update expressions in inline mode 2020-11-18 19:38:38 -05:00
Evan You 4449fc3b9e refactor: finer grained binding types for setup 2020-11-18 19:38:38 -05:00
Evan You 760443dca6 wip: ensure string template refs work in inline mode 2020-11-18 19:38:38 -05:00
Evan You cdc9f336fd wip: new cssVars SSR integration + fix cssVars SSR injection for suspense 2020-11-17 18:54:47 -05:00
Evan You a67325140b wip: test case for v-model + inline mode codegen 2020-11-17 15:59:09 -05:00
Evan You c15bd6235e wip: generate valid v-model and TS code in script setup inline mode 2020-11-17 12:42:58 -05:00
Evan You 41bb7fa330 feat(compiler-sfc): new SFC css varaible injection implementation
ref: https://github.com/vuejs/rfcs/pull/231
2020-11-16 18:27:25 -05:00
Evan You 8ba3a7de40 wip: fix dts tests 2020-11-13 00:12:04 -05:00
Evan You 292a657861 wip: fix runtimeConstant marking 2020-11-12 22:44:18 -05:00
Evan You 0ca9137188 wip: tests for defineContext() 2020-11-12 18:11:25 -05:00
Evan You 128621d6a0 wip: further optimize bindings 2020-11-12 16:11:14 -05:00
Evan You 6a9b56ca60 wip: defineContext() 2020-11-12 14:10:39 -05:00
Evan You 2a4fc32d15 wip: remove unnecessary inlinePropsIdentifier option 2020-11-11 10:36:59 -05:00
Evan You 4e8ef55237 wip: optimize binding access to known imported components 2020-11-10 18:06:38 -05:00
Evan You 4977526a2b wip: correctly resolve component in setup inline mode 2020-11-10 17:36:06 -05:00
Evan You 3019508e75 wip: fix binding type fallback 2020-11-10 17:31:09 -05:00
Evan You 886ed7681d feat(compiler-sfc): compileScript inline render function mode 2020-11-10 16:28:34 -05:00
Evan You 3f99e239e0 feat(compiler-sfc): support kebab-case components in `<script setup>` sfc template 2020-11-09 17:22:58 -05:00
Evan You 556560fae3 feat(compiler-sfc): new script setup implementation
- now exposes all top level bindings to template
- support `ref:` syntax sugar
2020-10-29 15:03:39 -04:00
Evan You f2d03a59c6 release: v3.0.2 2020-10-20 16:24:12 -04:00
Hunter 6d2a1cb64d
fix(compiler-core): fix multiline member expression check (#2436)
fix #2426
2020-10-20 09:31:08 -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
Evan You f17f0ddf68 release: v3.0.1 2020-10-15 12:37:21 -04:00
Evan You dbc29c32e3 build(deps): bump @babel/types from 7.11.5 to 7.12.0 2020-10-15 12:02:20 -04:00
meteorlxy e2c9ab1991
test(compiler-core): more test cases for baseParse (#2211) 2020-10-13 16:03:33 -04:00
ᴜɴвʏтᴇ 692197be33
fix(compiler-core): fix v-if key injection with v-on object syntax (#2368)
fix #2366
2020-10-13 12:04:52 -04:00
ᴜɴвʏтᴇ 89c5909a6f
fix(compiler-core): allow spaces between if-else branches (#2305)
fix #2299
2020-10-07 20:57:17 -04:00
Evan You f9566f00df test(compiler-core): add test case for v-on event case conversion 2020-10-06 18:31:04 -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 f4119249f2 fix(compiler-core): consistently remove comment nodes for pre tags in production
close #2217
2020-10-05 17:53:34 -04:00
HcySunYang 9499871582
fix(compiler-core): make v-once work with v-if/else-if/else (#2182)
Partial fix for #2035
2020-10-05 11:58:37 -04:00
meteorlxy 64f44c671a
chore(compiler-core): fix typo in tests (#2209) 2020-09-23 12:25:52 +02:00
Evan You d8c1536ead release: v3.0.0 2020-09-18 11:28:05 -04:00
Evan You 876ecc8672 release: v3.0.0-rc.13 2020-09-18 01:39:30 -04:00
Evan You 985bd2bcb5 release: v3.0.0-rc.12 2020-09-16 13:50:13 -04:00
Evan You f2ef7d7c8e release: v3.0.0-rc.11 2020-09-15 13:15:42 -04:00
Evan You 87ca99e396 chore: bump deps 2020-09-15 13:04:28 -04:00
edison b29bc0d694
chore(compiler-core): define `child` if necessary. (#2033) 2020-09-14 20:56:53 -04:00
Evan You be946ea549 fix(compiler-core): fix prefixing for `<template v-for>` key expressions
fix #2085
2020-09-14 17:04:27 -04:00
Evan You a096a58e41 fix(compiler-core): fix v-if block handling for components that fail to resolve
fix #2058
2020-09-14 12:41:35 -04:00
Evan You 4386653e76 release: v3.0.0-rc.10 2020-09-02 12:41:54 -04:00
Evan You 52e45a9850 fix(v-once): fix v-once usage with v-if and v-for
fix #2035
2020-09-02 12:30:37 -04:00
Guillaume Chau 5df71b739d chore: add repository directories 2020-08-30 15:06:06 +02:00
Evan You 94d94bafc5 release: v3.0.0-rc.9 2020-08-26 18:21:18 -04:00
Evan You ede2e0d1b5 release: v3.0.0-rc.8 2020-08-25 10:31:52 -04:00
Evan You 6602d6dbff release: v3.0.0-rc.7 2020-08-21 14:13:05 -04:00
XRenSiu bb54a84cd1
chore: use '@vue/shared' instead of '@vue/shared/src' (#1915) 2020-08-21 12:50:06 -04:00
Evan You 91700fbec2 refactor(compiler-core): simplify hoistStatic check for nodes without patchFlag
close #1912
2020-08-20 11:43:34 -04:00
underfin 69cfed6b31
fix(compiler-core): should attach key to single element child of `<template v-for>` (#1910) 2020-08-20 10:09:57 -04:00
Evan You 91c4735416 release: v3.0.0-rc.6 2020-08-19 18:17:42 -04:00
Evan You 24041b7ac1 fix(compiler-core): generate NEED_PATCH flag for element with vnode hooks 2020-08-19 17:30:44 -04:00
edison 075d769e0b
chore: fix typo for `babelParserDefautPlugins` (#1897) 2020-08-19 09:53:09 -04:00
Barthélémy Ledoux 62b9d02f6f
feat(compiler-core): add `comments` parser option (#1858) 2020-08-17 11:20:28 -04:00
Evan You b0d01e9db9 dx(compiler-core): warn on `<template v-for>` key misplacement
Note: the behavior is different from Vue 2. `<template v-for>` are compiled
into an array of Fragment vnodes so the key should be placed the `<template>`
for v-for to use it for diffing.
2020-08-04 12:20:32 -04:00
Evan You de0c8a7e3e fix(compiler-core): v-if key error should only be checking same key on different branches 2020-08-04 12:01:18 -04:00
Aurelius333 86cdf6694d
chore(compiler-core): improve X_V_IF_KEY error message (#1757) 2020-08-03 17:14:14 -04:00
Evan You 848d9ce2ea release: v3.0.0-rc.5 2020-07-28 17:42:05 -04:00
Evan You 6f5d840612 feat(sfc): support resolving template components from `<script setup>` exports 2020-07-28 17:31:46 -04:00
Evan You 58b4a382f9 refactor(compiler-core): emit error on v-if key usage 2020-07-28 15:18:41 -04:00
Evan You fbf865d9d4 fix(compiler-core): always compile Teleport and Suspense as blocks 2020-07-28 11:12:43 -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 71c3c6e2a0 fix(v-model): allow v-model usage on declared custom elements
fix #1699
2020-07-27 17:09:30 -04:00
Evan You ba17c871d8 feat: support delimiters option for runtime compilation
close #1679
2020-07-23 14:27:17 -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 be4df124e6 refactor: move @babel/types to dev deps, reduce install size 2020-07-20 22:14:05 -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
HcySunYang f9826fa963
fix(compiler-core/v-on): fix codegen for event handler with newlines (#1640) 2020-07-19 11:48:26 -04:00
Evan You 0ea14cade9 release: v3.0.0-rc.1 2020-07-17 15:30:17 -04:00
lawvs a935998b33
chore: better comment hovers preview [ci skip] (#1612) 2020-07-17 11:24:12 -04:00
Evan You 5ed73cd874 release: v3.0.0-beta.24 2020-07-16 13:51:52 -04:00
Evan You 8b5d153d7f release: v3.0.0-beta.23 2020-07-16 12:48:56 -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 fcbefdb769 release: v3.0.0-beta.22 2020-07-15 12:43:41 -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
Evan You 9188e9ea74 release: v3.0.0-beta.21 2020-07-14 17:18:07 -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 9152a89016 fix(v-on): capitalize dynamic event names 2020-07-13 17:36:46 -04:00
Evan You 576344d2c3 refactor(compiler): extract isStaticExp util 2020-07-13 16:48:24 -04:00
Evan You 65beba98fe fix(slots): differentiate dynamic/static compiled slots
fix #1557
2020-07-13 12:36:41 -04:00
Evan You b9595e64cf feat: ssr support for `<style vars>` 2020-07-12 18:04:09 -04:00
Evan You b6cdd5621e wip: template binding optimization 2020-07-10 22:12:25 -04:00
Evan You b51b79f5c4 refactor: rename optimizeBindings -> optimizeImports 2020-07-10 20:43:52 -04:00
Evan You 4c43d4e5b9 feat(compiler-sfc): `<script setup>` support (experimental)
This is the last commit for the feature which adds async/await detection.
2020-07-10 18:00:13 -04:00
Evan You 3e1cdba9db wip: tests for compileScriptSetup 2020-07-09 12:17:28 -04:00
Evan You a47478caf4 wip: compileScriptSetup full js support 2020-07-09 12:17:28 -04:00
Evan You 1359cc3a28 wip: compileScriptSetup 2020-07-09 12:17:28 -04:00
Evan You 20df2f3817 release: v3.0.0-beta.20 2020-07-08 12:45:30 -04:00
Evan You 87c2a1e50f fix(compiler-core/v-on): bail caching for member expression handlers on components
to preserve correct arity when it is passed down.
fix #1541
2020-07-08 11:48:12 -04:00
Evan You 4b5ce8b456 refactor(compiler-core): remove unnecessary arg in cached handler codegen 2020-07-08 11:48:12 -04:00
Felix Rilling 829b35e426
chore: typo fixes (#1546)
* chore: fix typos in comments/JSDoc.

* chore: fix typo in internal function name.

* chore: fix typos in test comments/descriptions/variable names.
2020-07-08 12:32:42 +02:00
Evan You d5ab70ba66 release: v3.0.0-beta.19 2020-07-07 10:04:31 -04:00
Jack Robertson 64e2f46436
fix(compiler-core): add `\r` to accepted chars after end tag name (#1515)
fix #1476
2020-07-06 16:00:26 -04:00
Evan You 7f83856f34 release: v3.0.0-beta.18 2020-07-01 21:06:25 -04:00
Evan You f6da6bf999 release: v3.0.0-beta.17 2020-06-30 12:10:15 -04:00
Evan You ec3c12ee10 release: v3.0.0-beta.16 2020-06-29 18:34:50 -04:00
Evan You afe13e0584 fix(ssr): fix ssr scopeId on component root 2020-06-27 00:27:44 -04:00
Evan You 7777473ddd chore: fix missed snapshots 2020-06-26 17:00:50 -04:00
Evan You d5dbd27193 fix(ssr): handle fallthrough attrs in ssr compile output 2020-06-26 16:55:37 -04:00
HcySunYang 8a2cf21b71
perf(compiler-core): treat v-for with constant exp as a stable fragment (#1394) 2020-06-17 16:13:14 -04:00
Joseph Xia d57749cbf7
test(compiler-core): add v-if with comments test case (#1389) 2020-06-17 16:01:12 -04:00
Evan You 605953a154 refactor: only inject rest args for member expression handlers + fix tests 2020-06-15 15:24:46 -04:00
Cathrine Vaage 7e28173312
fix(compiler-core/v-on): pass noninitial arguments in cached event handlers (#1265) 2020-06-15 15:04:03 -04:00
underfin 35dbef268c
fix(compiler-core): should not prefix object method (#1375) 2020-06-15 11:20:00 -04:00
Evan You afb231ec5c fix(compiler-core): skip empty expressions when validating expressions in browser mode 2020-06-15 10:59:03 -04:00
Evan You cf2f278f48 release: v3.0.0-beta.15 2020-06-12 18:09:05 -04:00
Evan You 91fa52850a chore: lint for unused arguments 2020-06-12 16:31:31 -04:00
Evan You 825ec1500f fix(compiler-core): support static slot names containing dots for 2.x compat
close #1241
2020-06-12 16:09:27 -04:00
Evan You 0d26413433 fix(compiler-core): fix parsing for directive with dynamic argument containing dots 2020-06-12 15:59:13 -04:00
Evan You e29f0b3fc2 feat(compiler): better warning for invalid expressions in function/browser mode
fix #1266
2020-06-11 16:31:51 -04:00
Evan You f3623e4d1e fix(compiler-core): fix prod whitespace/comment removal
fix #1256
2020-06-11 11:45:10 -04:00
Evan You 80c868aefe workflow: setup eslint for prohibited syntax and globals
fix #1285
2020-06-10 16:54:23 -04:00
Evan You 9b5d13e598 fix: bail stringification for slots
fix #1281, close #1286
2020-06-10 14:31:59 -04:00
Carlos Rodrigues 958b6c80cf
fix(compiler-core): allow multiline expression on v-model and v-on (#1234) 2020-06-09 17:24:48 -04:00
Evan You 5f15d9aa4b fix(compiler-ssr): should escape template string interpolation chars in generated code 2020-05-26 14:38:24 -04:00
Evan You 32b3f78a36 release: v3.0.0-beta.14 2020-05-18 14:42:11 -04:00
Evan You dd2bfb5a8f fix(compiler-dom): should bail stringification on runtime constant regardless of position
ref: vuejs/vite#157
2020-05-18 10:04:18 -04:00
Evan You 449fd05ad6 release: v3.0.0-beta.13 2020-05-16 21:53:47 -04:00
Evan You d965bb6227 feat: improve static content stringiciation
Now a single static vnode can contain stringified content
for multiple consecutive nodes, which greatly improves the
coverage of this optimization.
2020-05-16 21:30:16 -04:00
Evan You baa6973b13 wip(compiler): tests for new stringification 2020-05-15 15:50:42 -04:00
Evan You cb9444807e wip(compiler): improve node stringification to support adjacent nodes 2020-05-15 12:58:44 -04:00
Evan You c2f3ee4dc0 chore: use jsdoc comments in ast 2020-05-15 11:00:07 -04:00
Evan You 3c88299f6a release: v3.0.0-beta.12 2020-05-11 15:52:37 -04:00
Evan You 7887c54dfe release: v3.0.0-beta.11 2020-05-11 14:25:36 -04:00
Evan You 13acb9134e release: v3.0.0-beta.10 2020-05-07 11:21:18 -04:00
Evan You e58beecc97 refactor(compiler/types): convert compiler options documentation to jsdoc
BREAKING CHANGE: `getTextMode` compiler option signature has changed from

  ```ts
  (tag: string, ns: string, parent: ElementNode | undefined) => TextModes
  ```

  to

  ```ts
  (node: ElementNode, parent: ElementNode | undefined) => TextModes
  ```
2020-05-07 11:01:36 -04:00
Evan You 675330ba54 fix(compiler): warn against v-bind with empty attribute value
ref: https://github.com/vuejs/vue-next/issues/1128#issuecomment-624647434
2020-05-07 10:32:54 -04:00
Evan You c32ed52b97 release: v3.0.0-beta.9 2020-05-04 17:14:42 -04:00
Evan You f9a3766fd6 fix(compiler): bail strigification on runtime constant expressions 2020-05-04 15:15:26 -04:00
Evan You 3c3fe88c64 release: v3.0.0-beta.8 2020-05-04 10:49:23 -04:00
Evan You 0dc44a6a86 release: v3.0.0-beta.7 2020-05-02 17:06:16 -04:00
Evan You b570287dfe release: v3.0.0-beta.6 2020-05-01 18:56:53 -04:00
HiiTea f0d52d5428
chore: code comment formatting (#1089) [ci skip] 2020-05-01 18:48:44 -04:00
Evan You c5e7d8b532 fix(compiler-core): hoist pure annotations should apply to all nested calls 2020-05-01 18:36:34 -04:00
Evan You cad25d95a3 fix(compiler-core): hoisted vnode calls and scoped id calls should be marked pure
Otherwise they cannot be tree-shaken
2020-05-01 17:34:11 -04:00
HiiTea 22717772dd
chore: fix typos (#1090) 2020-05-01 09:42:58 -04:00
Evan You c9bf7ded2e refactor(types): mark internal API exports and exclude from d.ts
BREAKING CHANGE: Internal APIs are now excluded from type decalrations.
2020-04-30 17:04:35 -04:00
Evan You a5bb1d02b7 release: v3.0.0-beta.5 2020-04-30 16:20:25 -04:00
Evan You bd0f7da2c6 build: add browser builds for @vue/compiler-sfc 2020-04-26 01:24:25 -04:00
Evan You d29aefcf99 release: v3.0.0-beta.4 2020-04-24 16:20:20 -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 7d858a9001 test(compiler-core): test dynamic component block 2020-04-22 14:47:31 -04:00
Evan You 7d0ab3392a fix(compiler-core): dynamic component should always be made blocks
since it can potentially resolve to plain elements

fix #1018
2020-04-22 14:45:00 -04:00
Evan You 6fefeafe98 release: v3.0.0-beta.3 2020-04-20 17:00:26 -04:00
Evan You c1a85cb124 release: v3.0.0-beta.2 2020-04-17 11:01:01 -04:00
扩散性百万甜面包 70c8c58be2
test(compiler-core): expect onError to be called (#976) 2020-04-17 08:58:38 -04:00
Evan You ca6912554c release: v3.0.0-beta.1 2020-04-16 15:45:04 -04:00
Evan You 11654a6e50 release: v3.0.0-alpha.13 2020-04-15 12:46:26 -04:00
Evan You 1068212cb2 chore: run prettier 2020-04-15 10:51:07 -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 1d9f8fc979 release: v3.0.0-alpha.12 2020-04-08 18:59:49 -04:00
Evan You 1f6e72b110 fix(compiler): support full range of entity decoding in browser builds
BREAKING CHANGE: compiler options have been adjusted.
    - new option `decodeEntities` is added.
    - `namedCharacterReferences` option has been removed.
    - `maxCRNameLength` option has been rmeoved.
2020-04-08 18:51:25 -04:00
Evan You 8c17535a47 fix(compiler): should not condense &nbsp;
fix #945
2020-04-08 17:33:07 -04:00
Evan You be666ebd59 fix(compiler): should only strip leading newline directly in pre tag 2020-04-08 16:44:32 -04:00
Evan You d531686f91 fix(compiler-core): elements with dynamic keys should be forced into blocks
fix #916
2020-04-07 18:44:21 -04:00
Evan You 7402951d94 release: v3.0.0-alpha.11 2020-04-03 21:45:50 -04:00
Evan You 7f30cb5772 fix(compiler): fix pre tag whitespace handling
- should preserve whitespace even in nested elements
- should remove leading newline per spec

fix #908
2020-04-03 21:02:20 -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 a022b63605 fix(compiler-core/slots): should support on-component named slots 2020-04-01 20:44:53 -04:00
Igor Randjelovic 20f4965b45
feat(compiler-core): export `transformElement` from compiler-core (#907) 2020-04-01 11:25:05 -04:00
Evan You 9ed9bf3687 feat(portal): SSR support for portal disabled prop 2020-03-30 11:24:29 -04:00
Evan You aafb880a0a feat(portal): support multiple portal appending to same target 2020-03-27 18:42:57 -04:00
Evan You b8ffbffaf7 feat(compiler-core): support v-is
see https://github.com/vuejs/rfcs/pull/149 for details
2020-03-27 16:38:31 -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 de81faf00a release: v3.0.0-alpha.10 2020-03-24 18:33:40 -04:00
Evan You c403c39126 chore: improve parser option comments [ci skip] 2020-03-24 18:29:15 -04:00
Evan You 0831b98eac fix(compiler-core): support interpolation in RCDATA mode (e.g. textarea) 2020-03-23 17:25:29 -04:00
Evan You f529dbde23 fix: dynamic component fallback to native element
fix #870
2020-03-23 14:47:04 -04:00
Evan You b8c1be18f3 refactor(types): use stricter settings
fix #847
2020-03-23 11:08:22 -04:00
ysj16 a3601e9fa7
perf(transform-vif): don't need to createBlock for a component (#853) 2020-03-20 11:29:44 -04:00
Evan You ba9a91c48c refactor: remove null comparisons 2020-03-18 18:14:51 -04:00
Evan You a1da9c28a0 fix(compiler-core): assign patchFlag for template v-if fragment
fix #850
2020-03-17 11:36:56 -04:00
Evan You 5282ff0edb release: v3.0.0-alpha.9 2020-03-16 18:56:44 -04:00
Evan You 3b40fc56db fix(compiler-ssr): fix input w/ v-bind="obj" codegen 2020-03-16 18:14:49 -04:00
Evan You 4dc8ffc378 fix: simplify and use correct ctx in withCtx 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 ecd7ce60d5 feat(compiler-core): wrap slot functions with render context 2020-03-16 13:06:46 -04:00
Evan You 586e5bb800 fix(compiler-core): fix property shorthand detection
fix #845
2020-03-16 10:27:03 -04:00
Evan You 1f9c9c14ae chore: move hydration 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 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 c75388d538 release: v3.0.0-alpha.8 2020-03-06 15:58:40 -05:00
Evan You dd2d25fee1 test(ssr): test for hydration mismatch handling 2020-03-06 15:39:54 -05:00
Evan You f7a026109d test(ssr): ssr + hydration integration test 2020-03-06 15:14:12 -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 bcb2a9b4a6 build: make @vue/shared public
This avoids it being inlined multiple times in esm bundler builds
2020-02-29 22:04:42 -05:00
Evan You 8449a9727c feat(compiler-core): switch to @babel/parser for expression parsing
This enables default support for parsing bigInt, optional chaining
    and nullish coalescing, and also adds the `expressionPlugins`
    compiler option for enabling additional parsing plugins listed at
    https://babeljs.io/docs/en/next/babel-parser#plugins.
2020-02-27 16:53:51 -05:00
Evan You 312513d255 release: v3.0.0-alpha.7 2020-02-26 14:36:38 -05:00
Evan You 3eab143843 fix(template-ref): fix string template refs inside slots 2020-02-25 18:29:51 -05:00
djy0 c11905fe36
chore: fix typo (#764) [ci skip] 2020-02-24 18:01:26 +01:00
Evan You 9ab22c7ae6 release: v3.0.0-alpha.6 2020-02-22 08:25:32 +01:00
Evan You 1b9b235663 fix(compiler-dom): properly stringify class/style bindings when hoisting static strings 2020-02-21 13:10:13 +01:00
Luxiaosong c54aa43fa7
chore: use 'const' instead of 'let' (#755) [ci skip] 2020-02-21 11:21:24 +01:00
likui 7b987d9450
fix(compiler-core): should alias name in helperString (#743)
fix #740
2020-02-19 09:49:46 -05:00
Evan You 478b4cfb2c release: v3.0.0-alpha.5 2020-02-18 15:00:55 -05:00
Evan You 028f748c32 fix(v-on): transform click.right and click.middle modifiers
fix #735
2020-02-18 14:32:06 -05:00
Evan You 66b5f0b480 chore: fix hoistStatic exhaustive check 2020-02-14 16:41:55 -05:00
Evan You e0f3c6b352 fix(compiler-core): should apply text transform to if branches
fix #725
2020-02-14 15:57:14 -05:00
Evan You 5455e8e69a fix(compiler-core): should not hoist element with cached + merged event handlers 2020-02-13 18:34:08 -05:00
Evan You 9aaef60ad2 wip(ssr): adjust event hydration flag 2020-02-13 18:28:40 -05:00
Evan You 6b505dcd23 wip(ssr): basic element hydration 2020-02-13 17:47:00 -05:00
Evan You 8b7c162125 feat(compiler-dom): handle constant expressions when stringifying static content 2020-02-12 15:00:00 -05:00
Evan You 1389d7b88c refactor(compiler-core): use more concise marker for compiled slots 2020-02-12 13:45:35 -05:00
Evan You 175f8aae8d feat(compiler): mark hoisted trees with patchFlag 2020-02-12 13:31:29 -05:00
Evan You 27913e661a feat(compiler-dom/runtime-dom): stringify eligible static trees 2020-02-12 11:56:42 -05:00
Evan You e861c6da90 test: test updates for d40c642 2020-02-11 18:40:42 -05:00
Evan You e3988b40d8 refactor(compiler-core): use dedicated node type for element codegen
Previously codegen node for elements and components used raw expressions,
which leads to multiple permutations of AST shapes based on whether the
node is a block or has directives. The complexity is spread across the
entire compiler and occurs whenever a transform needs to deal with
element codegen nodes.

This refactor centralizes the handling of all possible permutations
into the codegen phase, so that all elements/components will have a
consistent node type throughout the transform phase.

The refactor is split into two commits (with test updates in a separate
one) so changes can be easier to inspect.
2020-02-11 18:40:42 -05:00
Evan You f4c54a888b refactor(compiler-core): hoist static text calls between elements 2020-02-10 18:32:11 -05:00
Evan You 12fcf9ab95 fix(compiler): fix v-for fragment openBlock argument 2020-02-10 18:19:49 -05:00
Evan You 47e984d31f refactor(compiler): provide _ctx and _cache via arguments 2020-02-10 17:29:12 -05:00
Evan You ade07c64a1 fix(compiler-core): fix keep-alive when used in templates
fix #715
2020-02-10 16:49:37 -05:00
Evan You 571ed4226b feat(compiler-core/v-on): support @vnode-xxx usage for vnode hooks 2020-02-10 11:00:37 -05:00
djy0 782db6d7f5
chore(compiler-core/codegen): avoid generate indent spaces of empty lines. (#701) 2020-02-10 09:33:04 -05:00
Evan You 8b2d6a35d0 test: update tests and snapshots for helper prefixing 2020-02-07 19:04:55 -05:00
Evan You 51317af6e8 refactor(compiler): prefix all imported helpers to avoid scope collision 2020-02-07 18:53:39 -05:00
Evan You c44d9fbe3d build: drop unnecessary codegen branch for global build 2020-02-07 18:00:30 -05:00
Evan You a51e710396 wip(ssr): proper scope analysis for ssr vnode slot fallback 2020-02-07 13:56:18 -05:00
Evan You b7a74d0439 wip(ssr): ssr slot vnode fallback 2020-02-07 01:06:51 -05:00
Evan You 797cc18967 wip(ssr): element scopeId 2020-02-06 17:45:46 -05:00
Evan You 4cc39e14a2 feat(compiler): warn invalid children for transition and keep-alive 2020-02-06 17:45:46 -05:00
Evan You 3c27bf6133 wip(compiler-ssr): built-in component fallthrough 2020-02-06 17:45:46 -05:00
Evan You bc8f91d181 refactor(ssr): prefix ssr helpers 2020-02-06 12:07:25 -05:00
Evan You ee5ed73361 wip(ssr): basic components 2020-02-05 23:07:23 -05:00
Evan You 9b3b6962df wip(srr): slot outlet 2020-02-05 21:04:40 -05:00
Evan You 7a63103a11 chore: fix snapshot 2020-02-05 17:29:41 -05:00
Evan You 201f18b58b wip(ssr): v-model w/ dynamic type & props 2020-02-05 17:01:00 -05:00
Evan You 1f2de9e232 fix(v-model): should use dynamic directive on input with dynamic v-bind 2020-02-05 15:21:47 -05:00
Evan You 8f9e85afb1 test: fix tests w/ nested CompoundExpressions 2020-02-05 14:30:34 -05:00
Evan You c952321fcf wip(compiler-ssr): v-model static types + textarea 2020-02-05 14:23:03 -05:00
Evan You c441e88469 chore: fix snapshots 2020-02-04 22:56:53 -05:00
Evan You 8da6df7235 wip(ssr): handle `<textarea>` with dynamic key v-bind 2020-02-04 22:49:47 -05:00
Evan You 1958314976 wip(compiler-ssr): v-show 2020-02-04 21:03:16 -05:00
Evan You ebf920e6af wip(compiler-ssr): dynamic v-bind + class/style merging 2020-02-04 18:37:32 -05:00
Evan You c059fc88b9 wip(compiler-ssr): v-bind with static keys 2020-02-04 16:47:12 -05:00
Evan You ba263c909c wip(ssr): remove cjs codegen mode 2020-02-04 15:58:54 -05:00
Evan You 6a5ed49ea9 wip(ssr): v-bind basic usage 2020-02-04 12:21:04 -05:00
Evan You eb9e089277 chore: fix test types 2020-02-03 22:21:45 -05:00
Evan You 8cf6b5731d test(compiler-ssr): v-for tests 2020-02-03 20:47:41 -05:00
Evan You 93c37b94f2 wip(ssr): v-for 2020-02-03 18:31:11 -05:00
Evan You 889a0276eb wip(ssr): do not generate commas between statements 2020-02-03 18:31:11 -05:00
Evan You b685805a26 wip(ssr): ssr helper codegen 2020-02-03 18:31:10 -05:00
Evan You e8c5de6cfd wip(compiler-ssr): v-if 2020-02-03 18:31:10 -05:00
Evan You 63e4486645 wip(compiler-ssr): text and interpolation 2020-02-02 22:28:54 -05:00
Evan You 8fd9e9ba97 test(compiler-core): test TempalteLiteral and IfStatement codegen 2020-02-02 21:35:44 -05:00
Evan You efbbd19b3d wip(ssr): initial scaffold for compiler-ssr 2020-02-02 00:05:27 -05:00
Evan You 34e61197c7 refactor(compiler-core): improve template type handling 2020-01-31 17:20:52 -05:00
Evan You 78c4f321cd fix(compiler-core): only check is prop on `<component>` 2020-01-31 16:15:05 -05:00
Evan You f503167fb7 test: fix snapshots 2020-01-31 11:06:37 -05:00
Evan You 04da2a82e8 feat(compiler-core): support mode: cjs in codegen 2020-01-31 10:01:33 -05:00
Gabriel Loiácono c088169170
style(compiler-core): while/expression instead of while/true (#680) 2020-01-31 09:43:34 -05:00
Evan You 730d329f79 fix(compiler-core): relax error on unknown entities
close #663
2020-01-29 12:16:58 -05:00
Evan You d293876c34 release: v3.0.0-alpha.4 2020-01-27 16:20:00 -05:00
Evan You cc47ae0118 test: update snapshots for toDisplayString 2020-01-27 16:00:18 -05:00
Evan You 066ba82c7f wip(ssr): escape helpers 2020-01-27 16:00:18 -05:00
Evan You b41677bf42 release: v3.0.0-alpha.3 2020-01-22 11:10:30 -05:00
Evan You 4f06eebc1c fix(dom): fix <svg> and <foreignObject> mount and updates 2020-01-21 11:32:33 -05:00
Evan You f2ac28b31e fix(compiler-core): force <svg> into blocks for correct runtime isSVG
state during patch
2020-01-20 14:48:26 -05:00
Ruijia Tang aca2c2a81e fix(compiler-core): avoid override user keys when injecting branch key (#630) 2020-01-20 10:15:53 -05:00
Evan You 9f65d811af release: v3.0.0-alpha.2 2020-01-13 17:44:30 -05:00
Evan You 2ac4b723e0 fix(compiler/v-slot): handle implicit default slot mixed with named slots 2020-01-06 15:31:21 -05:00
Evan You 137893a4fd fix(compiler/v-on): handle multiple statements in v-on handler (close #572) 2020-01-06 11:45:48 -05:00
Evan You 1bb1271b5e release: v3.0.0-alpha.1 2020-01-02 18:25:17 -05:00
susiwen8 dee5480317 chore: use Boolean to filter TemplateChildNode (#569) 2019-12-30 11:26:45 -05:00
djy0 ad2a0bde98 perf(compiler-core): simplify `advancePositionWithMutation` (#564) 2019-12-30 11:25:06 -05:00
Evan You 59c595c1e8 refactor: use named export for compiled render function 2019-12-24 11:04:44 -05:00
Evan You d6275a3c31 fix(sfc): treat custom block content as raw text 2019-12-22 21:09:39 -05:00
Evan You 90ddb7c260 refactor: expose parse in compiler-dom, improve sfc parse error handling 2019-12-22 19:44:21 -05:00
Evan You 94d692b0cf test: fix tests after missing end tag error location fix 2019-12-20 10:10:08 -05:00
Evan You 3a3a24d621 feat(sfc): accept inMap in compileTemplate() 2019-12-19 16:25:05 -05:00
Evan You 02c6d5c4e3 fix: codeframe marker should have min width of 1 2019-12-19 15:42:53 -05:00
Evan You bdbfead1e0 chore: adjust package.json 2019-12-19 14:19:58 -05:00
Evan You 9550302df4 build: esm-bunlder builds should be considered browser builds 2019-12-17 17:34:10 -05:00
Evan You b689ca6e85 test: test scopeId support 2019-12-17 12:31:38 -05:00
Evan You 51980afca2 feat(sfc): wip scopeId compiler support 2019-12-17 12:31:38 -05:00
Evan You 35858cec8c build: adjust global names + allow inline overrides of build flags 2019-12-15 15:37:43 -05:00
Evan You 75113c8d3e test: fix tests 2019-12-14 22:28:54 -05:00
Evan You 49a50d3c9c feat(compiler): accept line offset in codeframe 2019-12-13 18:01:04 -05:00
Evan You b15951e190 chore: remove line numbers from default errors 2019-12-13 17:28:12 -05:00
Evan You 9e757b5cc5 refactor(compiler-core): move compile into separate file 2019-12-13 13:22:15 -05:00
Evan You 8277d131c4 refactor(compiler): downgrade to source-map v6 for sync API 2019-12-13 12:56:31 -05:00
Cr 6797e35703 chore: fix typos (#541) 2019-12-13 11:49:01 +01:00
Evan You c36941c498 fix(compiler-core): should apply text transform to <template v-for> children 2019-12-12 21:09:47 -05:00
Evan You 8ffd79c754 fix(compiler-core): handle template root and template v-if as stable fragments 2019-12-12 21:09:47 -05:00
Evan You ef50c333ce fix(core): generate fragment root with patchFlag + optimize fragment w/ patchFlag 2019-12-12 21:09:47 -05:00
Evan You 5658f8b678 feat(compiler): expose generateCodeFrame 2019-12-12 21:09:47 -05:00
Evan You 136ab753b3 build: adjust esm formats 2019-12-10 22:14:02 -05:00
Evan You 8ed04ed503 build: release script 2019-12-10 21:29:52 -05:00
Evan You 95b2cb6fd2 fix(compiler-core): should only parse interpolations in DATA text mode 2019-12-10 15:30:17 -05:00
Evan You 5cd1495767 refactor(compiler-core): centralize compiler options 2019-12-10 12:53:26 -05:00
Evan You a984d3a531 test: skip optimizing single text root 2019-12-02 15:49:59 -05:00
Evan You 42f3f9e832 fix(compiler-core): should pre-convert text nodes in all non-element cases 2019-12-02 15:17:00 -05:00
likui 810b3a3e2a feat(compiler-sfc): transform asset url (#500) 2019-12-01 12:02:53 -05:00
Evan You 0e3e07079a feat(transition): properly handle transition & transition-group in compiler 2019-11-29 12:42:04 -05:00
Evan You 4e8d57bdfb feat(compiler-core): options.isBuiltInComponent 2019-11-29 12:13:49 -05:00
Evan You 52134a88d0 fix(compiler-core): handle base-transition 2019-11-29 12:02:31 -05:00
Gabriel Loiácono 812a0626ce style(compiler): changed object-assign to spread (#507) 2019-11-28 10:49:39 -05:00
Gabriel Loiácono 009dc80674 perf(compiler-core): set simple expression outside map (#485) 2019-11-26 09:02:22 -05:00
Evan You c6fb506fc0 feat(transition): compat with keep-alive 2019-11-25 17:35:15 -05:00
Evan You 08a3d95e52 fix: resolveDynamicComponent should use context instance 2019-11-25 11:41:28 -05:00
Evan You 1765985ec2 feat(transition): support in templates 2019-11-24 18:37:59 -05:00
Evan You 9e16ea3d30 test: update snapshots 2019-11-17 21:29:12 -05:00
Evan You e89d009937 fix(compiler): include createTextVNode helper for hoisted static content (fix #465) 2019-11-17 21:26:25 -05:00
Evan You 1de072567d perf(compiler): pre-compute maxCRNameLength for perf 2019-11-16 16:19:47 -05:00
Gabriel Loiácono 2780e0df4c perf(compiler-core): add perf optimization to parseText (#458) 2019-11-15 17:48:01 -05:00
Evan You 353b06df77 perf(compiler): should only perform assertions during tests
Compiler assertions are made to ensure implementation correctness,
but they have performance costs that should not affect users
during development.
2019-11-15 17:29:08 -05:00
Evan You 51d57b4566 perf(compiler): minor perf tweaks 2019-11-15 16:47:55 -05:00
Evan You 4fef8f342a perf(compiler): improve perf of parseTextData 2019-11-15 16:17:52 -05:00
QuincyChen d7d87622ce refactor: use isArray function from shared (#441) 2019-11-08 09:52:24 -05:00
Evan You f178874ace fix(v-model): generate separate modifiers for v-model with args 2019-11-07 09:40:34 -05:00
Evan You 4b739e3bc0 fix(compiler-core): should not condense whitespace in RAWTEXT mode 2019-11-06 20:52:19 -05:00
Evan You acbbe3298c refactor: move codeframe to @vue/shared 2019-11-06 15:13:15 -05:00
Evan You 98e9b769e6 feat(compiler): support keep-alive in templates 2019-11-05 10:26:56 -05:00
Dmitry Sharshakov 4b9483fd5e feat(compiler): compile suspense children as slots (#419) 2019-11-04 14:35:00 -05:00
Evan You 5eee1152ca types: (wip) improve dts output 2019-11-01 11:32:53 -04:00
likui ea2e2ce5bd chore: fix typo (#409) 2019-10-29 13:51:48 -04:00
Cédric Exbrayat 36b7e4e52e chore: fix comments referencing renamed file [ci skip] (#404) 2019-10-28 12:04:04 -04:00
Evan You 34989ef7fe chore: license 2019-10-28 11:15:17 -04:00
Evan You ed29af7bea fix: generate v-if fallback comment as block 2019-10-24 21:19:02 -04:00
Evan You 1c0a2c6d41 refactor(compiler): use shorter helpers for text and comment nodes 2019-10-24 17:55:00 -04:00
Evan You eb20730a67 feat(compiler): preserve whitespace in pre tag, add tests 2019-10-24 16:42:09 -04:00
Evan You 9298f46f92 feat(compiler-core): whitespace handling 2019-10-24 16:22:48 -04:00
Evan You 516501e20e chore: remove unused util function 2019-10-24 15:39:31 -04:00
Evan You f7a7e8d71d refactor(parser): remove ignoreSpaces option 2019-10-24 12:47:29 -04:00
Evan You af5a8e1154 feat(compiler-core): re-implement v-once to use cache mechanism 2019-10-23 17:57:40 -04:00
Evan You 113339c7b6 fix(compiler-dom): style transform of static styles should not add STYLE patchFlag 2019-10-23 10:49:16 -04:00
Evan You 052febc127 feat(compiler): convert text mixed with elements into createVNode calls
This ensures they are tracked as dynamic children when inside blocks.
Also guaruntees compiled vnodes always have vnode children in arrays
so that they can skip normalizeVNode safely in optimized mode.
2019-10-21 15:52:29 -04:00
Evan You a0d570b16d Revert "feat(compiler-core): hoist element with static ref (#344)"
Static refs still need to be tracked in dynamicChildren because unmount
also takes the fast path when dynamicChildren is present, and all refs
need to be properly unmounted.

This reverts commit 920773fc6b.
2019-10-21 15:17:29 -04:00
Evan You 4abd8d29ef chore: fix merge conflict 2019-10-21 10:33:10 -04:00
HcySunYang 920773fc6b feat(compiler-core): hoist element with static ref (#344) 2019-10-21 10:29:17 -04:00
Evan You 1b9bd6912e perf: v-for fragments do not need to track dynamicChildren 2019-10-21 10:00:45 -04:00
HcySunYang 71f3826f99 chore: rename & property missing (#335) 2019-10-21 10:00:23 -04:00
Evan You 6f9692dcdd chore: cache isStaticNode result for missing branch 2019-10-20 17:01:01 -04:00
Evan You 869ae19c41 fix(compiler): cache handlers should be per-instance, fix hoist w/ cached handlers 2019-10-20 17:00:11 -04:00
Dmitry Sharshakov 39157f7671 chore: fix ci (#338) 2019-10-19 20:03:15 -04:00
Evan You 58593c4714 feat(v-on): cache handlers 2019-10-18 21:51:34 -04:00
Evan You e98a85f3cb refactor: applyDirectives -> withDirectives 2019-10-18 16:35:01 -04:00