8000 perf: add sql hook filters by TheAlexLichter · Pull Request #137 · colinhacks/reylo · GitHub
[go: up one dir, main page]

Skip to content

perf: add sql hook filters - #137

Open
TheAlexLichter wants to merge 1 commit into
colinhacks:mainfrom
TheAlexLichter:perf/sql-hook-filters
Open

TheAlexLichter wants to merge 1 commit into
colinhacks:mainfrom
TheAlexLichter:perf/sql-hook-filters

Conversation

@TheAlexLichter
@TheAlexLichter TheAlexLichter commented Oct 27, 2026 •
Copy link
Copy Markdown

This PR adds the .sql hook filters to resolveId and load so 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.

@vercel
vercel Bot commented Oct 27, 2026
Copy link
Copy Markdown

@TheAlexLichter is attempting to deploy a commit to the pullfrog Team on Vercel.

A member of the Team first needs to authorize it.

@pullfrog pullfrog Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

  • resolveId filter: adds filter: { id: /\.sql$/ } to the existing object hook. For resolveId, hosts match this filter against the raw import specifier, so it checks the same thing as the handler's source.endsWith(".sql") guard.
  • load as an object hook: load becomes { filter, handler } with the same /\.sql$/ filter, and the handler body is unchanged. The id.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 by resolveId, 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.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

This branch has not been deployed

No deployments
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.

[Bundler Plugins] Add hook filters

1 participant

0