0.19.1 • Published 2 years ago

vitedge v0.19.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Vitedge

Vite Edge Side Rendering (ESR) framework.

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 future).

See a full example here.

Concept

Vitedge is "just a Vite app" that prerrenders the first view in a CF 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 replaces static site generators since it builds on the fly and caches at the edge (cache is WIP). 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 alredy accessed (with configurable cache age).

Apart from the normal Vite app, it provides some extra fullstack utilities.

API

It can create a REST API based on filesystem routes: <root>/api/my/function.js will be built as /api/my/function endpoint and can be requested from the frontend.

ESR Page Props

Each page can make an optional "get page props" request to the worker before rendering. For example, if a page's route has name: "customers", the endpoint /api/props/customers will be called automatically before rendering. The handler for this route must be defined in <root>/api/props/customers.js.

Usage

  1. Create a normal Vite app.
  2. Install vitedge with your package manager.
  3. Import vitedge/plugin in your vite.config.js. Example here.
  4. Import and call Vitedge from your app's entry point providing your main App.vue and your page routes. Vitedge will create the router and attach the app to the DOM for you according to the running environment. Example here
  5. Build using vitedge build command

TODOS

  • Custom Vite dev-server that serves API during development
  • Provide TS types
  • Docs website
  • File sytem routing for pages
  • Extract CF worker boilerplate as a utility
  • Cache props/html in worker's KV and make it configurable
  • List of pages that should be prerrendered automatically after deployment
  • Research if Rollup can build directly for webworker target and remove Webpack
  • i18n utilities
  • Explore the possibility of extracting "getPageProps" from each page component using custom Vue blocks (currently these are provided in <root>/api/props/ directory).
0.19.1

2 years ago

0.19.0

2 years ago

0.18.2

2 years ago

0.17.4

2 years ago

0.17.5

2 years ago

0.18.1

2 years ago

0.18.0

2 years ago

0.17.3

2 years ago

0.17.2

3 years ago

0.17.0

3 years ago

0.17.1

3 years ago

0.16.4

3 years ago

0.16.3

3 years ago

0.16.2

3 years ago

0.16.1

3 years ago

0.16.0

3 years ago

0.15.1

3 years ago

0.15.0

3 years ago

0.14.0

3 years ago

0.13.3

3 years ago

0.13.0

3 years ago

0.12.1

3 years ago

0.13.1

3 years ago

0.13.2

3 years ago

0.12.0

3 years ago

0.11.0

3 years ago

0.10.5

3 years ago

0.10.4

3 years ago

0.10.3

3 years ago

0.10.2

3 years ago

0.10.1

3 years ago

0.10.0

3 years ago

0.9.0

3 years ago

0.8.0

3 years ago

0.7.0

3 years ago

0.6.2

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago

0.5.1

3 years ago

0.4.9

3 years ago

0.4.8

3 years ago

0.4.7

3 years ago

0.4.6

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.6

3 years ago

0.3.5

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago