Repository navigation
perf: trim destyler preload and unblock playground first paint - #1
Merged
Merged
Conversation
Scan playground sources for import specifiers and build a trimmed destyler import map instead of fetching every component and shared package. Remaining preloads run with bounded concurrency, and destyler packages added later are lazy-loaded on demand.
Language service no longer blocks editor creation; it starts on idle. Framework workers are dynamically imported so Vue boot does not fetch React/Solid/Svelte workers, and TypeScript is pinned instead of @latest.
Move the preview iframe into the visible panel before assigning srcdoc so appendChild does not reload it. Mark the iframe loaded via onload instead of a 500ms timer, and hide the overlay once the shell/srcdoc is ready without waiting for Monaco.
🧹 PR Preview has been removedThe Zeabur preview service for this PR has been deleted.
|
# Conflicts: # package.json
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
Playground boot was blocked on importing every Destyler package sequentially, then waiting for Monaco + Volar (TypeScript
@latestfrom jsDelivr) before hiding the splash. The preview iframe also lived in adisplay:noneSplitter slot and wasappendChild’d into the visible panel, which reloaded it; a fake 500ms timer then marked it “loaded”.This PR keeps Destyler component APIs, in-browser SFC compile, and framework switching unchanged. The default Vue checkbox + counter demo still only needs
@destyler/checkbox+@destyler/vue.What changed
Trim destyler import map / preload
from '…'/import('…')(and export-from).vue/react/ …).getFile/requirepath needs them (Vue/React/Solid/Svelte).Promise.allpool (concurrency 8). Failures log and do not stall boot.@x.y.z);latestis still unpinned.Unblock first paint
srcdocis assigned.setupLanguageServiceis deferred viarequestIdleCallback(timeout 2s).5.6.2instead oftypescript@latest.Iframe
#editor-panel/#preview-panelbefore assigningsrcdoc, so the iframe is not moved while hidden (avoids reload).iframe.onloadinstead of a 500msisIframeLoadedtimer.Why
Default boot was paying for ~40 unused Destyler packages, serial
await import(), Volar/TS worker init, and an extra iframe navigation. First paint and first preview should only pay for Vue + checkbox + the shell.Test plan
import * as dialog from '@destyler/dialog'inApp.vueand use it — preview hot-updates without a full Destyler catalog preload.latest) and confirm esm.sh URLs include@<version>.Remaining caveats
latestDestyler (and frameworkCORE_IMPORTSon esm.sh) remain unpinned until a version is chosen.srcdoc).5.6.2) is independent of whatevertypescript@latestwould have resolved to on jsDelivr.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.