Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the in-browser playground runtime by extracting major responsibilities (rendering, diagnostics UI, theme/layout, preview background, TypeScript type diagnostics) into dedicated controllers, while also splitting the monolithic stylesheet into imported modules and adding a production CSS bundling/minification step.
Changes:
- Extracted runtime logic from
src/app.jsinto new controllers (render-runtime,type-diagnostics,diagnostics-ui,layout-theme,preview-background). - Split
src/styles.cssinto multiple CSS files undersrc/styles/and switched the entrypoint to ordered@imports. - Added Lightning CSS bundling for
dist/styles.css, updated Playwright config/scripts, and expanded E2E coverage around diagnostics clearing.
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/type-diagnostics.js | New controller to load TS from CDN, hydrate lib d.ts files, and produce diagnostics for the component editor. |
| src/render-runtime.js | New controller for preview rendering, style compilation (CSS/Less/Sass/CSS Modules), and ShadowRoot handling. |
| src/diagnostics-ui.js | New controller for diagnostics drawer state, status/toggle severity indicators, and rendering diagnostics lists. |
| src/layout-theme.js | New controller for persisted layout + theme toggles (localStorage) and UI state sync. |
| src/preview-background.js | New controller for preview background color picker + theme sync behavior. |
| src/app.js | Slimmed to orchestration/wiring of the new controllers and DOM event handlers. |
| src/styles.css | Converted to an import-only entrypoint for modular CSS. |
| src/styles/base.css | New base theme tokens + global base styles. |
| src/styles/layout-shell.css | New app shell/layout styles (header/grid/layout toggles). |
| src/styles/panels-editor.css | New panel/editor UI styles. |
| src/styles/diagnostics.css | New diagnostics drawer and footer styles. |
| src/styles/preview-controls.css | New preview host + control styles (including compiling overlay/spinner). |
| src/styles/dialogs-overlays.css | New dialog + loading overlay + footer styles. |
| scripts/build-css.js | New build step to bundle/minify dist/styles.css via lightningcss. |
| playwright/app.spec.ts | Adjusted navigation and added tests for clearing diagnostics behavior. |
| playwright.config.ts | Added dev vs preview web server mode support (command + ready URL). |
| package.json | Version bump, add lightningcss, add build:css, and adjust e2e scripts to run against preview builds by default. |
| package-lock.json | Lockfile updates for version bump + Lightning CSS dependency. |
| docs/next-steps.md | Updated roadmap to reflect completed modularization and next diagnostics improvements. |
| docs/build-and-deploy.md | Updated build/deploy guidance (preferred deploy mode + e2e runs against preview builds). |
💡 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.