Skip to content

Conversation

@thecrypticace
Copy link
Contributor

@thecrypticace thecrypticace commented Dec 2, 2025

There are two large-ish issues with the current implementation of this plugin:

  1. Builtin and compatible third-party plugins are all loaded up front — requiring us to use top-level await — this also slows things down unnecessarily. We should be lazy loading plugins instead.
  2. All the transforms happen at the "parser" stage by replacing the parse method of builtin plugins and third party plugins to call the original and walk + mutate the AST. We should instead override the printer and perform the sorting then.

This PR addresses the first one and prepares for the 2nd one with a pretty extensive internal refactor.

It's likely that this PR, once done, can be released in the v0.7.x series. While no breaking changes are intended (or anticipated) moving sorting logic to the print stage that should probably be a v0.8.x since things will be quite different architecturally.

@thecrypticace thecrypticace changed the title Remove top-level await from plugin loading Remove top-level await from plugin Dec 2, 2025
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.

2 participants