Load compatible plugins on demand and tighten plugin detection#437
Merged
Boshen merged 1 commit intotailwindlabs:mainfrom Feb 4, 2026
Merged
Load compatible plugins on demand and tighten plugin detection#437Boshen merged 1 commit intotailwindlabs:mainfrom
Boshen merged 1 commit intotailwindlabs:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change makes compatible plugins load lazily and conditionally. Instead of preloading all compatible plugins, we now load only those that are enabled for the current Prettier run and merge parser overrides at parse time. Plugin detection was simplified to match by name or resolved absolute path before loading. This reduces unnecessary imports and aligns compatibility checks with the active plugin list.
Benchmark shows 9% faster than before in the headlessui repo
Running benchmark comparing original vs optimized... Benchmark 1: original Time (mean ± σ): 5.913 s ± 0.284 s [User: 9.770 s, System: 0.845 s] Range (min … max): 5.698 s … 6.236 s 3 runs Benchmark 2: optimized Time (mean ± σ): 5.419 s ± 0.188 s [User: 9.068 s, System: 0.651 s] Range (min … max): 5.262 s … 5.627 s 3 runs Summary optimized ran 1.09 ± 0.06 times faster than original