Skip to content

Consider switching to a more mature parser #13439

Open
@ottomated

Description

@ottomated

Describe the problem

There are many issues that have acorn-typescript as the upstream cause (#13179, #13125, #13409, #13188, more), but acorn-typescript is abandoned. It also has several open issues that would need to be addressed once forked or collaboration access is granted.

Describe the proposed solution

One of the following:

  • Fork acorn-typescript. The svelte team would become the primary maintainers but it wouldn't require any changes to the svelte source code.
  • Use an alternate parser, such as swc or oxc. SWC seems to use the same AST types as acorn, but oxc advertises faster speeds. These parsers are much more mature than acorn-typescript and are obviously actively maintained. (note: oxc would require changes to both esrap and the svelte source)

My vote would be for the latter. The downsides (bigger dependencies and changes to svelte's source) are outweighed by the long-term advantage of using a more reliable library.

Importance

nice to have

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions