Repository navigation
perf: add sql hook filters - #137
Open
TheAlexLichter wants to merge 1 commit into
Open
TheAlexLichter wants to merge 1 commit into
TheAlexLichter wants to merge 1 commit into
Conversation
|
@TheAlexLichter is attempting to deploy a commit to the pullfrog Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The PR adds hook filters to reylo/vite. Vite, Rollup and Rolldown can now skip modules that aren't .sql without calling into the plugin.
resolveIdfilter: addsfilter: { id: /\.sql$/ }to the existing object hook. ForresolveId, hosts match this filter against the raw import specifier, so it checks the same thing as the handler'ssource.endsWith(".sql")guard.loadas an object hook:loadbecomes{ filter, handler }with the same/\.sql$/filter, and the handler body is unchanged. Theid.endsWith(".sql")guard stays in place for hosts that ignore filters (Rollup before 4.38, Vite before 6.3). Object-form hooks were already required byresolveId, so this sets no new minimum version.
Each filter is the same check as its handler's first guard, so output is unchanged on every host. Nothing in src/, tests/, the labs or the examples calls reylo().load directly. tests/vite.test.ts only calls resolveId.handler and reads resolveId.order, so the change to the hook's shape breaks no caller.
claude-opus-5-5 | 𝕏
This branch has not been deployed
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 PR adds the
.sqlhook filters toresolveIdandloadso Vite, Rollup and Rolldown can skip unrelated modules before calling the handlers.Also this keeps the existing guards for hosts that ignore filters or are too old (bw-compat is given through this)
Closes #136.