Skip to content

refactor: more modular.#9

Merged
knightedcodemonkey merged 3 commits intomainfrom
bananas
Mar 17, 2026
Merged

refactor: more modular.#9
knightedcodemonkey merged 3 commits intomainfrom
bananas

Conversation

@knightedcodemonkey
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 17, 2026 01:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.js into new controllers (render-runtime, type-diagnostics, diagnostics-ui, layout-theme, preview-background).
  • Split src/styles.css into multiple CSS files under src/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.

@knightedcodemonkey knightedcodemonkey merged commit 5f831b6 into main Mar 17, 2026
1 check passed
@knightedcodemonkey knightedcodemonkey deleted the bananas branch March 17, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants