Commit Graph

177 Commits

Author SHA1 Message Date
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 872b3f7ec5 fix(compiler-sfc): should also expose regular script block bindings when `<script setup>` is used
close #4369
2021-08-17 15:52:48 -04:00
似水微寒 c51fb74599
refactor(compiler-sfc): remove duplicate judgment conditions (#4368) 2021-08-17 12:12:18 -04:00
Evan You 57f10812cc fix(compiler-sfc): fix import usage check for lowercase imported components
fix #4358
2021-08-17 10:10:26 -04:00
Evan You f855ccb2c1 fix(compiler-sfc): fix import usage check in template strings in expressions
fix #4340
2021-08-16 18:03:09 -04:00
webfansplz ad66295cb3
fix(defineProps): defineProps generates unnecessary array of same types (#4353)
fix #4352
2021-08-16 17:40:00 -04:00
Evan You aae3725e57 fix(compiler-sfc): bail on import usage check when template has custom lang
fix #4312
2021-08-16 16:08:52 -04:00
Evan You 00b76d3dc1 feat(sfc): support $shallowRef ref sugar 2021-08-11 10:19:58 -04:00
Evan You e42d7794cb chore(compiler-sfc): emit compiler error against incorrect ref sugar usage 2021-08-10 14:57:47 -04:00
Evan You 1e1682f060 fix(compiler-sfc): fix import usage check for last expression 2021-08-09 16:22:20 -04:00
Evan You 88a4504e82 fix(compiler-sfc): fix import usage detection for names containing $
fix #4274
2021-08-09 12:17:22 -04:00
Evan You 1994f1200d test: improve test case for 865b84bf 2021-08-06 13:01:39 -04:00
Eugene Kopich fdc9a4d301
chore: update link in comments for new ref sugar (#4265) [ci skip] 2021-08-06 12:58:40 -04:00
Evan You 865b84bfe8 fix(compiler-sfc): fix ref sugar rewrite for identifiers in ts casting expressions
fix #4254
2021-08-06 12:55:48 -04:00
Evan You 9bee5ccea4 chore: update new ref sugar warning link 2021-08-04 17:06:23 -04:00
Evan You bf2589b1f0 refactor(compiler-sfc): use shallowRef for ref sugar destructure 2021-08-04 15:39:32 -04:00
Evan You f0ca233d8b refactor(compiler-sfc): improve script setup import expose heuristics 2021-07-22 12:53:08 -04:00
Evan You 5a3ccfd914 feat(compiler-sfc): avoid exposing imports not used in template
close #3183
2021-07-22 12:04:46 -04:00
Evan You 47f488350c chore: run updated prettier 2021-07-19 18:24:18 -04:00
Evan You 93a950d60d fix(compiler-sfc): support const enum 2021-07-19 17:31:13 -04:00
edison f7607d3a15
fix(compiler-sfc): defineProps infer TSParenthesizedType (#4147) 2021-07-19 11:09:24 -04:00
Evan You e66a493da1 refactor: remove deprecated defineEmit() support 2021-07-16 14:30:49 -04:00
Evan You 562bddb3ce feat(sfc): (experimental) new ref sugar 2021-07-16 14:30:49 -04:00
Evan You 27104eaaf0 feat: remove experimental status of `<script setup>` 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
Tan Zhen Yong e508ee08e9
chore: fix typo in inherit-attrs warning (#4094) 2021-07-15 15:45:23 -04:00
Evan You 5df7dfcd71 fix(sfc): only enable jsx parser plugin when explicitly using tsx
fix #4106
2021-07-15 13:12:06 -04:00
Evan You 03e26845e2 fix(sfc): fix `<script setup>` async context preservation logic
fix #4050
2021-07-06 14:31:53 -04:00
Evan You 6fad2093a4 fix(compiler-sfc): should not rewrite ref sugar identifiers in types
fix #4062
2021-07-05 14:41:53 -04:00
Evan You 253ca2729d fix(compiler-sfc): fix parse-only mode when there is no script setup block 2021-07-02 08:24:24 -04:00
Evan You 1ffd48a2f5 fix(compiler-sfc): support TS runtime enum in `<script setup>` 2021-06-30 12:03:42 -04:00
Evan You 601a290caa feat(compiler-sfc): compileScript parseOnly mode
This is an internal feature meant for IDE support
2021-06-29 17:56:49 -04:00
Evan You 96cc335aa7 feat(sfc): make ref sugar disabled by default 2021-06-29 15:22:26 -04:00
Evan You 0240e82a38 feat(sfc): auto restore current instance after await statements in async setup() 2021-06-29 09:24:12 -04:00
Evan You 211793d376 fix(compiler-sfc): avoid script setup marker showing up in devtools 2021-06-28 18:48:38 -04:00
Evan You 2e10261b38 chore: warn script setup compiler macro imports 2021-06-28 17:57:58 -04:00
Evan You 62c1b2f7dc fix(compiler-sfc): fix defineProps/defineEmits usage in multi-variable declarations
fix #3739
2021-06-28 16:31:55 -04:00
Evan You 2973b6c30a feat(sfc): support referenced types for defineEmits 2021-06-28 16:03:27 -04:00
Evan You afdd2f2835 fix(compiler-sfc): support method signature in defineProps
fix #2983
2021-06-28 15:39:04 -04:00
Evan You 2f91db30cd feat(sfc): support using declared interface or type alias with defineProps() 2021-06-28 15:30:28 -04:00
Evan You 4c5844a9ca feat(sfc): withDefaults helper 2021-06-26 21:11:57 -04:00
Evan You 691d354af9 fix(compiler-sfc): fix defineProps() call on imported identifier 2021-06-25 14:05:59 -04:00
Evan You be2b1d3c2f feat(sfc): defineExpose 2021-06-25 13:14:49 -04:00
Evan You a5a66c5196 fix(compiler-sfc): fix script setup hidden flag codegen 2021-06-24 10:11:30 -04:00
Evan You 075889ebfc chore: comments 2021-06-23 10:21:33 -04:00
Evan You 0b8b576428 fix(sfc): allow variables that start with _ or $ in `<script setup>` 2021-06-23 10:13:23 -04:00
Evan You 6f6f0cf5dc feat(sfc): remove `<template inherit-attrs>` support 2021-06-22 21:06:51 -04:00
Eduardo San Martin Morote a137da8a9f
feat(sfc): add `defineEmits` and deprecate `defineEmit` (#3725) 2021-06-22 15:02:56 -04:00
HcySunYang 6bfb50aff9
fix(compiler-sfc): correctly remove parens used for wrapping (#3582)
fix #3581
2021-05-28 16:02:31 -04:00
Jason 01e8ba8f87
fix(compiler-sfc): support tsx in setup script (#3825)
close #3808
2021-05-24 12:13:37 -04:00
Evan You bb8cdcad9f fix(compiler-sfc): support proper type arguments for defineEmit helper
fix #2874
2021-03-29 16:38:07 -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
Evan You 69b4727204 fix(compiler-sfc): fix function scope variable declaration marking 2021-03-29 00:32:46 -04:00
Evan You f76ddc5ac3 workflow: sfc playground 2021-03-28 01:35:45 -04:00
edison bbc5fe6a97
fix(compiler-sfc): should not rewrite scope variable (#3449)
fix #3445
2021-03-25 16:16:48 -04:00
Evan You 3e4c3ac66d build(deps): bump @babel/parser and @babel/types 2021-03-03 11:25:13 -05:00
Matias Capeletto 6d762a84ca
fix(compiler-sfc): removeSpecifier issue when removing initial imports (script-setup) (#2729) 2021-02-13 10:06:34 +01:00
Evan You 03360cefa1 fix(compiler-sfc): treat const reactive() bindings as mutable 2021-02-10 11:39:07 -05:00
Evan You fd16f2bd78 refactor: avoid global scope parentStack 2021-01-15 16:28:55 -05:00
Evan You 085bbd5fe0 fix(compiler-sfc): named imports from .vue file should not be treated as constant
fix #2699
2020-12-01 11:52:29 -05:00
Evan You 43eab923ea fix(compiler-sfc): should not remove import statements with no specifier when compiling script setup 2020-11-28 13:51:32 -05:00
Evan You faed98972c wip: support inherit-attrs="false" on sfc `<tempalte>` 2020-11-24 19:04:21 -05:00
Evan You 47d73c23e1 wip: defineOptions -> defineProps + defineEmit + useContext 2020-11-24 19:04:21 -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 62830f8fa4 wip: better experimental feature warnings 2020-11-19 20:36:15 -05:00
Evan You 6806facfa1 wip: fix default export side effect handling 2020-11-19 16:58:07 -05:00
Evan You 08879cc3b5 wip: fix compileScript script/script-setup co-usage 2020-11-19 16:17:54 -05:00
Evan You 0e86cbfcf2 wip: fix default export codegen 2020-11-19 15:30:33 -05:00
Evan You 03b2bfff09 wip: do not return type imports 2020-11-19 13:08:26 -05:00
Evan You 4c6078ce25 fix(compiler-core/compiler-sfc): handle destructure assignment expressions 2020-11-18 22:39:08 -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 bb343383f2 refactor(compiler-sfc): parse css vars directly as part of sfc descriptor 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 94736f7729 wip: css var injection production mode 2020-11-17 15:58:46 -05:00
Evan You dfac6eee99 wip: fix defineOptions specifier removal 2020-11-17 12:50:10 -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 cea8b25fed wip: fix useCssVars helper call + tests 2020-11-16 11:35:38 -05:00
Evan You a603d56970 wip: make `<script setup>` closed by default 2020-11-14 12:55:21 -05:00
Evan You 1ff5960971 wip: useOptions -> defineOptions 2020-11-13 17:38:28 -05:00
Evan You 8ba3a7de40 wip: fix dts tests 2020-11-13 00:12:04 -05:00
Evan You 001f8ce993 wip: defineContext -> useOptions 2020-11-12 22:51:40 -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 dc098c7f81 wip: defineContext 2020-11-11 19:40:27 -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 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 8cf0a40d5b chore: update warning and error messages 2020-11-09 17:00:58 -05:00
Evan You 6e3abc8605 fix(compiler-sfc): fix script setup ts helpers 2020-10-30 16:56:12 -04:00
Evan You 8485cd4843 fix: handle case of ref declaration without initial value 2020-10-30 15:29:38 -04:00
Evan You ed2eb81317 refactor(compiler-sfc): always parse explicit script setup signature 2020-10-30 12:03:14 -04:00
Evan You 941b645d58 refactor(compiler-sfc): improve compileScript error messages 2020-10-30 11:52:46 -04: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 dbc29c32e3 build(deps): bump @babel/types from 7.11.5 to 7.12.0 2020-10-15 12:02:20 -04:00
underfin 05df696a2b
fix(compiler-sfc): should extract comment for import or type declarations (#2107)
fix #2102
2020-09-15 10:39:27 -04:00