Skip to content

fix: apply addon preparsers on initial load#2664

Merged
antfu merged 1 commit into
slidevjs:mainfrom
NgoQuocViet2001:fix/2646-addon-preparser-initial-load
Jul 13, 2026
Merged

fix: apply addon preparsers on initial load#2664
antfu merged 1 commit into
slidevjs:mainfrom
NgoQuocViet2001:fix/2646-addon-preparser-initial-load

Conversation

@NgoQuocViet2001

@NgoQuocViet2001 NgoQuocViet2001 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Addon setup/preparser.ts hooks were unavailable during Slidev's cold-start/static-build parse because resolveOptions() returned data loaded with only the project root.

This change:

  • keeps the first parse as a bootstrap step for discovering the selected theme and addons
  • reloads the deck with the complete theme/addon/project root set
  • resolves the returned config from the final preparsed headmatter
  • pins theme and addons to the graph that was actually loaded, while preserving final non-discovery fields and applying CLI overrides last

The regression makes bootstrap and final headmatter intentionally diverge, verifies the full-root second load, and catches stale-config or unloaded-root contradictions.

Closes #2646

Validation

  • Focused regression: 1/1 passed
  • Slidev Node tests: 61/61 passed
  • Full test suite: 218/218 passed
  • @slidev/cli build passed
  • ESLint on the two changed files and git diff --check passed
  • Real addon cold-start spot-check passed

GitHub Actions completed with 16 successful and 2 neutral checks. The only failures were typecheck and cypress; the same two jobs also fail on upstream main at base SHA 905b44ba (base run), while the PR's Windows/macOS/Linux tests and all smoke matrices passed.

Locally, pnpm verify likewise reaches unchanged Cypress/VitePress/duplicate dependency type errors and CRLF lint errors in unchanged Markdown files. The production build, complete test suite, and changed-file lint all pass.

AI assistance

Codex (GPT-5, autonomous) analyzed the issue, implemented and iteratively reviewed the change, and ran the validations above on behalf of @NgoQuocViet2001. The operator requested the contribution but did not manually author or line-by-line review the patch.

@netlify

netlify Bot commented Jul 11, 2026

Copy link
Copy Markdown

Deploy Preview for slidev ready!

Name Link
🔨 Latest commit 643c23a
🔍 Latest deploy log https://app.netlify.com/projects/slidev/deploys/6a529499094594000896c8d9
😎 Deploy Preview https://deploy-preview-2664--slidev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented Jul 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

@slidev/client

npm i https://pkg.pr.new/slidevjs/slidev/@slidev/client@2664

create-slidev

npm i https://pkg.pr.new/slidevjs/slidev/create-slidev@2664

create-slidev-theme

npm i https://pkg.pr.new/slidevjs/slidev/create-slidev-theme@2664

@slidev/parser

npm i https://pkg.pr.new/slidevjs/slidev/@slidev/parser@2664

@slidev/cli

npm i https://pkg.pr.new/slidevjs/slidev/@slidev/cli@2664

@slidev/types

npm i https://pkg.pr.new/slidevjs/slidev/@slidev/types@2664

commit: 643c23a

@antfu
antfu merged commit b9fcd51 into slidevjs:main Jul 13, 2026
19 of 21 checks passed
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.

[Bug] Addon preparsers are not applied to the initial render (regression of #926)

2 participants