Skip to content

feat : more js framework support#7

Open
finnyfound wants to merge 5 commits into
mainfrom
feat/more-frameworks
Open

feat : more js framework support#7
finnyfound wants to merge 5 commits into
mainfrom
feat/more-frameworks

Conversation

@finnyfound
Copy link
Copy Markdown
Owner

@finnyfound finnyfound commented May 2, 2026

Description

Brief description of the changes.

Type of Change

  • Bug fix
  • New feature
  • Improvement / refactor
  • Documentation update

How Has This Been Tested?

Local Testing
Describe how you tested these changes.

Checklist

  • My code follows the project's code guidelines
  • I have tested my changes locally
  • I have removed any debug/console statements
  • My changes don't introduce new warnings or errors

- Added console.clear, console.table, console.group, console.groupCollapsed, console.groupEnd, console.time, console.timeEnd, console.timeLog, console.count, console.countReset, console.assert, and console.dir methods to the ConsoleEngine.
- Improved output handling in the addOutput method to support new console features.
- Enhanced rendering of console output in the HTML renderer to accommodate new console methods and groupings.

refactor: Update HTMLRenderer to support pipeline payloads and improve error handling

- Refactored buildCompleteDocument to accept a payload for dynamic content rendering.
- Improved error handling with inline error banners for build errors.
- Updated styles and scripts handling for better performance and readability.

chore: Update main.js to include new modules

- Imported autocomplete and build-pipeline modules in main.js.

fix: Bump state version and refactor state management

- Updated STATE_VERSION to force state migration.
- Refactored state management to support new file structure and improved validation.

feat: Add manifest.json for PWA support

- Created manifest.json to define app metadata and icons for progressive web app capabilities.

security: Enhance security headers in Vercel configuration

- Added Content-Security-Policy, X-Content-Type-Options, X-Frame-Options, Referrer-Policy, and Permissions-Policy headers to improve security posture.
…oop safety

- Configure Monaco's language services for better JSX and ESNext support.
- Register minimal ambient types for popular frameworks (React, Preact, Vue, Lit, Solid, Svelte).
- Implement loop safety checks in the build pipeline to prevent infinite loops during execution.
- Refactor ConsoleEngine to streamline command execution and remove legacy methods.
- Inject helper functions into the iframe for user convenience.
- Update HTMLRenderer to improve console message handling and serialization.
@finnyfound finnyfound self-assigned this May 2, 2026
@finnyfound finnyfound added the enhancement New feature or request label May 2, 2026
@finnyfound finnyfound requested a review from Copilot May 2, 2026 11:10
Copy link
Copy Markdown

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

This PR expands the in-browser “project” model from single-tab JS/HTML/CSS to a multi-file VFS with a build pipeline that can transpile additional JS framework formats (JSX/TS/TSX + framework-specific compilers) and render via a unified sandboxed iframe preview, along with significant UI/theming updates.

Changes:

  • Added a build pipeline with language plugins, transpilation, loop-safety injection, and importmap generation targeting esm.sh.
  • Migrated persisted state to a multi-file schema (files[]) and updated app boot/module wiring to include new pipeline + autocomplete.
  • Updated UI layout, PWA manifest support, and token-driven theming/styles; added security headers (CSP + common hardening headers).

Reviewed changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
vercel.json Adds security-related response headers (CSP + hardening headers).
src/public/manifest.json Introduces PWA manifest metadata and icons.
src/js/state-manager.js Migrates persisted state to files[] schema and improves autosave behavior.
src/js/main.js Wires new modules (autocomplete, build-pipeline) into startup order.
src/js/html-renderer.js Updates iframe document generation, console proxying, importmap injection, and inline build error display.
src/js/console-engine.js Updates console capture and rendering to support richer value display, groups, and tables.
src/js/build-pipeline.js New build/transpile/importmap pipeline enabling more framework/language support.
src/js/autocomplete.js Minor autocomplete logic changes; removes dropdown positioning method.
src/index.html Major UI markup updates (toolbar, modals, file UI, sandbox changes, new CDN deps).
src/css/styles.css Large redesign with token-driven theming, responsive layout, and new component styling.

Comment thread vercel.json
},
{
"key": "Content-Security-Policy",
"value": "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://unpkg.com https://esm.sh; style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: blob:; connect-src 'self' https://esm.sh https://registry.npmjs.org; frame-src 'self' blob:; worker-src 'self' blob:;"
Comment thread src/js/build-pipeline.js
Comment on lines +318 to +321
buildImportMap(codeFiles) {
const bareImportRe =
/(?:^|\n)\s*import\s+(?:[\s\S]*?\s+from\s+)?['"]([^./][^'"]*)['"]/g;
const packages = new Set();
Comment thread src/css/styles.css
Comment on lines +829 to +833
color: var(--error);
}

.context-menu-item--danger:hover {
background-color: color-mix(in srgb, var(--error) 12%, transparent);
Comment thread src/public/manifest.json
Comment on lines +5 to +26
"start_url": "/",
"display": "standalone",
"background_color": "#132440",
"theme_color": "#67e8f9",
"icons": [
{
"src": "/favicon-16x16.png",
"sizes": "16x16",
"type": "image/png"
},
{
"src": "/favicon-32x32.png",
"sizes": "32x32",
"type": "image/png"
},
{
"src": "/apple-touch-icon.png",
"sizes": "180x180",
"type": "image/png"
},
{
"src": "/favicon.png",
Comment thread src/js/autocomplete.js
Comment on lines 516 to 518
this.isVisible = false;
this.selectedIndex = -1;
}
Comment thread src/js/console-engine.js
Comment on lines 271 to +273
const logEntry = document.createElement('div');
logEntry.className = `console-entry console-${item.type}`;
logEntry.className = `console-entry console-${item.type === 'dir' || item.type === 'result' ? 'result' : item.type === 'table' ? 'log' : item.type === 'group-start' ? 'log' : item.type === 'group-collapsed' ? 'log' : item.type}`;

Comment thread src/js/console-engine.js
Comment on lines +404 to +418
createExpandableNode(value, kind) {
const wrapper = document.createElement('span');
wrapper.className = 'console-inspector';

const toggle = document.createElement('span');
toggle.className = 'console-inspector-toggle';
toggle.textContent = '▶';

const preview = document.createElement('span');
preview.className = 'console-inspector-preview';
preview.textContent = this.getPreview(value, kind);

const detail = document.createElement('div');
detail.className = 'console-inspector-detail';
detail.style.display = 'none';
Comment thread src/css/styles.css
display: flex;
gap: 4px;
.sidebar-folder-toggle:hover {
background-color: var(--hover);
Comment thread src/css/styles.css
Comment on lines +771 to +790
/* Rename input */
.rename-input {
width: 100%;
padding: 2px 6px;
border: 1px solid var(--accent);
border-radius: 3px;
background-color: var(--bg-input);
color: var(--text-primary);
font-size: 12px;
font-family: inherit;
outline: none;
-webkit-appearance: none;
appearance: none;
line-height: 1.4;
}

.rename-input::selection {
background: var(--accent);
color: var(--bg-primary);
}
Comment thread src/css/styles.css
Comment on lines +1252 to +1256
/* Console value types */
.console-value-null,
.console-value-undefined {
color: var(--text-tertiary);
font-style: italic;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants