chore: switch to estree compatible ast tooling

#380

Closing issues

Pull request

Merged
M
manuel3108
Dec 29, 2024, 9:12 AM

Closes #44 Closes #118 Relates #100

This basically duplicates #100 at this point. See #100 for up and downsides of this approach.

I was initially intending to get rid of a lot more dependencies (like the dependencies for handling html) and use svelte-ast-print instead, but this was opening too many issues at the same time. That's why I opted to "only" switch to acorn and esrap here, the rest can be done later.

Relevant PR's / issues

Benefits

  • closer to other tools in the svelte ecosystem
  • Faster bundling (~33% speed improvement locally from 4s to 3s, probably more with #371)
  • Smaller bundle (locally 2.6MB vs 3.6MB)
  • more consistent formatting than the strange things we sometimes experienced with recast
  • we are in full control of the printing, as we can control esrap

Downsides

  • Our custom typing for TSEstree as no good public alternative exists, that matches acorns output. We do have @typescript-eslint/types but that was just the one with the smallest pain points. Still exploring other options.

Info

Merged at Mar 23, 2025, 8:00 AM
Merged by manuel3108
Assignees None
Reviewers None
Labels enhancement, pkg:add
Milestone None