How emzzy241/unfinished works
Project type and purpose
• This is a client-side JavaScript library for building web applications (like React), named “unfinished.”
• It provides:
• A JSX runtime (to convert JSX into function calls)
• A core UI library (reactive components, control-flow helpers, utilities)
• A built-in router (single-page app navigation)
• Shadow DOM and teleport support
• Hot-module-reload support and a small footprint
File structure
• Top-level directories and files:
• source/ – all library source code
• scripts/ – build and development-server scripts
• docs/ – documentation site content
• package.json, bun.lockb, deno.json, tsconfig.json – configuration for packaging, bundling, TypeScript, runtime, etc.
• .github/workflows/pkg.pr.yml – CI workflow for publishing
• Inside source/:
• jsx-runtime/ – code that implements JSX-to-call conversion at runtime
• library/ – core exports: for.js, if.js, switch.js, observer.js, jsx.js, utils.js
• render/ – rendering logic that mounts virtual nodes to the DOM
• router/ – SPA router (routeTree, lazy loading, middleware)
• shadowroot/ – helper to mount inside a shadow DOM
• teleport/ – portal/teleport support
README for additional insights
• Key Features list confirms the above breakdown
• Mentions underlying reactivity library (@adbl/cells) for automatic updates
a. Main components:
• Developer’s application code (the end-user app written in JSX)
• Build & bundler toolchain (scripts/build.js, bun or Deno, package.json)
• Library runtime modules:
– JSX Runtime
– Core helpers & reactivity (library/)
– Renderer (render/)
– Router (router/)
– ShadowDOM (shadowroot/)
– Teleport (teleport/)
• External dependencies (npm, @adbl/cells)
• Browser (DOM)
b. Relationships & interactions:
1. Developer code (JSX) → bundled by build tool → includes calls into the JSX Runtime
2. JSX Runtime → creates virtual element descriptions → passed to Renderer
3. Renderer → mounts/upates real DOM nodes
4. Core helpers (for, if, switch, observer) wrap data and UI for reactivity
5. Router intercepts navigation events → updates Renderer with the correct view
6. Shadowroot & Teleport modules let components mount into isolated DOM subtrees or external containers
7. Hot Module Reload: file changes → development server (scripts/start) → swaps updated modules in the browser without full reload
c. Architectural patterns & design principles:
• Modular design: each feature lives in its own directory under source/
• Single responsibility: JSX handling separate from rendering, routing, reactivity
• Unopinionated DOM integration: components ARE DOM nodes (no virtual-DOM diff engine)
• Pluggable SPA routing with middleware and lazy loading
d. Relevant technologies/frameworks:
• bun (bun.lockb) and/or Deno for building/serving
• @adbl/cells for reactivity
• NPM scripts for package management
• GitHub Actions (CI) for publication