Repository navigation
feat: content mapper (v4 alpha) - #6170
Draft
johnsoncodehk wants to merge 638 commits into
Draft
johnsoncodehk wants to merge 638 commits into
johnsoncodehk wants to merge 638 commits into
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
johnsoncodehk
force-pushed
the
feat/vue-content-mapper
branch
2 times, most recently
from
August 28, 2026 20:53
3f18e2b to
8213f5a
Compare
This was referenced Aug 29, 2026
Merged
5 of 6 tasks
41 tasks
2 of 31 tasks
Contributor
|
Hi @johnsoncodehk would you mind publishing this as next, or v4-alpha version on npm? |
Member
Author
|
@escaton Yes, I plan to do that, but before that, the removal of @vue/typescript-plugin needs to be completed. |
2 tasks done
1 of 8 tasks
|
I've been using this as a submodule for a few days now, and it works quite well for a simple application. It would be great if it were an alpha/development version. |
9 tasks
1 task
3 tasks done
10 tasks
Merged
7 of 11 tasks
3 tasks done
…o the point at its end The `;` that closes a truncated copy of a script block (#3632) was mapped to the char after the end of the block, which the block does not have: a range out of its source. It now maps to the point at the end. muggle-string 1.0.5 and later refuse a range out of its source, so the transform of such a file threw a RangeError there. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…andle A slice that a writer of a plugin cuts is a handle that each rewrite of the script blocks replays as a slice of its own, but its type was the slice of a muggle-string rewrite. Since muggle-string 1.0.4 only `cut` of a rewrite makes such a slice, so the types no longer matched. `VueCodegenSlice` is now the handle, `VueCodegenCode` and the options of `cut` are typed with it, the transforms that the script generator shares with the builtin plugins take a writer of either kind of slice, and the code of an interpolation, which goes into a rewrite of the expression, is typed as pieces. No runtime change. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…urce does not write The `div` that Pug adds to `.foo` is not in the template, so the offset of its tag is -1, and its code was mapped to the range from there: 3 chars from the char before the template. Its code now maps nowhere, and what is reported at the tag maps to the point where the element starts. muggle-string 1.0.5 and later refuse a range out of its source, so the transform of such a template threw a RangeError there. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1.0.5 listed a slice that the generator renders by itself as not rendered, so a `<script>` with a default export failed to transform (#6378); 1.0.6 takes that back. The range excludes 1.0.5, and @vue/language-core and @vue/content-mapper depend on the same version again. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e at an offset `getElementTagOffsets` gave -1 for the tag of an element that the template does not write, as the `div` that Pug adds to `.foo`, and its users took it for an offset: the language server asked TypeScript about the char before the template, and the hints of missing props and the scope of the template computed ranges from it. It now gives no offset for such a tag, so every user says what it does then: an element maps no code to the tag, the language server reads its attributes by the name of the tag and offers no import for it, and the hints skip it. `getWrittenTagOffsets` is for the tags that the source always writes, of components, `<template>` and `<slot>`, and throws for one that it does not. Both are in lib/template/elementTag, which the index of @vue/language-core does not export: `getElementTagOffsets` is no longer part of its API. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ithout an excess property check (#6331)
A codegen plugin got its `config` and the `vueCompilerOptions`, and nothing that tells where the project is, so it could not resolve a relative path of its options: the mapper runs in a directory of its own (#6337). Its context now has `projectDirectory`, the directory that the options of the entry resolve from, as its `plugins` do: the directory of the tsconfig, or the working directory of the mapper for a project without one. What a codegen plugin generates can depend on the directory, so it is part of the identity of a project that has one. Projects without a codegen plugin share an identity across directories as before.
Contributor
|
|
The fixes of master since the last merge, on the code that the branch moved into @vue/content-mapper: - #6346: the code generated after a copy of a script block starts on a new line where the text of the block ends its line without a line break. The rule lives in the render of a block rewrite; the tests of master are ported to tests/trailingLineBreak.spec.ts, but for its quick fix test, as the language server offers no fix for an unused declaration here. - #6344: the hyphenated event name is passed to `__VLS_ResolveEvent`. - #6335: taken as is. - #6371, #6329: the fixtures pass without a change; the branch does not join the lines of the inference-only props copy and omits the wrapper of slot parameters by ranges. The fixture of #6322 binds `v-model` to a `string | undefined`, as the branch checks what `v-model` writes back. - #6290, #6284: the document drop and the completions are those of the TypeScript language server on the branch; the changed code does not exist.
…workflow GitHub answers anonymous requests of raw.githubusercontent.com with 429 once the address of a runner is over its limit, which failed the tests on macOS twice in a row. Requests with a token have a limit of their own.
…vue/content-mapper `template-helpers.d.ts` and `vue-3.4-shims.d.ts` are only referenced by the code that @vue/content-mapper generates, so a change of a helper type and of the code that uses it was a change of two packages. They are in the `types` directory of @vue/content-mapper now, which @vue/language-core no longer has. `typesRoot` of the resolved options is `undefined` unless it is set, and the code generator falls back to its own directory; its default in the schema is `@vue/content-mapper/types`.
The grammar tests download five grammars of VS Code from raw.githubusercontent.com on every run, on three platforms and for both the push and the pull request run, and GitHub answers part of those requests with 429. Sending the token of the workflow did not change that: both runs after 25cb6b4 failed on all platforms with the token set, so the token is taken out again. The files are now cached under the hash of their lock file, shared by the platforms. grammars-sync.ts already skips a file whose checksum matches the lock, so a run with a restored cache makes no request. The first run of a branch still downloads.
The hash of the lock file differs on Windows, where the checkout converts line endings, so Windows never found the files that the Linux run saved. Any saved set is restored now; grammars-sync.ts compares each file with the checksum of the lock file and downloads the ones that differ.
Contributor
|
|
johnsoncodehk
added a commit
that referenced
this pull request
Nov 30, 2026
…Vue accepts `v-html` only took `string` and `v-text` only `string | number`, so a nullable or boolean value was an error, which it was not before 4.0. Vue does not set `innerHTML` for `null` and `undefined`, and passes the value of `v-text` through `toDisplayString` like an interpolation. `v-html` now takes `string | null | undefined` and `v-text` any value. Reported in #6170 (comment)
…` in JavaScript (#6394) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Johnson Chu <johnsoncodehk@gmail.com>
…dule scope beside `<script>` (#6395)
…up>` at module scope With both script blocks or a generic component, the body of `<script setup>` is generated inside a function, and only the imports before its first statement stayed outside: an import after it was reported as TS1232 (TS1473 in JavaScript). Vue accepts an import anywhere at the top level of the block.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Vue Language Tools v4 type-checks
.vuefiles with TypeScript 7.1's owntscthrough a Content Mapper (@vue/content-mapper), with no separatevue-tscbinary. The TypeScript code generation of Vue files lives in@vue/content-mapper, on top of@vue/language-core's parse / IR layer, and runs only inside the Content Mapper.The Vue language server no longer generates or reads TypeScript code for Vue files. It works from the
.vuesource, language-core's IR and script analysis, Vue's own types (GlobalComponents,GlobalDirectives,JSX.IntrinsicElements) and the TS 7.1 span map of the file TypeScript checks, which it reaches through the TypeScript API of the editor's TS 7.1 language server. It treats the files of anycontentMappersentry as Vue files, so it also works with a Vue Content Mapper other than@vue/content-mapper. v4 supports TypeScript 7.1 only.Quick start
Vue compiler options go directly under
options. Add"languageFeatures": falsethere for CLI-only type-checking.Breaking changes
Projects (tsconfig and CLI type-checking)
vue-tscis removed. Usetsc --runExternalCode.The Content Mapper parses with the TS 7.1
typescriptpackage that resolves from the project directory (the tsconfig's directory, or the working directory for an inferred project), and fails to open a project from which none resolves.--typescript=/VUE_CONTENT_MAPPER_TYPESCRIPTare removed.Vue options live only under
contentMappers[].options. The tsconfig's top-levelvueCompilerOptionsis no longer read, andcontentMappersis replaced wholesale throughextends(a config with its own array does not inherit the base config's entries).A file that no
contentMappersentry covers gets no Vue features. The language server creates a Vue language plugin for every entry of the file's project, whichever Content Mapper package it names, with the entry'soptionsas its Vue compiler options.strictTemplates,strictVModeland allcheckUnknown*options are removed. Template checking follows TypeScript's defaults:lang="ts"is strict,lang="js"followscheckJs/@ts-check. The permissive modes dropped specific error codes, and the Content Mapper protocol only suppresses by span, never by code.A template tag refers to the
<script setup>binding of its name, whatever it is imported from, like@vue/compiler-sfc. Components are no longer detected by the import's file extension.Unknown components and directives are always reported, so declare them. This needs Vue 3.3, so the minimum
targetis now 3.3.skipTemplateCodegenis removed. The template code and the template scope are always generated, so type checking, template completion and component meta no longer silently degrade. Setting it reports a removed-option diagnostic.vitePressExtensions/petiteVueExtensionsare replaced byoptions.format("sfc"by default,"vitepress"or"petite-vue"), set per entry instead of inferred from the extension.experimentalModelPropNameis replaced byvModelPropName, keyed by tag:{ "my-input": "value", "my-switch": "checked", "f-radio-field": false }. Entries match in any casing, are merged over built-in native rules that follow@vue/compiler-dom, and can be overridden per file with<!-- @vModelPropName { ... } -->.falsebinds no prop. Components mapped to another prop (e.g. custom elements) now check writing that prop back to thev-modelexpression instead of anupdate:modelValueevent. The old name and the old prop-keyed shape report an option diagnostic with the converted value.Vue no longer resolves CSS or asset module specifiers, and
resolveStyleImportsis removed. CSS belongs to separate CSS Content Mapper packages (e.g. a Content Mapper version of css-modules-kit).<style module src>is now an ordinaryimportthat types$style, so an unresolvable src reports TS2307.Editor users
.vuescript blocks and template expressions is unavailable (document, range and on type), and so are folding, selection ranges and outline of script blocks and JSX closing tags. They ran on classic TypeScript, which TS 7.1 replaces, and TS 7.1 has no project-free syntactic API for a block that is not a file of a project. The tests are kept as expected failures, and thevue.format.script.*/vue.format.template.*settings are kept for when TypeScript adds the API. Known v4 regression versus v3. JSDoc comment templates still work: TS 7.1 provides them, tabstops included.:foo-bar,:count,{ foo }in a template expression or in:class), so after the rename the template refers to a name that no longer exists, and renaming from the shorthand itself does nothing. v3 expanded them (:foo-bar="NEW",{ foo: NEW }). Known v4 regression versus v3; it waits on TypeScript expanding a shorthand through span maps, and the tests are expected failures. A function, class, enum or destructured prop in an object shorthand of a template expression already expands ({ format: NEW }), since the generated code reads it as written.paths(import Foo from '@/Foo.vue') gives no result; a relative specifier and the default import name lead to the file. v3 led to the component. Known v4 regression versus v3; it waits on TypeScript resolving such specifiers (expected-fail test).<script setup>or<script>of a component with a template inserts the import into the template; without a template it goes into the block. v3 (3.3.13, TypeScript 5.9.3) inserted it into the block in both cases. Known v4 regression versus v3; it waits on TypeScript placing a top-of-file import on the empty block (expected-fail test).laplacenoma.counter.n.valueof anotheruseCounter()call no longer counts as reading thenofconst { n } = useCounter()(another instance), and a call of a variable that holds a named function expression now reads what the function reads. While the TypeScript language server has another text of the script, there is no analysis.support.class.component.vueinstead of thecomponenttoken._vue:documentHighlights-fullis removed.// ^?in script blocks,<!-- ^? -->in the template) are removed. TS 7.1 gives no twoslash queries in TypeScript files either (no inlay hint for a// ^?line from its language server, and no twoslash in its build), so a Vue-only version would make the same comment act differently in.vueand.tsfiles, and the template form was a convention of this project only.<script setup>bindings typed as components: a type with a construct signature, or an object withsetup,renderortemplate. Plain functions (functional components declared as setup bindings) are no longer offered.__VLS_scopeobject, so TypeScript only completes real template scope members. The Vue language server supplements unused<script setup>bindings and template locals (v-for/ slot props) as plain completion items. Globals are limited to the ones@vue/shared'sisGloballyAllowedaccepts.<loading>refers to an importedLoadingbefore aloadingvariable, a file refers to itself by itsdefineOptionsname, and a narrowed binding (<Child>underv-if="Child") has its props.$propsof its construct signature, or the first parameter of its call signature), not the contextual type of the generated props object. A generic component's type parameters stay unresolved, and an overloaded component offers the props of its first construct signature. Components the old lookup missed (abstract construct signatures, a call signature intersected withnew () => any) now get props."languageFeatures": falsethe span map has no navigation segments, so rich hover, component definition and props completion have no answer in that project.Editor and client integrators (Neovim, Zed, Sublime, etc.)
vue/typescriptApiConnectionrequest by forwardingcustom/initializeAPISessionto the TS 7.1 language server (tsc --lsp --stdio, started withinitializationOptions: { runExternalCode: true }), like v3'stsserver/requestforwarding (see "Client Requirements" in the language server README). There is no fallback.@vue/typescript-pluginis removed. Its_vue:tsserver requests are answered by the Vue language server through the TypeScript API, so drop the plugin from the client's tsserver configuration.--tsdkparameter, its TypeScript 5/6 check and thetypescriptpeer dependency are removed, andstartServer/createVueLanguageServicePluginstake notsargument.contentMappersentry that the client syncs as Vue files, so the client selects them by language id (e.g.vue). Files outside any tsconfig get their entries frominitializationOptions.contentMappers.vue-component-metausers (Storybook, nuxt-component-meta, etc.)vue-component-metamoves to the TypeScript 7.1 API and is async.typescript >=7.1.0-betais a peer dependency.createChecker(tsconfig)returns an async-disposable checker whosegetComponentMeta/getComponentMetas/getExportNamesread files from disk with a fresh snapshot per query.createCheckerByJson,updateFile,deleteFile,reload,clearCacheandgetProgramare removed, and virtual files are not supported. The core is exported as pure functions that take a TypeScriptProject.vue-component-metaresults are plain data. Each member'stypeis aTypeIdinto a sharedComponentMeta.typestable ofTypeNodes (textplus structure); objects and functions declared outside the project are not expanded. Theschema/printeroptions (MetaCheckerOptions,PropertyMetaSchema),getTypeObject,getDeclarations,rawType, the eventsignatureandComponentMeta.type(TypeMeta) are removed,PropertyMetais renamedPropMeta, and declarations are mapped ranges ({ file, start, end }).Events have no
descriptionortagsyet. They come from the JSDoc of the event's call signature, which the TS 7.1 API does not expose for signatures (expected-fail test). Not a regression: 3.3.13 on TypeScript 5.9.3 also gives an empty description and no tags for a documented type-based or runtimedefineEmits.Props of a generic component have no
defaultyet. Script setup defaults (withDefaults, a props destructure,defineModel) are read through the checker from the component's declaration, and Vue's types do not give a generic component its defaults (see Vue core; expected-fail tests). A regression: v3 read them from the source.vue-component-metano longer depends on@vue/language-core.Vue language plugin authors
VueLanguagePluginis replaced by plugin modules that export one key per mode. This is a clean break with no adapter for v3 plugins. A module exportsir(formats,templateCompilers,resolveTemplateCompilerOptions) and/orcodegen; a function, an array or an object withversionfails to load with a message naming the migration.version,name,order,ctx.modules,parseSFC/updateSFC,compileSFCScript,compileSFCStyle,compileSFCTemplateandupdateSFCTemplateare removed. A plugin takes its options from itspluginsentry (ctx.config). See Plugins and the CHANGELOG.getEmbeddedCodes,resolveEmbeddedCode). The documents, including the one of apugtemplate, are built in; custom blocks get the language of their ownlangonly. A format or template language belongs to the one plugin that provides its key, and providing a built-in key or another plugin's key is a load error. A template language returns its HTML and the mappings back to its source; language-core compiles the HTML and maps every position back once, so a plugin no longer receives a compiler or walks the AST.@vue/language-plugin-pugexportsir.templateCompilers.pugand depends on@vue/language-corefor types only.codegenexport, read only by@vue/content-mapper(the language server and vue-component-meta never load it):codegen = ctx => ({ contribute(file) { … } })returns script edits of the user's code (insertBefore/insertAfter/replace), template context types, props, emits and exposed types of script setup components, native element types, module declarations, named exports and the component's doc comment. Script edits never conflict with each other or with Vue's own transforms, and inserts move with the code that Vue moves. The CHANGELOG maps known v3 plugins (vue-router typed routes, vue-macros, ts-macro, weapp-vite, …) to their contribution. See Codegen plugins.@vue/language-coreinto@vue/content-mapper. The script, template and style codegen and the generated names live in the mapper; nothing generates the service script through embedded codes anymore, so thevue-tsxplugin is removed. language-core contains no TypeScript codegen.createVueLanguagePluginandVueVirtualCodemoved to@vue/language-service, andcreateVuePluginsis replaced bycreateIRPipeline.VueVirtualCode.scriptAnalysisexposes script ranges, setup bindings, local components and directives, and the template scope (collectTemplateScope: the identifiers each template expression references, the block scopes with their declared names and members, the narrowed setup bindings, inlay hints). The codegen reads it instead of walking the scopes itself, and throws when it has no entry for an expression it generates.createVirtualCodereturns an independent virtual code. The module-level registry that shared virtual codes between plugins of equal options is removed; sharing transforms across projects is left to the TypeScript host, which caches them byconfigIdentity.VueCodeInformation,codeFeaturesandallCodeFeaturesare replaced byVueCodeMarkerandSpanMapFeaturebit groups (allFeatures,scriptFeatures,completionFeatures, ...). Volar.js v3 has no verification feature: diagnostics are suppressed through ignore directives over generated code.formatdirectly (refactor(language-core): select the SFC parser by format instead of a fake languageId #6295):isValidFile/parseSFC2,ctx.compilerOptions,requiredCompilerOptionsand thecompilerOptionsparameter ofcreateVueLanguagePluginare gone; formats of plugins are selected by name through theformatoption.vueCompilerOptions.format, not by the file's extension.getFormat,isContentMapperFile,withExtensionFormatsandresolveContentMappersare removed from language-core,getRootLanguageIdtakes no file name, andBindingFlag.Component/getImportedComponentsare removed fromparseBindings.CSS with a CSS Content Mapper
Vue only types what it owns: inline
<style module>classes and scoped classes still come from Vue's own class extraction. Everything about CSS files themselves (resolving@import/@use, aliases andpaths, and the types of a CSS module's exports) belongs to a separate CSS Content Mapper package, such as a Content Mapper version of css-modules-kit. The two sit side by side incontentMappers:{ "contentMappers": [ { "package": "@vue/content-mapper", "extensions": [".vue"], "options": { "target": 3.5 } }, // a CSS Content Mapper package (illustrative; not published yet) { "package": "<css-content-mapper>", "extensions": [".module.css"] } ] }<style module src="./foo.module.css">becomes an ordinary defaultimportof./foo.module.cssin the virtual code, so$stylegets whatever types the CSS mapper gives that module, the same as importing it from a.tsfile. Without a CSS mapper or adeclare module '*.module.css'declaration, the import reports TS2307 instead of silently typing$styleasany.Until a CSS Content Mapper exists,
@import/@usein<style>only get the CSS service's own relative and root path resolution. Go-to-definition through an alias@importalso needs TypeScript's cross-file definition fallback (see Remaining work), the same gap asimport B from '@/Comp.vue'.Remaining work
language-tools
volar.jspins a branch three commits ahead of itsv3branch, andservicesa branch five commits ahead of itsmaster. Their packages are versioned 2.4.30 and 0.0.71, which npm already has without these changes, so the release workflow's "on npm" check passes against the old packages.isCustomElement,v-presubtrees, pug / markdown / petite-vue templates, closing tags split across lines.CSS (separate packages)
indexresolution: needs a TypeScript module resolution hook, or the CSS mapper resolving them itself.TypeScript
.vuescript block or template expression. The Vue language server keeps the wiring for it (SyntacticApi); until then those features are unavailable (see Breaking changes).{ foo },:foo,:foo-bar).pathswhen it leads to a file of a Content Mapper (import B from '@/Comp.vue'; expected-fail test).Signaturedocumentation comment and JSDoc tags), for thedescriptionandtagsof component meta events (expected-fail test).typescript/ast, or the host's parse in the Content Mapper transform request, and parse diagnostics from the API. The Content Mapper parses script blocks through atypescript/syncAPI process it starts, and approximates the parse diagnostics it needs by the erroneous nodes at the end of the code; both are labeled at their code location.@eventdefinition)..foo-bar) is declared twice in the virtual code, once as an atom for definition and references and once verbatim for rename. Exit: when TypeScript maps either shape, the class is declared once.directivesoption registers resolves its type but links to nothing, and theon${Capitalize<K>}listener props of type-based emits link nothing once Vue core keeps the event declarations (expected-fail tests).parsedCommandLine.raw.contentMappers; for an inferred projectrawis undefined,optionscarry no mapper options, and only the identity inSourceFile.contentMapper(contributorId[n] (name@version)) is visible. Until then the client also passes them ininitializationOptions.contentMappers.typescript.contentMapper.outputExtensions{ ".vue": ".ts" }emitsComp.d.ts, but requiresrewriteRelativeImportExtensions(TS18120) in every project that uses the mapper, and then rewrites./Comp.vuein the emitted JS and declarations to./Comp.ts/./Comp.js, which are not emitted. Until then declarations stayComp.d.vue.ts(dts snapshot tests).Vue core
Defaults; the function form ofdefineComponent, the one that takes type parameters, fixes them to{}, and the defaults of a generic component stay inside its setup function. vue-component-meta reads all script setup defaults through the checker, so until then it reports no defaults for the props of a generic component (expected-fail tests; a regression from v3, in the CHANGELOG).TypeEmitsToOptionsshould keep the declarations of the events. It maps overkeyof T & string, which is not homomorphic, so the emits of a type-baseddefineEmitsreachDefineComponentonly as new symbols, and a parent's@foo-barlistener links to nothing in the child (expected-fail test). v3 did not link it either (checked on master with TypeScript 5.9), so this is not a regression.Also in this PR
Full list in the CHANGELOG. These are the changes a reviewer or user would notice outside the breaking changes above.
@vue-ignore/@vue-expect-errorin<template>become TS 7.1 diagnostic directives; an unused expect is reported at the original comment in every locale. Diagnostics of the codegen's own code are suppressed by ignore directives the codegen emits over it, so nothing filters diagnostics by code.@ts-ignores are on purpose: the construct call that infers generic and overloaded component props (element.ts, reason in test(language-core): cover the construct call of components and document its @ts-ignores #6301) and the guards for a possibly missing globalJSX(localTypes.ts).$eventparameter of inline handlers explicitly #6300.SpanMapKind.Aliaswas evaluated and not adopted: it only changes names in diagnostic messages, and Vue's respellings are real names users act on.registerLspMiddlewarewas evaluated and not adopted: it only rewrites results inside the VS Code extension, so other editors would behave differently, and the gaps it could patch are fixed in TypeScript (listed under Remaining work).<script setup>component declare what itslang="ts"twin declares; they no longer export the codegen's type aliases.useTemplateReflinks and scoped-class links come from the template itself, so they also cover elements under@vue-skipand component refs with no typed template ref.@vue/content-mapperreports plugins that fail to load, and aformatthat nothing provides, as option diagnostics; the language server recreates a project's Vue language plugin when one of its plugin files changes.resolveVueCompilerOptionslives in language-core and is the one reader of an entry's options for@vue/content-mapperand the language server, so the editor andtscgenerate the same virtual code.configIdentityhashes the effective configuration instead of the files read while resolving it, so projects that reach the same Vue package through their ownnode_modulesshare transforms..vue.mdas VitePress by default (feat(vscode): default to recognizing.vue.mdas VitePress files #5884) and registers.vue/.vue.mdentries for inferred projects with TypeScript (Native Preview)'sregisterContentMappers.@vue/content-mapper(a dev dependency for tests).VUE_CONTENT_MAPPER_WORKERSis gone): every worker initialized the mapper again and started its own TypeScript API process. On 200.vuefiles, 8 cores, medians of 10 interleaved runs oftsc --runExternalCode, user+sys / wall / largest RSS: pool with the default worker count 3.99s / 1.32s / 272MB, pool with one worker 2.50s / 1.23s / 228MB, no pool 2.33s / 1.06s / 221MB.v-slotparameter reads the template's bindings as the rest of the template does (typeof fooof a ref is the unwrapped value).defineModeldefaultfunction can have the name of the runtimedefinePropsbinding (was TS2502), and is typed through JSDoc in JavaScript (was TS8010).:classrenames it in the template and the style block.returnblock body.undefined: awithDefaultsdefault at target 3.6, a props destructure default from target 3.5, and adefineModeldefault. All three go through the runtimepropsoption that released Vue reads (__VLS_WithDefaults, which keeps each default's declaration). Target 3.6 used the__defaultsoption, which only the unmergedvuejs/core#12935reads; no released Vue does (checked 3.5.44, 3.6.0-rc.6, 3.6.0-rc.13). v3 (3.3.13, TypeScript 5.9.3) also gave these props withundefined, exceptwithDefaultsbelow target 3.6.definePropsargument includes itsdefineModelprops; they were missing, in v3 too.withDefaultsdefaults ('foo-bar'); it gave none.Notes
typescript@7.1.0-betafrom npm; no classic TypeScript is installed.v-slotparameter types and the copies of the user's script asserttscdiagnostics, declaration emit and language server results of fixture projects, not the generated__VLS_*code. Each was checked by breaking the behavior in the code. What stays on generated code: where plugin edits land in the user's code and their mappings, the template scope that the codegen reads from the analysis, and no empty copy at the end of a block that ends with its default export, which no tried language server request or diagnostic tells apart.3.6.0-rc.6intest-workspace(chore(deps): upgrade Vue to 3.6.0-rc.6 #6189).pnpm test content-mapperReferences
microsoft/typescript-go#4712(merged), round 2:microsoft/TypeScript#63936(merged)