AI summary by TwinMind
Skip just dropped - "it's like React, for your Backend"
Theo - t3․gg
23m 14s
Introduction to Skip Framework
- React changed client-side application building through component model and reactivity
- Backend hasn't seen equivalent evolution since GraphQL
- Skip announced by Christopher Chabowski (creator of ExcalDraw, Prettier, Recoil)
- Described as "react for the backend" - reactive framework enabling reactivity graph from database to user
Skip Framework Overview
- Not alternative to Express/Nest/NextJS - layer between backend services and clients
- Similar positioning to GraphQL - sits between services/databases/microservices and clients
- Goal: simplify state management like React solved component dependency bugs
- Built using combination of custom Skip language and C (20% of repo is raw C)
- Production-ready at Facebook/Meta - used for real stuff for years
- Public release new - not ready for general adoption yet
Core Concepts and Mental Model
- Collections: Sources of data (like arrays of things)
- Mappers: Create new collections from existing collections (like Array.map())
- Mappers cannot modify existing collections - only create new ones
- Collections can be eager (always has data) or lazy (fetches on demand)
- Direct dependency path created from source collection to derived collections
Technical Implementation
- All streams come from same endpoint:
/v1/stream/{uuid} - Skip service generates UUIDs for specific collection instances
- Client redirected to streaming endpoint for real-time updates
- Event Source API used for client-side streaming connections
- Database changes trigger
service.put()calls which propagate through dependency graph
Code Examples Analysis
Database Service Setup
- Express.js endpoints for user operations
- SQLite database integration
- Stream endpoints redirect to UUID-based streaming URLs
- Single line
service.put(users, key, data)triggers all dependent updates
Collection Definitions
- Type definitions for User (name, country)
- UserCollection as eager collection with string key, User value
- UserResource class implementing resource interface
- Service instantiation requires initial data, resources, createGraph function
Complex Example: Active Friends by Group
- User type: name, active boolean, friends array of user IDs
- Group type: name, members array of user IDs
- ActiveUser mapper: filters active users from groups
- FilterFriends mapper: returns friend user IDs from given group
- Functional paradigm with single source of truth flowing through side-effect-free functions
Client-Side Implementation
React Integration
- Event Source creation for streaming updates
- Event listeners for 'init' (initial data) and 'update' events
- State management through React useState
- Automatic re-rendering when updates received
- POST calls trigger backend updates which flow through to clients
Hacker News Clone Example
- Three-tier architecture:
- WWW: actual web app
- Reactive service: Skip layer
- Web service: Python backend
- Fallback to snapshots if Event Stream not supported
- Backend calls reactive service
/input/{collection}/{id}to trigger updates
Production Considerations
- Refined for production workloads at Meta
- High adoption barrier - complex setup required
- Manual definition of all collection layers needed
- Functional programming paradigm with class-based implementation
- Control flow not immediately clear - mental hurdles to overcome
Historical Context
- Originally attempted as new programming language
- Pivoted to JavaScript/TypeScript API with Skip core
- Much lower adoption barrier than full language approach
- Still maintains same architectural wins
Assessment and Recommendations
- Very exciting project with innovative ideas
- Not recommended for general use yet - too early/complex
- Introduces valuable concepts for learning
- Represents potential future direction for backend reactivity
