Skip to content

A High-performance Server-side Rendering (SSR) Framework for Vue Apps, Powered by V8 and Golang.

License

Notifications You must be signed in to change notification settings

sait/vue-ssr-v8go

 
 

Repository files navigation

Vue SSR powered by v8go

A High-performance Server-side Rendering (SSR) Framework for Vue Apps, Powered by V8 and Golang.

How to run

First, compile and launch the server:

make
./vue-ssr-v8go -config conf-dev.toml

Then, visit the test page using curl or a browser:

curl http://localhost:9090/test

Used Packages

  • v8go - Go bindings for V8 JavaScript engine
  • Vue - The Progressive JavaScript Framework | Vue.js
  • Vite - Next Generation Frontend Tooling | Vite

Pros and Cons

Pros:

  • No need to use Node.js, powered by V8 and Golang.
  • Thread-safe V8 scheduler with dynamic scaling (1-50+ isolates)
  • Prevents memory leaks via lifetime-controlled isolation (0-3600s+).
  • An enhanced and optimized XMLHttpRequest is implemented, with setTimeout and setInterval removed, thus bettering SSR.
  • Automatically fall back to client-side rendering when server-side rendering encounters an error.

Cons:

  • You can't use Vite features like hot module replacement (HMR), but you can run npm run watch to build on-the-fly JavaScript scripts.

Keynotes

Separate config for Vite Build

The default config is configured in vite.config.ts and the additional configuration for the SSR build is located in vite.config.server.ts. SSR config builds the frontend application with target webworker as it is required for the V8 engine.

Entry point for SSR and Client are different

See:

About

A High-performance Server-side Rendering (SSR) Framework for Vue Apps, Powered by V8 and Golang.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 86.7%
  • TypeScript 5.9%
  • Vue 3.5%
  • HTML 2.4%
  • CSS 1.3%
  • Makefile 0.2%