Repository navigation
perf(vite): add static hook filters for Slidev modules - #2803
Open
OKAN-SOFTWARE wants to merge 2 commits into
Open
OKAN-SOFTWARE wants to merge 2 commits into
OKAN-SOFTWARE wants to merge 2 commits into
Conversation
✅ Deploy Preview for slidev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
OKAN-SOFTWARE
marked this pull request as ready for review
October 27, 2026 12:11
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.
Summary
Add static Vite/Rolldown hook filters for four Slidev hooks with stable, well-defined module-ID predicates, reducing unnecessary JavaScript hook invocations while preserving fallback checks.
Partially addresses #2284 (does not close the issue).
Changes
contextInjection.ts: addtransformID filter for user.vuefiles, excluding Slidev client components.monacoTypes.ts: add a shared prefix filter to theresolveIdandloadhooks.loaders.ts: filterresolveIdto/@slidev/virtual modules and__slidev_IDs.test/plugin-hook-filters.test.ts: add filter-selection regression cases and fallback handler assertions.The existing in-handler guards remain for compatibility with older Vite/Rollup versions.
Scope and overlapping work
hmrPatch.tsandlayoutWrapper.tsalready have filters on currentmain.compilerFlagsVue.tsis intentionally excluded because open PR fix: apply dev define flags to JS/TS client modules #2714 already adds a filter while fixing a separate client JS/TS issue.loaders.ts's dynamicloadhook is unchanged. It handles generated templates and data-dependent Markdown files; a restrictive static filter requires careful consideration of dynamically added modules and HMR, and a catch-all filter provides no invocation savings.Validation
mainata42aff28dd75f26eb5abbf3d616ea022c3d08924; four intended files, two focused commits.pnpm buildcompleted successfully.vue-tsc --noEmitpassed.pnpm exec vitest run test/plugin-hook-filters.test.ts— 3 tests passed.pnpm test— 35 test files / 382 tests passed (local run, 2026-10-27).pnpm verify— not fully green: build and typechecking passed, then the earlier repository-wide ESLint run stopped on 138 errors; the 3 issues in the added test have since been fixed and focused lint passed. The remaining reported errors concern unrelated repository files (mostly Windows CRLF expectations and YAML formatting). Repository-wide lint has not been re-run after that fix.action_requiredfor this fork PR; CI success is not yet established.The local unit-test suite is green. Browser-level Vite/Rolldown integration and maintainer CI remain unverified.
Additional notes
This is deliberately a focused partial contribution to #2284; it does not mark the issue resolved or change runtime behavior for dynamic
loadIDs.