Socket
Socket
Sign inDemoInstall

fastify-renderer

Package Overview
Dependencies
268
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fastify-renderer

Simple, high performance client side app renderer for Fastify.


Version published
Weekly downloads
4
decreased by-80.95%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

fastify-renderer

Build Status NPM version

fastify-renderer renders client side JavaScript applications on the server to improve the user experience.

What

TODO: make nice

  • Render client side apps server side with minimal setup
  • optional async work ahead of time using handy server side bits like a database connection or session stored in redis
  • Serve server side props to client side pages as the navigations happen client side
  • Control things outside the inner application like the <head/> tag when server rendering

How

  • mount a vite server as a fastify plugin that knows how to transform code to be run server side
  • provide renderers that use vite for react and other popular frameworks
  • provide a convention for async ahead of time work to pass data into renderers
  • provide a router convention that the server and client agree on

Why

TODO: make nice

  • next.js has a great developer experience but blocks the main thread when rendering react
  • next.js uses express and webpack underneath, both of which have much better performing alternatives
  • next.js must be both the bundler and the server, it's hard to mount it into an existing system like fastify and play nice with all the other plugins you might want to use when doing :gasp: server side rendered :gasp: applications
  • vite is awesome but also wants to be the server and keep the frontend entirely seperate from the backend
  • server side rendering is hard and reinventing that wheel is no fun
  • hot reloading in development is hard and reinventing that wheel is no fun
  • bundling for production is hard and reinventing that wheel is no fun
  • esbuild is very fast

Status

Alpha. Pre-any-release.

Installation

npm install fastify-renderer

Example

import renderer from 'fastify-renderer/react'

const server = fastify()
server.register(renderer)

License

MIT

Keywords

FAQs

Last updated on 19 Feb 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc