Skip to content

Provide TypeScript 7.1 content mapper #533

Description

@remcohaszing

TypeScript introduced the new content mapper API in microsoft/typescript-go#4712. This will be released in TypeScript 7.1. I built mdx-content-mapper as a proof of concept and to provide feedback to the TypeScript team. I took the Volar based MDX virtual content from this repo, and iterated on top of that. I would say it’s already more stable and more feature complete than we ever had in mdx-analyzer.

We can actually use content mappers with tsc, which is a much requested feature and also really convenient for testing. 😄

I intend to incorporate the content mapper inside the mdx-analyzer repo as the @mdx-js/content-mapper package. I intend to do this following a couple of steps, where the first ones involve the removal of TypeScript support based on Volar. I do want to keep Volar and the language server to support editor features provided by vscode-markdown-languageservice.

  • Remove @mdx-js/typescript-plugin from the project. It will no longer be supported. I do not feel the need to deprecate this yet. People may still want to use this in web projects with TypeScript 6 until TypeScript 7 can be used in the browser with a content mapper.
  • Remove the full TypeScript language service support from @mdx-js/language-server.
  • Remove the TypeScript parts from @mdx-js/language-service. Most logic in this project currently involves TypeScript support.
  • Remove the dependency of @mdx-js/language-server on tsconfig.json. It currently reads remark plugins from this file. We can hardcode sane defaults, or make it configurable using settings if this turns out necessary. This only affects what we pass to vscode-markdown-languageservice.
  • Incorporate @mdx-js/content-mapper into the mdx-analyzer repository.
  • Add @mdx-js/content-mapper support to the VSCode extension.

Considering microsoft/TypeScript#63703, I believe it will be nice if @mdx-js/content-mapper and our VSCode extension are released alongside TypeScript 7.1 RC. During the 7.1 Beta period, users can try mdx-content-mapper instead.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions