An open API service indexing awesome lists of open source software.

https://github.com/kathalysth/spider-react

A production-grade React implementation built from scratch with Fiber, hooks, and concurrent features
https://github.com/kathalysth/spider-react

fiber frontend hooks jsx library react typescript

Last synced: 2 months ago
JSON representation

A production-grade React implementation built from scratch with Fiber, hooks, and concurrent features

Awesome Lists containing this project

README

          

# ๐Ÿ•ท๏ธ Spider React

A production-grade React implementation built from scratch with modern features including Fiber architecture, concurrent rendering, hooks, and server-side rendering capabilities.

[![Build Status](https://github.com/kathalysth/spider-react/workflows/CI/badge.svg)](https://github.com/kathalysth/spider-react/actions)
[![Coverage Status](https://coveralls.io/repos/github/kathalysth/spider-react/badge.svg?branch=main)](https://coveralls.io/github/kathalysth/spider-react?branch=main)
[![npm version](https://badge.fury.io/js/spider.svg)](https://badge.fury.io/js/spider)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## ๐ŸŽฏ Project Overview

Spider is a complete React library implementation following best practice coding standards. This project aims to provide:

- **Fiber Architecture**: Modern reconciliation with time-slicing
- **Concurrent Features**: useTransition, Suspense, and priority-based rendering
- **Complete Hooks System**: All React hooks with custom hooks support
- **Server-Side Rendering**: Streaming SSR with selective hydration
- **TypeScript First**: Fully typed with strict mode
- **Production Ready**: Comprehensive testing and performance optimization

## ๐Ÿš€ Features

### โœ… Completed

- [x] Project setup and tooling configuration
- [ ] Core element and component system
- [ ] Basic reconciliation algorithm
- [ ] DOM renderer implementation
- [ ] Hooks system (useState, useEffect, etc.)
- [ ] Fiber architecture
- [ ] Concurrent rendering
- [ ] Suspense and error boundaries
- [ ] Server-side rendering
- [ ] Developer tools integration

### ๐Ÿ”„ In Progress

- Setting up core types and interfaces

### ๐Ÿ“‹ Planned

- See our [detailed roadmap](./ROADMAP.md) for complete feature timeline

## ๐Ÿ“ฆ Packages

Spider is organized as a monorepo with two main packages:

- **`spider`**: Core React implementation
- **`spider-dom`**: DOM renderer for browser environments

## ๐Ÿ› ๏ธ Installation

```bash
# Install both packages
npm install spider spider-dom

# Or with yarn
yarn add spider spider-dom
```

## ๐Ÿ“– Quick Start

```typescript
import { createElement, useState } from 'spider';
import { createRoot } from 'spider-dom';

function App() {
const [count, setCount] = useState(0);

return createElement('div', {}, [
createElement('h1', {}, 'Hello Spider!'),
createElement('p', {}, `Count: ${count}`),
createElement(
'button',
{
onClick: () => setCount(count + 1),
},
'Increment'
),
]);
}

const root = createRoot(document.getElementById('root')!);
root.render(createElement(App));
```

## ๐Ÿ—๏ธ Development

### Prerequisites

Node.js 18.0.0 or higher
npm 8.0.0 or higher

### Setup

```bash
# Clone the repository
git clone https://github.com/kathalysth/spider-react.git
cd spider-react

# Install dependencies
npm install

# Build all packages
npm run build

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

# Start development mode
npm run dev
```

### Project Structure

```bash
spider-react/
โ”œโ”€โ”€ packages/
โ”‚ โ”œโ”€โ”€ spider/ # Core React implementation
โ”‚ โ””โ”€โ”€ spider-dom/ # DOM renderer
โ”œโ”€โ”€ examples/ # Example applications
โ”œโ”€โ”€ docs/ # Documentation
โ””โ”€โ”€ tools/ # Build and development tools
```

## ๐Ÿงช Testing

We maintain >95% test coverage across all packages:

```bash
# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Generate coverage report
npm run test:coverage
```

## ๐Ÿค Contributing

We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTNG.md) for details.

## Development Process

1. Fork the repository
2. Create a feature branch (git checkout -b feature/amazing-feature)
3. Make your changes with tests
4. Ensure all tests pass (npm test)
5. Commit your changes (git commit -m 'Add amazing feature')
6. Push to the branch (git push origin feature/amazing-feature)
7. Open a Pull Request

## ๐Ÿ“„ License

This project is licensed under the MIT [License](./LICENSE) - see the LICENSE file for details.

## ๐Ÿ™ Acknowledgments

- Inspired by React and its excellent architecture
- Built with modern tooling and best practices
- Thanks to the React team for the incredible work

## ๐Ÿ“Š Project Status

This is an active development project. See our [roadmap](./ROADMAP.md) for current progress and upcoming features.

**Note**: This is an educational and experimental implementation. For production applications, please use the official React library.