Skip to content

frontend package manager and build tool for modular web applications

License

Notifications You must be signed in to change notification settings

kdsmith18542/componentjs

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

771 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

component reborn logo

Component Reborn

A modern, batteries-included frontend build tool, written in Rust

Build Status License: MIT

Overview

Component Reborn is a complete rewrite of the original componentjs package manager, reimagined as a modern frontend build tool. Instead of reviving the old Component ecosystem, we've taken inspiration from the original vision of a "vertically integrated frontend solution" and built something new for today's web development needs.

One command: dev server + build + asset pipeline

Features

  • πŸš€ Fast - Written in Rust for maximum performance
  • πŸ“¦ ES Modules - Native ES module support with TypeScript and JSX/TSX
  • 🎨 CSS - CSS modules and automatic vendor prefixing
  • πŸ”₯ HMR - Hot Module Replacement for instant feedback
  • πŸ› οΈ Zero Config - Sensible defaults, fully configurable when needed
  • πŸ”Œ Plugins - Extensible plugin system (Vite/Rollup-style)

Quick Start

Installation

# Using cargo
cargo install component

# Or build from source
git clone https://github.com/componentjs/component
cd component
cargo build --release

Create a New Project

# Create a new React project with TypeScript
component init --template react --typescript my-app

# Create a vanilla JavaScript project
component init my-app

# Available templates: vanilla, react, vue, svelte

Development

cd my-app
component dev

Open http://localhost:3000 to see your app. Changes to your code will automatically trigger hot reloads.

Production Build

component build

Outputs optimized bundles to the dist/ directory.

Configuration

Create a component.toml in your project root:

# Component Reborn Configuration

[project]
name = "my-app"
version = "0.1.0"

[entrypoints]
main = "src/main.tsx"
# Multiple entrypoints supported
# admin = "src/admin/main.tsx"

[output]
dir = "dist"
public_url = "/"
hash = true          # Add content hash to filenames
manifest = true      # Generate asset manifest

[features]
jsx = true
typescript = true
css_modules = true
tree_shaking = true
code_splitting = true

[dev]
port = 3000
host = "localhost"
open = false         # Auto-open browser
hmr = true           # Hot Module Replacement

CLI Commands

component init [name]

Initialize a new project.

component init my-app
component init --template react --typescript my-app

Options:

  • -t, --template <name> - Project template (vanilla, react, vue, svelte)
  • --typescript - Use TypeScript

component dev

Start development server with HMR.

component dev
component dev --port 8080
component dev --open

Options:

  • -p, --port <port> - Server port (default: 3000)
  • --host <host> - Server host (default: localhost)
  • --open - Open browser automatically
  • --no-hmr - Disable hot module replacement

component build

Build for production.

component build
component build --outdir dist
component build --no-minify

Options:

  • -o, --outdir <dir> - Output directory
  • -m, --minify - Enable minification (default: true)
  • --sourcemap - Generate source maps (default: true)
  • --target <target> - Target environment (es2020, es2021, etc.)

Project Structure

my-app/
β”œβ”€β”€ component.toml      # Configuration
β”œβ”€β”€ package.json        # npm compatibility
β”œβ”€β”€ index.html          # HTML template
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.tsx        # Entry point
β”‚   β”œβ”€β”€ App.tsx         # Root component
β”‚   └── style.css       # Global styles
└── dist/               # Build output
    β”œβ”€β”€ main.abc123.js
    β”œβ”€β”€ main.abc123.css
    └── manifest.json

Roadmap

Milestone 1 - Basic Bundler βœ…

  • TypeScript/JavaScript bundling
  • Single entrypoint
  • Basic output bundle
  • Project initialization

Milestone 2 - Module Graph & CSS

  • Multiple entrypoints
  • CSS handling + extraction
  • Asset hashing & manifest
  • Full SWC integration

Milestone 3 - Dev Server + HMR

  • Local HTTP server
  • WebSocket HMR infrastructure
  • File watching with incremental rebuilds
  • Hot module replacement for JS/CSS

Milestone 4 - Plugins & DX

  • Plugin API (Vite/Rollup-style)
  • Framework plugins (React, Vue, Svelte)
  • Error overlay
  • Great error messages

Contributing

Contributions are welcome! Please read our Contributing Guide for details.

# Clone the repository
git clone https://github.com/componentjs/component

# Build
cargo build

# Run tests
cargo test

# Run with example
cd examples/react-app
../../target/debug/component dev

License

MIT Β© Component Contributors


History

This project is a spiritual successor to the original componentjs/component, which was a pioneering frontend package manager created by TJ Holowaychuk. While the original project is archived and deprecated, Component Reborn carries forward its vision of a batteries-included frontend solution for a new generation of web development.

The original project's approach of handling "everything from package management to the build process, handling everything including HTML, JS, CSS, images, and fonts" inspired this modern rewrite. We've updated the technology stack and approach to match today's frontend development needs while maintaining the original spirit of simplicity and integration.

About

frontend package manager and build tool for modular web applications

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 77.2%
  • JavaScript 22.7%
  • Makefile 0.1%