0.0.1 • Published 4 years ago

respond-dev v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Respond

TypeScript web framework optimized for delivery 🚚

New tech

  • First class universal routing (SSR & SPA 🧖‍♀️)
  • Client side ES modules (🚫 webpack, ✅ MJS)
  • TypeScript sources and breakpoints in browser 🧘
  • Built-in server environments (Node.js HTTP, AWS Lambda, Cloudflare Worker ☁️)
  • JSX 🏭

Old wisdom

  • Structured request pipeline (initializers, middleware, etc 🏗️)
  • Simple DOM operations (🚫 virtual dom, ✅ createElement)
  • Simple remote function calls 🛰️
  • Very few production NPM dependencies 📉📦

Create a new project

git clone git@github.com:respond-dev/respond.git [project-name]
cd [project-name]
npm install

Start server

npm start

Universal request pipeline

There are five successive phases of the universal request pipeline. Each phase corresponds to a directory of source files:

  1. src/pipeline/constructors — Builds input for initializers, only runs once
  2. src/pipeline/initializers — Builds input for middleware, only runs when route changes
  3. src/pipeline/middleware — Builds input for routers
  4. src/pipeline/routers — Executes user code to build output for settlers
  5. src/pipeline/settlers — Settles the final output

With each phase of the request pipeline, the functions in each respective directory execute in parallel. Their collective output combines to build the input for the next phase of the pipeline.

If a source file begins with client or server, it will only execute on that environment. Otherwise, it is up to the function to conditionally enable or disable itself.