feat: content mapper (v4 alpha) - #6170
Draft
johnsoncodehk wants to merge 17 commits into
Draft
Conversation
Contributor
|
Just in case, I tested the tsgo + content-mapper in my private project (29367 lines of vue) last weekend before it was merged. andrewbranch@76d07d9 + andrewbranch/typescript-go@d07c1ff I found just two inconsistencies in content-mapper version vs vue-tsc@3.3.9 + typescript@6.0.3:
And that seems a correct error, there is indeed no
<!-- test.vue -->
<style module="foo" critical>
.foo {
}
</style>
<style module="foo" critical>
.foo {
}
</style>test.vue:73:16 - error TS2300: Duplicate identifier 'foo'.
73 <style module="foo" critical>
~Hope that helps |
Contributor
|
Btw typescript@next haven't yet been released after content-mappers merge. Today was skipped, probably due to typescript-go repo migration. |
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
Draft prototype of the TypeScript content mapper integration for Vue, as the foundation for v4. This is an alpha-stage experiment, not ready for merge.
Direction for v4
vue-tscis removed (packages/tsc) — no transition shim, no Vue-specific type-check CLI.tsc --runExternalCode, withcontentMappersdeclared in tsconfig.@vue/typescript-content-mapperpackage.Dependency strategy
typescriptis pinned to<7(full classic API) and overridden totypescript-native-bridge(tnb) — this keepstsc -band tsslint working on TS 6.typescript-7(alias totypescript@7.1.0-dev) is reserved for content-mapper tests.vue-component-meta:typescriptmoved from an optional peer to a direct<7dependency.What's in this branch
packages/content-mapperpackage implementing the JSON-RPC content-mapper protocol (initialize/openProject/transform/closeProject) over@vue/language-core:protocol.ts,server.ts,project.tsspanMappings.ts— Volar mappings →SpanMappingdiagnosticDirectives.ts—@vue-expect-errorsupportworker.ts/workerPool.ts— parallel transforms via worker threadsextensions/vscode/src/extension.ts—registerContentMappersactivationpackages/language-core— codegen changes for diagnostic directives / ignore regionsvue-tscremovedStatus / progress
Legend:
[x]done ·[~]partial ·[ ]todoFoundation
vue-tscremovedinitialize/openProject/transform/closeProject)spanMappings,diagnosticDirectives,project,workerPool,localization)build,dts,fixtures,corpus)Diagnostic model
declared-but-not-usedis auto-suppressed) → eliminated at the codegen source in fix(language-core): eliminate unmapped codegen diagnostics #6179verification.shouldReport→2339/2551/2353/2561/6133): the protocol has no per-code filtering@vue-expect-error/@vue-ignore→diagnosticDirectives(mapper-side partial)Mapping structure
linkedCodeMapremoved in refactor(language-core): remove linkedCodeMap and __VLS_SetupExposed #6175 — content mapper has no virtual↔virtual edge semantic to replaceSpanMapKind.Aliasselection for identifier-name substitutionFeature model
shouldReport/shouldHighlight/shouldRename/resolveRename*) → staticSpanMapFeatureresolveRenameNewName/resolveRenameEditText) +Verbatim-only edits__importCompletion/__propsCompletion/__shorthandExpression)completion.isAdditional/completion.onlyImport)Config & emit
vueCompilerOptions→options/dynamicConfig+configIdentity/watchedFiles(target:auto, plugins)App.d.vue.tsnaming, no JS emit, no declaration mapsTesting
Run content-mapper tests with a locally built tsgo:
TSGO_PATH=/path/to/tsgo pnpm test content-mappertsgois built in CI frommicrosoft/typescript-go.Known blocker
npm
typescript@7.1.0-dev.20260819.1does not yet expose--runExternalCode(TypeScript PR #4712 is approved but not merged/published). CI therefore buildstsgofrom source. Integration tests require atsgobinary with--runExternalCode.References