Skip to content

feat(client): expose preloadProgress / preloadComplete from the image preloader#2650

Merged
antfu merged 1 commit into
slidevjs:mainfrom
quinnypig:feat/preload-progress
Jul 3, 2026
Merged

feat(client): expose preloadProgress / preloadComplete from the image preloader#2650
antfu merged 1 commit into
slidevjs:mainfrom
quinnypig:feat/preload-progress

Conversation

@quinnypig

Copy link
Copy Markdown
Contributor

Summary

Expose reactive preloadProgress (0–1) and preloadComplete from usePreloadImages, so a deck or theme can show a "preloading…" indicator — or gate something on full preload, which is handy before presenting on a flaky/absent connection.

  • preloadProgress = unique slide images loaded / total unique slide images in the deck (1 when the deck has no images).
  • preloadComplete = preloadProgress >= 1.

Consumable via import { preloadProgress, preloadComplete } from '@slidev/client/composables/usePreloadImages'. No change to the package's public index, so no API-surface churn.

Verification

pnpm build + pnpm test + pnpm typecheck + pnpm lint all pass.

@netlify

netlify Bot commented Jun 25, 2026

Copy link
Copy Markdown

Deploy Preview for slidev ready!

Name Link
🔨 Latest commit 41bb386
🔍 Latest deploy log https://app.netlify.com/projects/slidev/deploys/6a3cca55c0b6c8000879f7ee
😎 Deploy Preview https://deploy-preview-2650--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 Jun 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@slidev/client

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

create-slidev

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

create-slidev-theme

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

@slidev/parser

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

@slidev/cli

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

@slidev/types

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

commit: 41bb386

@quinnypig
quinnypig marked this pull request as ready for review June 25, 2026 03:12
…ge preloader

Expose reactive preloadProgress (0..1) and preloadComplete from usePreloadImages so a deck or theme can show a 'preloading...' indicator or gate on full preload. Total counts the unique slide images across the deck; progress tracks how many have loaded.
@quinnypig
quinnypig force-pushed the feat/preload-progress branch from 000be90 to 41bb386 Compare June 25, 2026 06:27
@antfu
antfu merged commit d437df4 into slidevjs:main Jul 3, 2026
20 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.

2 participants