How kanish2002/js-frameworks works
FrameLab is a client-side playground for experimenting with vanilla web code, React, and Angular. Users choose a runtime and starter, edit files, run them in an isolated preview, and inspect the result and console. The app also supports responsive previews, autosave, share links, theme switching, and ZIP export. The graph separates the application shell, workspace/runtime, starter resources, and persistence/export concerns. Workspace internals are only partially excerpted, so unsampled implementation details are represented conservatively using README-documented capabilities.
Main entry points: App.tsx App state and actions · Workspace.tsx Workspace layout · Header.tsx Project actions · ModeRail.tsx Runtime selector
Components 20
Application shell
- App state and actions
src/App.tsx - Project actions
src/components/Header.tsx - Brand mark
src/components/BrandMark.tsx - Runtime selector
src/components/ModeRail.tsx
Editing and preview
- Workspace layout
src/components/Workspace.tsx - File editor
src/components/Workspace.tsx - File management
src/components/Workspace.tsx - Vanilla preview
src/components/Workspace.tsx - Framework preview
src/components/Workspace.tsx - Console output
src/components/Workspace.tsx - Responsive preview
src/components/Workspace.tsx
Runtimes and starters
- Sandpack runtime
- Starter templates
src/data/templates.ts - Runtime libraries
src/data/runtimeResources.ts
Persistence and export
- Persistent state hook
src/hooks/usePersistentState.ts - Browser storage
- Share URL
- ZIP exporter
src/App.tsx - Clipboard
Other components
- Playground user
Connections 35
- Playground user → Runtime selector: chooses runtime
README.md - Runtime selector → App state and actions: changes mode
src/App.tsx - Playground user → Project actions: chooses starter
README.md - Project actions → App state and actions: requests actions
src/App.tsx - App state and actions → Project actions: renders
src/App.tsx - Project actions → Brand mark: renders
src/components/Header.tsx - App state and actions → Runtime selector: renders
src/App.tsx - App state and actions → Workspace layout: mounts workspace
src/App.tsx - Workspace layout → File editor: hosts editor
src/components/Workspace.tsx - Workspace layout → File management: hosts file tools
src/components/Workspace.tsx - Playground user → File editor: edits files
README.md - File editor → Workspace layout: updates files
src/components/Workspace.tsx - Workspace layout → App state and actions: saves edits
src/App.tsx - App state and actions → Workspace layout: provides files
src/App.tsx - Playground user → Project actions: runs project
README.md - Project actions → Workspace layout: requests run
src/App.tsx - Workspace layout → Vanilla preview: renders vanilla
src/components/Workspace.tsx - Workspace layout → Framework preview: renders frameworks
src/components/Workspace.tsx - Framework preview → Sandpack runtime: uses runtime
src/components/Workspace.tsx - Vanilla preview → Runtime libraries: loads libraries
README.md - Framework preview → Runtime libraries: loads libraries
README.md - Workspace layout → Console output: shows logs
src/components/Workspace.tsx - Workspace layout → Responsive preview: supports device views
README.md - Runtime selector → Starter templates: lists modes
src/components/ModeRail.tsx - App state and actions → Starter templates: loads starters
src/App.tsx - Starter templates → Runtime libraries: configures resources
src/data/templates.ts - App state and actions → Persistent state hook: persists settings
src/App.tsx - Persistent state hook → Browser storage: reads and writes
src/hooks/usePersistentState.ts - App state and actions → Browser storage: stores workspaces
src/App.tsx - Playground user → Project actions: shares project
README.md - App state and actions → Share URL: encodes files
src/App.tsx - App state and actions → Clipboard: copies link
src/App.tsx - Share URL → App state and actions: loads shared files
src/App.tsx - Playground user → Project actions: downloads project
README.md - App state and actions → ZIP exporter: exports files
src/App.tsx