Skip to content

Replace CodeSandbox with StackBlitz for live sample editing #246

@dobromirts

Description

@dobromirts

CodeSandbox has multiple open issues that make it unreliable for live sample editing in the docs:

codesandbox-client#8884 — samples fail to load/run
codesandbox-client#8883 — related sandbox boot failure
codesandbox-client#8074 — intermittent sandbox crashes
These issues affect all platforms (Angular, React, Web Components) and have been open without a fix for an extended period, degrading the user experience significantly.

Solution
Switch the primary live editing button to StackBlitz using sdk.openProject() which bundles files directly from the sample JSON — no GitHub repo cloning involved. This avoids the separate freeze bug in StackBlitz's GitHub URL approach (webcontainer-core#2075).

Changes
CodeSandbox button is hidden but not removed - it can be re-enabled by uncommenting ~9 lines in addFooter() once the upstream issues are fixed
All CodeSandbox handler logic remains intact
Sample JSON generators updated to include boilerplate files (package.json, tsconfig.json, build config, index.html) needed for StackBlitz to boot a complete project

Image

Different issue for WC samples in prod:

Image

Metadata

Metadata

Assignees

Labels

✅ status: resolvedApplies to issues that have pending PRs resolving them, or PRs that have already merged.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions