Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: explore parsers and printers #380

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

manuel3108
Copy link
Member

@manuel3108 manuel3108 commented Dec 29, 2024

Closes #44
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

Benefits

  • closer to other tools in the svelte ecosystem
  • Faster bundling (~33% speed improvement locally from 4s to 3s, probably more with chore: use rolldown #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

  • More tooling that we need to control (code to maintain)
  • 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.

Copy link

changeset-bot bot commented Dec 29, 2024

⚠️ No Changeset found

Latest commit: 3e2ee46

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

pkg-pr-new bot commented Dec 29, 2024

Open in Stackblitz

npm i https://pkg.pr.new/sveltejs/cli/sv@380
npm i https://pkg.pr.new/sveltejs/cli/svelte-migrate@380

commit: 3e2ee46

@manuel3108
Copy link
Member Author

updated PR description to be more accurate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File created with mix of single and double quotes
1 participant