Commit Graph

637 Commits

Author SHA1 Message Date
cyrilluce bdeac377c7
fix(compile-sfc): Support project reference with folder, (#10908)
close #10907
2024-06-10 15:25:47 +08:00
Zhaolin Liang 2594b1df57
fix(compiler-sfc): support as keyword with template literal types (#11100)
close #10962
2024-06-10 15:19:39 +08:00
No Two 2c78f8921d
chore: improve compileTemplate warn message (#11085) 2024-06-07 17:30:35 +08:00
Tycho 293cf4e131
fix(compiler-sfc): improve type resolving for the keyof operator (#10921)
close #10920 
close #11002
2024-06-07 16:27:43 +08:00
三咲智子 Kevin Deng cef446af7a
fix(compiler-sfc): `vapor` attribute on template tag 2024-06-03 03:24:23 +08:00
Kevin Deng 三咲智子 34a97edd2c
fix(compiler-sfc): throw error when import macro as alias (#11041) 2024-05-31 17:08:54 +08:00
三咲智子 Kevin Deng 334e72eeee
Merge remote-tracking branch 'upstream/minor' 2024-05-30 21:41:53 +08:00
Evan You 1d8727ec97
chore: Merge branch 'main' into minor 2024-05-30 11:21:12 +08:00
Simon He 56f5692fb6
refactor(compiler-sfc): defineOptions avoid redundant conditional judgments (#9453) 2024-05-27 17:59:29 +08:00
edison b2b5f57c2c
fix(compile-sfc): register props destructure rest id as setup bindings (#10888)
close #10885
2024-05-09 07:43:17 +08:00
Tycho 10d34a5624
fix(compiler-sfc): handle keyof operator (#10874)
close #10871
2024-05-07 07:16:14 +08:00
三咲智子 Kevin Deng fb58e65d3d
Merge remote-tracking branch 'upstream/minor' 2024-04-29 17:50:30 +09:00
Evan You d2dac0e359
feat(compiler-sfc): enable reactive props destructure by default
Also allow prohibiting usage via config.
RFC: https://github.com/vuejs/rfcs/discussions/502
2024-04-29 10:45:48 +08:00
三咲智子 Kevin Deng 7fe4712831
Merge remote-tracking branch 'upstream/main' 2024-04-25 01:59:41 +08:00
Evan You 4253a57f17
fix(defineModel): align prod mode runtime type generation with defineProps
close #10769
2024-04-24 18:21:57 +08:00
Evan You 5cef52a5c2
fix(compiler-sfc): handle readonly operator and ReadonlyArray/Map/Set types
close #10726
2024-04-22 15:36:38 +08:00
三咲智子 Kevin Deng b8c609f437
Merge remote-tracking branch 'upstream/minor' 2024-04-18 14:43:54 +08:00
yangxiuxiu 0cef65cee4
fix(compiler-sfc): fix defineModel coercion for boolean + string union types (#9603)
close #9587 
close #10676
2024-04-15 21:18:59 +08:00
Doctor Wu 54a6afa75a
fix(compiler-sfc): fix universal selector scope (#10551)
close #10548
2024-04-15 19:36:13 +08:00
edison e5919d4658
fix(compile-sfc): analyze v-bind shorthand usage in template (#10518)
close #10515
2024-04-15 16:32:04 +08:00
Evan You 2ae908d00c
chore(types): perform strict es2016 lib check when building dts 2024-04-15 15:52:48 +08:00
Evan You 7ae9dbf57d
chore(deps): bump TS to 5.4 2024-04-15 13:36:43 +08:00
liudaodanOo 34106bc9c7
fix(compiler-sfc): also search for `.tsx` when type import's extension is omitted (#10637)
Co-authored-by: liuxiaofei <liuxfb@digiwin.com>

Closes #10635
2024-04-09 16:14:11 +08:00
Doctor Wu 660cadc7aa
fix(compiler-sfc): :is() and :where() in compound selectors (#10522)
Co-authored-by: Haoqun Jiang <haoqunjiang@gmail.com>

Closes #10511
2024-03-25 14:12:33 +08:00
三咲智子 Kevin Deng b4aa5f98d7
Merge remote-tracking branch 'upstream/main' 2024-03-14 14:17:25 +08:00
Doctor Wu e76d7430aa
fix(compiler-sfc): use options module name if options provide runtimeModuleName options (#10457)
close #10454
2024-03-06 10:45:42 +08:00
三咲智子 Kevin Deng afa7ee2fb1
feat(compiler-sfc): add vapor option to script 2024-02-10 14:25:33 +08:00
三咲智子 Kevin Deng b640bb70fc
feat(compiler-sfc): respect vapor attr 2024-02-10 14:04:54 +08:00
三咲智子 Kevin Deng 164fd90df4
refactor(compiler-vapor): codegen result 2024-01-27 22:00:34 +08:00
三咲智子 Kevin Deng 51098cff94
feat: repl (#94) 2024-01-21 16:51:28 +08:00
三咲智子 Kevin Deng 736db791a4
Merge remote-tracking branch 'upstream/main' 2024-01-19 16:29:21 +08:00
Evan You 75e866bd4e fix(compiler-sfc): fix type resolution for symlinked node_modules structure w/ pnpm
close #10121
2024-01-18 13:52:42 +08:00
三咲智子 Kevin Deng af9f892afa
Merge remote-tracking branch 'upstream/main' 2024-01-14 23:33:08 +08:00
三咲智子 Kevin Deng 48bf8e4c70
fix(compiler-sfc): enable prefixIdentifiers by default when reparsing on consumed AST (#10105) 2024-01-14 09:36:04 +08:00
Evan You c60479146a dx(defineModel): warn against reference of setup scope variables in defineModel options
close #10093
2024-01-12 22:07:16 +08:00
Evan You bceccf9e21 chore(build): rename __NODE_JS__ build flag to __CJS__ 2024-01-11 18:24:21 +08:00
三咲智子 Kevin Deng c9fe3f12e7
Merge tag 'v3.4.5' 2024-01-04 17:43:25 +08:00
Evan You b20350ded5 fix(compiler-sfc): fix co-usage of defineModel transform options and props destructure
close #9972
2024-01-04 17:07:29 +08:00
三咲智子 Kevin Deng e971b0699b
Merge remote-tracking branch 'upstream/main' 2024-01-04 16:25:58 +08:00
Evan You 71d3121b72 fix(compiler-sfc): fix scss source map regression
close #9970
close #9969
2024-01-03 17:45:57 +08:00
Evan You d94d8d4bff fix(compiler-sfc): use compilerOptions when re-parsing consumed AST
fixes hydration error for custom elements
2024-01-02 21:38:13 +08:00
三咲智子 Kevin Deng 3d3d08d0f1
Merge remote-tracking branch 'upstream/minor' 2023-12-31 18:51:34 +08:00
Evan You b8d58ec4f4 fix(compiler-sfc): respect sfc parse options in cache key 2023-12-30 20:38:58 +08:00
Evan You dce99c12df fix(compiler-sfc): fix dev regression for dot / namespace component usage
close #9947
2023-12-30 18:20:14 +08:00
Evan You 6fab8551e4 feat(compiler-sfc): support passing template parsing options when parsing sfc
- This is released in a patch because it is an relatively internal API
  but required to properly fix https://github.com/vitejs/vite-plugin-vue/issues/322

- `parseExpressions` is now deprecated because it can be passed using
  original template parsing options (`prefixIdentifiers`)
2023-12-30 08:44:39 +08:00
Rizumu Ayaka a82d070890
Merge remote-tracking branch 'upstream/minor' 2023-12-29 21:03:21 +08:00
三咲智子 Kevin Deng 116c3f37ae
Merge remote-tracking branch 'upstream/minor' 2023-12-26 23:47:18 +08:00
Evan You a772031ea8 feat(defineModel): support modifiers and transformers 2023-12-26 22:13:04 +08:00
三咲智子 Kevin Deng bfe6b459d3
style: update format & lint config (#9162)
Co-authored-by: 丶远方 <yangpanteng@gmail.com>
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
Co-authored-by: Guo Xingjun <99574369+Plumbiu@users.noreply.github.com>
2023-12-26 19:39:47 +08:00
Evan You 25c726eca8 feat(compiler-sfc): export aggregated error messages for compiler-core and compiler-dom 2023-12-26 15:06:56 +08:00
Evan You 5ec937723a chore: Merge branch 'main' into minor 2023-12-24 22:50:06 +08:00
Evan You a8d0b1b38b fix(compiler-sfc): fix type resolution for shared type w/ different generic parameters
close #9871
2023-12-23 00:44:26 +08:00
Evan You 8f339ea144 chore: reuse descriptor ast in compileScript inlineTemplate mode by default 2023-12-19 18:06:04 +08:00
三咲智子 Kevin Deng 597eae423b
Merge remote-tracking branch 'upstream/minor' 2023-12-16 16:12:55 +08:00
三咲智子 Kevin Deng ef688ba92b
feat(compiler-sfc): promote defineModel stable (#9598) 2023-12-12 17:28:40 +08:00
Evan You 982a145d38 chore: Merge branch 'main' into minor 2023-12-11 22:03:28 +08:00
丶远方 9d1ca320c4
refactor(compiler-sfc): avoid unnecessary switch case fallthrough (#8998) 2023-12-11 18:23:02 +08:00
三咲智子 Kevin Deng cf77435338
refactor(compiler-core): reuse unwrapTS utility function (#9795) 2023-12-11 10:46:28 +08:00
三咲智子 Kevin Deng 5b2bd1df78
feat(compiler-sfc): support import attributes and `using` syntax (#8786) 2023-12-08 15:22:27 +08:00
三咲智子 Kevin Deng c695fdc1de
Merge remote-tracking branch 'upstream/minor' 2023-12-06 18:50:31 +08:00
白雾三语 d74d364d62
fix(custom-element): correctly handle number type props in prod (#8989)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-06 08:16:16 +01:00
Evan You 0ba131a6de
feat(compiler-sfc): analyze import usage in template via AST (#9729)
close #8897
close nuxt/nuxt#22416
2023-12-05 00:13:04 +08:00
Evan You e12b10ac3e chore: Merge branch 'main' into minor 2023-12-04 23:17:41 +08:00
yangxiuxiu c3e2c556b5
fix(compiler-sfc): fix :where and :is selector in scoped mode with multiple selectors (#9735)
close #9707
2023-12-04 16:53:21 +08:00
Evan You f12db7fb56 fix(compiler-sfc): avoid passing forEach index to genMap 2023-12-04 15:43:29 +08:00
edison eb5e307c0b
fix(compiler-sfc): support inferring generic types (#8511)
close #8482
2023-12-01 21:21:12 +08:00
Evan You 634519720a fix(compiler-sfc): deindent pug/jade templates
close #3231
close #3842
close #7723
2023-12-01 16:45:53 +08:00
Evan You e8bbc946cb
feat(compiler-sfc): analyze import usage in template via AST (#9729)
close #8897
close nuxt/nuxt#22416
2023-12-01 11:14:48 +08:00
edison 8d74ca0e6f
fix(compiler-sfc): generate more treeshaking friendly code (#9507)
close #9500
2023-12-01 02:52:26 +08:00
三咲智子 Kevin Deng 4936d2e11a
fix(compiler-sfc): throw error when failing to load TS during type resolution (#8883) 2023-11-30 18:41:21 +08:00
edison 5199a12f88
fix(cssVars): cssVar names should be double-escaped when generating code for ssr (#8824)
close #7823
2023-11-30 18:35:20 +08:00
三咲智子 Kevin Deng 377723d8b2
Merge remote-tracking branch 'upstream/minor' 2023-11-29 21:10:26 +08:00
三咲智子 Kevin Deng 55ef2f0c5f
fix(compiler-sfc): vue import 2023-11-29 20:58:10 +08:00
ZHAO Jin-Xiang fff7b864f4
feat: use enum to replace const enum (#9261)
close #1228
2023-11-29 12:24:50 +08:00
三咲智子 Kevin Deng 4549e28665
fix: playground 2023-11-29 02:38:01 +08:00
Evan You fb619cf9a4 fix(compiler-sfc): fix ast reuse for ssr 2023-11-27 15:38:30 +08:00
Evan You 678378afd5 fix(compiler-sfc): use correct compiler when re-parsing in ssr mode 2023-11-27 15:06:07 +08:00
Evan You 50cde7cfbc perf(compiler-sfc): use faster source map addMapping 2023-11-27 14:42:12 +08:00
Evan You f15d2f6cf6 perf: avoid sfc source map unnecessary serialization and parsing 2023-11-27 12:26:51 +08:00
Evan You 08f0baa2ad refactor: preserve source location convention in sfc mode for base parser
For compatibility w/ usage like https://github.com/vue-macros/vue-macros/blob/main/packages/setup-block/src/core/index.ts
2023-11-25 18:07:29 +08:00
Evan You ceec69c8cc fix: avoid confusing breakage in @vitejs/plugin-vue 2023-11-25 16:39:42 +08:00
Evan You e8e3ec6ca7 perf(compiler-sfc): remove magic-string trim on script
magic-string's trim method uses a regex check for aborting which turns
out to be extremely expensive - it cna take up to 10% time in total SFC
compilation! The usage here is purely aesthetic so simply removing it
for a big perf gain is well worth it.
2023-11-25 16:18:29 +08:00
Evan You 79d3cc6cec wip: should not reuse AST when using custom compiler 2023-11-25 16:18:29 +08:00
Evan You b6886a80b1 wip: force re-parse on reused sfc template ast 2023-11-25 16:18:29 +08:00
Evan You b59eabdc0d refactor: use more efficient walk for importUsageCheck 2023-11-25 16:18:29 +08:00
Evan You 37f9d3da8f wip: compiler-sfc should not attach ast on template with src import 2023-11-25 16:18:29 +08:00
Evan You e5afca6c1e wip: treat template with preprocessor as plain text 2023-11-25 16:18:29 +08:00
Evan You 5fc695be26 wip: support reusing template ast from sfc descriptor 2023-11-25 16:18:29 +08:00
Evan You 059caafc13 wip: pass all compiler-sfc tests 2023-11-25 16:18:29 +08:00
Evan You a60ad9180d refactor: swap to new template parser
- get rid of SourceLocation.source for memory efficiency
- move source location generation logic transform phase into the parser
  itself so that SourceLocation.source is no longer needed
  - move v-for expression parsing into the parser itself
  - added nameLoc on AttributeNode for use in transformElement

Tests are not passing yet.
2023-11-25 16:18:29 +08:00
三咲智子 Kevin Deng 79b8a0905b
feat!: remove reactivity transform (#9321)
BREAKING CHANGE: Reactivity Transform was marked deprecated in 3.3 and is now removed in 3.4. This change does not require a major due to the feature being experimental. Users who wish to continue using the feature can do so via the external plugin at https://vue-macros.dev/features/reactivity-transform.html
2023-11-21 18:06:42 +08:00
Evan You 1ea775633d chore: Merge branch 'main' into minor 2023-11-21 09:48:26 +08:00
renovate[bot] 16a6438236
chore(deps): update lint (#9627)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-11-18 10:33:24 +08:00
Bogdan Kolesnyk f18a174979
fix(compiler-sfc): malformed filename on windows using path.posix.join() (#9478)
Closes: #8671, #9583

Not fixed with: #9446

Related: #9473
2023-11-13 15:48:25 +08:00
Cong 3227e50b32 fix(compiler-sfc): support `:is` and `:where` selector in scoped css rewrite (#8929) 2023-11-10 16:44:53 +08:00
Cong c6083dcad3
fix(compiler-sfc): support `:is` and `:where` selector in scoped css rewrite (#8929) 2023-11-10 16:44:08 +08:00
auvred 3e08d246df
fix(compiler-sfc): consistently escape type-only prop names (#8654)
close #8635
close #8910
close vitejs/vite-plugin-vue#184
2023-11-10 16:23:47 +08:00
edison 9e1b74bcd5
fix(compiler-sfc): support resolve extends interface for defineEmits (#8470)
close #8465
2023-11-10 16:00:04 +08:00
Tycho d5fd343555
refactor(compiler-sfc): reuse `forAliasRE` regex from compiler-core (#9568) 2023-11-10 14:22:00 +08:00
丶远方 9d0eba916f
fix(compiler-core): fix `resolveParserPlugins` decorators check (#9566)
close #9560
2023-11-09 14:32:08 +08:00