• Stars
    star
    728
  • Rank 62,237 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 4 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Edge-side rendering and fullstack Vite framework

Vitedge

Vite Edge Side Rendering (ESR) framework for Vue and React, or bring your own view library.

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 prerenders 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 such as Vercel or Netlify.

See live demo, and Vue or React starter templates. If you want to bring your own view library, have a look at the Vanilla JS example as a guide.

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 & Community

See docs.

To talk about Vitedge, join ViteLand Discord and check #vitedge channel or use GitHub's Discussions.

Starters

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.
  • Support Vite 2.
  • HMR for API side.
  • Page props HMR in browser on file save.
  • 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.
  • CORS defaults.
  • Throw errors from API/Props endpoints.
  • Redirects with 3xx HTTP codes.
  • Mockup KV and cache in development.
  • Mockup DO in development.
  • Rewrite in TypeScript.
  • Guide to bring your own view framework.
  • Preview mode to simulate Worker environment in development.
  • Support Wrangler v2.
  • Deploy to fullstack Cloudflare Pages.
  • Streaming mode.
  • Support React 18

Contributing

See contributing guide.

More Repositories

1

vite-ssr

Use Vite for server side rendering in Node
TypeScript
821
star
2

vitesse-ssr-template

🏕 Opinionated Vue + Vite Starter Template with SSR in Node.js
TypeScript
187
star
3

vitessedge-template

🏕 Opinionated Vite Starter Template with SSR in Cloudflare Workers
TypeScript
153
star
4

vue-graphql-enterprise-boilerplate

A GraphQL ready, very opinionated Vue SPA template for Vue CLI 3
JavaScript
120
star
5

OnsenUI-Todo-App

Onsen UI 2.0 To-Do sample application implemented in Vanilla JavaScript.
JavaScript
100
star
6

vue-tiny-validator

Tiny form validation tool for Vue 3
TypeScript
51
star
7

vue-geo-suggest

Renderless Vue component for finding addresses using Google Places API
JavaScript
42
star
8

medium-json-feed

Get Medium latest articles in JSON format
JavaScript
38
star
9

OnsenUI-YouTube

Example jukebox app made with Onsen UI, AngularJS and Youtube API
JavaScript
37
star
10

reactesse-ssr-template

🏕 Opinionated React + Vite Starter Template with SSR in Node.js
TypeScript
33
star
11

vue-use-stripe

Thin Vue 3 wrapper for Stripe.js
TypeScript
33
star
12

reactesse-edge-template

TypeScript
28
star
13

onsenui-vue-router

Example that integrates vue-router and vue-onsenui
JavaScript
26
star
14

vue-onsenui-kitchensink

Vue.js + Onsen UI Kitchen Sink Example
Vue
20
star
15

OnsenUI-router

OnsenUI example app with ui-router
HTML
13
star
16

gulp-vue-compiler

Vue single file component compiler plugin for Gulp
JavaScript
13
star
17

OnsenUI-Material-Tabbar

Onsen UI 2.0 example with Material Design Tabbar
JavaScript
12
star
18

OnsenUI-Memo-App

Memo example application using OnsenUI and developing in Monaca
JavaScript
12
star
19

cf-workers-boilerplate

Deploy Cloudflare Workers easily without sacrifying developer experience
TypeScript
12
star
20

OnsenUI-Meteor-ToDo

Combining Onsen UI, React and Meteor
CSS
10
star
21

hydrogen-vercel-edge

Deploy a Hydrogen storefront to Vercel Edge Functions
JavaScript
9
star
22

graphql-info-transformer

JavaScript
6
star
23

multienv-loader

Dotenv loader for multiple environments
JavaScript
5
star
24

Nipponline

TeX
5
star
25

OnsenUI-LazyRepeat

Example of ons-lazy-repeat feature
JavaScript
4
star
26

karma-chai-spies

Karma plugin adapter for Chai-spies
JavaScript
4
star
27

normalize-unicode-text

Normalize strings with diacritics, zero-width whitespaces and other non-latin characters
JavaScript
4
star
28

dotfiles

Linux user dotfiles
Vim Script
3
star
29

hydrogen-vercel-serverless

Deploy a Hydrogen storefront to Vercel Serverless Functions
JavaScript
2
star
30

Cryptography-for-Network-Security

An introduction to cryptography
2
star
31

CDUC

Crohn's disease and Ulcerative Colitis classifier
1
star
32

vuetify-graphcool-poc

Vuetify + GraphCool
JavaScript
1
star
33

vite-ssr-vue-query

Created with CodeSandbox
TypeScript
1
star
34

postcss-url-resolver

PostCSS plugin that resolves urls (CSS imports and images) via http requests. Isomorphic (node + browser).
JavaScript
1
star