Improving Typescript code parsing in Astro components #819
MoustaphaDev
started this conversation in
Proposal
Replies: 1 comment 2 replies
-
That sounds great to me! Not sure if there's many TypeScript parsers in Go, maybe ESBuild's can be used, somehow? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Body
Summary
Explore a more effective approach to parsing frontmatter code in Astro components, particularly when dealing with TypeScript.
Background & Motivation
Currently, the Astro compiler handles TypeScript code (for export/import hoisting and
Props
type detection purposes, etc) using a JavaScript parser that it extends to support TypeScript. While functional in most cases, it may fall short when dealing with certain TypeScript code, as it's not a fully-fledged TypeScript parser. This limitation is evident in several open issues: withastro/compiler#927, withastro/compiler#554, withastro/compiler#863, withastro/compiler#763, withastro/compiler#878, withastro/compiler#749, withastro/compiler#1056While patching individual issues is possible, it's unsustainable in the long term, requiring constant maintenance and potentially introducing further incompatibilities.
Goals
Unresolved question
Beta Was this translation helpful? Give feedback.
All reactions