feat(docs): interactive script-loading demo on Script-Loading - #91
Merged
Conversation
…active demo Add an interactive script-loading-timeline demo (a self-contained page under public/demos/ following the documented embed contract) that lets the reader step through how a normal, async, and defer script each affect HTML parsing, download, and execution. Embed it in Loading/Script-Loading in place of the mermaid sequenceDiagram, which rendered too wide to fit the viewport and could not convey the temporal behaviour it described. The strategy comparison table and the decision-tree flowchart stay as-is.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
What
Replaces the mermaid
sequenceDiagramonLoading/Script-Loadingwith an interactivescript-loading-timelinedemo. The reader switches between<script>,<script async>, and<script defer>and steps through how each affects HTML parsing, download, and execution.public/demos/script-loading-timeline.html, following the embed contract documented inpublic/demos/README.md(postsdemoHeight, syncs theme, no external dependencies).flowcharton the page are kept as-is.Why
The
sequenceDiagramrendered too wide to fit the viewport and, being static, could not convey the temporal behaviour it described (parser pausing, parallel download, execution timing). This is the pilot for the "convert temporal mermaid diagrams to interactive demos" initiative.Before: the static mermaid it replaces
sequenceDiagram participant Browser participant Parser as HTML Parser participant Script as Script Note over Browser,Script: Normal script - Blocks Everything Parser->>Script: Encounter script Note over Parser: PAUSE parsing Script->>Script: Download Script->>Script: Execute Note over Parser: Still waiting... Script-->>Parser: Done Note over Parser: RESUME parsing Note over Browser,Script: script async - Execute When Ready Parser->>Script: Encounter script async Note over Parser: Continue parsing par Parallel Operations Parser->>Parser: Keep parsing HTML and Script->>Script: Download in background end Script->>Parser: Ready to execute Note over Parser: Brief pause Script->>Script: Execute Note over Parser: Resume parsing Note over Browser,Script: script defer - Execute After Parsing Parser->>Script: Encounter script defer Note over Parser: Continue parsing par Parallel Operations Parser->>Parser: Keep parsing HTML and Script->>Script: Download in background end Parser->>Parser: Finish parsing Script->>Script: Execute (in order) Note over Script: All defer scripts run before DOMContentLoadedAfter: the interactive demo
Verification (runtime,
next dev+ productionnext build)demoHeightcontract: iframe sized 679 to 703px as steps reveal, well above the 400px minimum.next buildpasses; the MDX compiles and theDemoimport resolves.Not included
llms.txt/llms-full.txtare not regenerated here (deferred to the counts/artifacts phase), so they still describe the old diagram until then.