Skip to content

breaking: use modern-ast#512

Merged
dummdidumm merged 13 commits into
masterfrom
modern-ast
May 11, 2026
Merged

breaking: use modern-ast#512
dummdidumm merged 13 commits into
masterfrom
modern-ast

Conversation

@dummdidumm
Copy link
Copy Markdown
Member

Transform the code base to use the modern Svelte AST. Requires Svelte 5.

@mustafa0x
Copy link
Copy Markdown

getVisitorKeys: leaveAlone still includes 'Style', but modern AST uses 'StyleSheet'

In src/embed.ts the traversal stoplist contains 'Style' but not 'StyleSheet'.

  • In modern AST the code now handles case 'StyleSheet': return embedStyle(true);
  • But because 'StyleSheet' isn’t in leaveAlone, Prettier will traverse deep into the CSS AST unnecessarily.

This is probably not correctness-breaking (the embed switch returns null for CSS nodes), but it’s:

  • wasted work on big stylesheets, and
  • a potential recursion/perf footgun.

Suggested change: add 'StyleSheet' and remove 'Style' (unless deliberately keeping a hybrid path, which this PR otherwise removes).

@l0uisgrange
Copy link
Copy Markdown

Is this really blocking oxc-project/oxc#19807?

@dummdidumm dummdidumm merged commit 84e6bf4 into master May 11, 2026
5 checks passed
@dummdidumm dummdidumm deleted the modern-ast branch May 11, 2026 20:38
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.

3 participants