Giter VIP home page Giter VIP logo

vitedge's Introduction

Vitedge

Vite Edge Side Rendering (ESR) framework for Vue and React.

What's ESR? Think of SSR (Server Side Rendering) in CDN nodes instead of actual servers. This is possible today thanks to Cloudflare Workers (and maybe some other platforms in the near future).

Vitedge is just a Vite app ™ that prerrenders the first view in an edge worker and runs the rest as an SPA. That means it will lead to good SEO while keeping the snappy routing and DX of an SPA.

It can replace static site generators in some situations since it builds on the fly and caches at the edge. Therefore, instead of getting a static index.html from the CDN, the CDN itself will create it on the fly or provide it from cache if it was already accessed (with configurable cache age + stale-while-revalidate).

Even though running it at the edge is ideal, it is actually compatible with any Node environment.

See live demo and Vue starter template.

Features

  • ⚡ Ultrafast development and HMR powered by Vite and ES Modules.
  • ⚔️ Renders and caches at the edge for maximum performance in production. Cache is configurable.
  • 💁‍♂️ Each page gets its server data as props by default but can be set in a store instead.
  • 🔽 HTTP/2 server push for your assets to speed up the loading time without waterfall requests.
  • 🧱 Automatically creates endpoints for your API based on filesystem routes.

Docs

See docs.

Roadmap

  • Support TypeScript projects.
  • Custom Vite dev-server that serves API/Props during development.
  • Docs website.
  • Extract CF worker boilerplate as utilities.
  • Cache props/html in worker and make it configurable.
  • i18n compatible.
  • Starter template.
  • Auth utilities/guide (passing JWT in requests as cookies).
  • Compatibility with Node runtime for other providers (Vercel/Netlify...).
  • Add example using Vercel's edge cache.
  • Detect imported files in HTML and push them with HTTP/2.
  • Add an SSR mode for local development (web worker?).
  • Support GraphQL, sitemap and other dynamic endpoints.
  • React compatibility.
  • Provide React starter template.
  • Svelte compatibility.
  • Support Vite 2.
  • HMR for API side.
  • Preload assets using Vite's manifest.
  • Support self-requests to API endpoints during SSR.
  • Support parameters and wildcards in API file routes (api/path/[param].js).
  • Stale-while-revalidate cache for pages.

Contributing

See contributing guide.

vitedge's People

Contributors

frandiox avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.