Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Before Volar, the ESM, JSX, and markdown parts of virtual files had to map character by character, with parts shadowed by whitespace characters. This was still how virtual files were built. However, because of how Volar mappings work, this is unnecessary. This change overhauls how virtual files are generated. This leads to more flexibility of virtual files, meaning we can omit or inject content. This is already leveraged in several ways: - Markdown nodes in MDX are represented by TypeScript fragments. This provides compatibility with JSX elements that require children on a type level. - Markdown text nodes in MDX are represented by TypeScript JSX expressions containing an empty string. - JavaScript chunks are represented in the virtual markdown files as HTML comments.
- Loading branch information