A production-grade React implementation built from scratch with modern features including Fiber architecture, concurrent rendering, hooks, and server-side rendering capabilities.
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
- 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
- Setting up core types and interfaces
- See our detailed roadmap for complete feature timeline
Spider is organized as a monorepo with two main packages:
spider
: Core React implementationspider-dom
: DOM renderer for browser environments
# Install both packages
npm install spider spider-dom
# Or with yarn
yarn add spider spider-dom
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));
Node.js 18.0.0 or higher npm 8.0.0 or higher
# 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
spider-react/
├── packages/
│ ├── spider/ # Core React implementation
│ └── spider-dom/ # DOM renderer
├── examples/ # Example applications
├── docs/ # Documentation
└── tools/ # Build and development tools
We maintain >95% test coverage across all packages:
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverage
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (git checkout -b feature/amazing-feature)
- Make your changes with tests
- Ensure all tests pass (npm test)
- Commit your changes (git commit -m 'Add amazing feature')
- Push to the branch (git push origin feature/amazing-feature)
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by React and its excellent architecture
- Built with modern tooling and best practices
- Thanks to the React team for the incredible work
This is an active development project. See our roadmap for current progress and upcoming features.
Note: This is an educational and experimental implementation. For production applications, please use the official React library.