refactor: modules and defaults.#11
Merged
knightedcodemonkey merged 3 commits intomainfrom Mar 17, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reorganizes the client-side playground code into a src/modules/ structure and expands runtime capabilities (CDN loading, rendering, editor, diagnostics, theme/layout, preview background), with accompanying UI and e2e test updates.
Changes:
- Moved core runtime logic into new controllers under
src/modules/(CDN resolution, render runtime, CodeMirror editor, type diagnostics, UI controllers). - Updated UI styling/behavior to support an “ok” diagnostics state (checkmark indicators) and refined default samples (incl. a React-mode default).
- Updated bootstrap/build wiring and Playwright tests to align with the new module structure and new defaults.
Reviewed changes
Copilot reviewed 8 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/styles/diagnostics.css | Adds “ok” visual styling for diagnostics heading/toggle. |
| src/modules/type-diagnostics.js | New controller to load TS from CDN and run in-browser type diagnostics. |
| src/modules/render-runtime.js | New rendering/controller runtime (DOM/React modes, CSS compilation, module class remap). |
| src/modules/preview-background.js | New controller to manage preview background color + color normalization. |
| src/modules/layout-theme.js | New controller for layout + theme persistence and UI state. |
| src/modules/editor-codemirror.js | New CodeMirror runtime loader + editor factory via CDN. |
| src/modules/diagnostics-ui.js | Adds “ok” state handling for diagnostics toggle + heading styling. |
| src/modules/defaults.js | New default samples (JSX/CSS + React JSX sample). |
| src/modules/cdn.js | Consolidates CDN provider logic + adds TS lib URL generation helpers. |
| src/defaults.js | Removes old defaults file (moved into src/modules/defaults.js). |
| src/bootstrap.js | Updates preload wiring to import CDN helpers from src/modules/cdn.js. |
| src/app.js | Rewires imports to modules, adds React default application on first switch, connects new controllers. |
| scripts/build-prepare.js | Updates build-prepare wiring/messages to reference src/modules/cdn.js. |
| playwright/app.spec.ts | Makes rendering assertions less dependent on specific sample DOM structure. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.