npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@taujs/server

v0.1.7

Published

taujs | τjs

Downloads

298

Readme

@taujs/server

npm install @taujs/server

yarn add @taujs/server

pnpm add @taujs/server

CSR; SSR; Streaming SSR; Hydration; Fastify + React 18

Supports rendering modes:

  • Client-side rendering (CSR)
  • Server-side rendering (SSR)
  • Streaming SSR

Supported application structure and composition:

  • Single-page Application (SPA)
  • Multi-page Application (MPA)
  • Build-time Micro-Frontends, server orchestration and delivery

Assemble independently built frontends at build time incorporating flexible per-route SPA-MPA hybrid with CSR, SSR, and Streaming SSR, rendering options.

Fastify Plugin for integration with taujs [ τjs ] template https://github.com/aoede3/taujs

  • Production: Fastify, React

  • Development: Fastify, React, tsx, Vite

  • TypeScript-first

  • ESM-only focus

τjs - Developer eXperience

Integrated ViteDevServer HMR + Vite Runtime API run alongside tsx (TS eXecute) providing fast responsive dev reload times for both backend / frontend

  • Fastify https://fastify.dev/

  • React https://reactjs.org/

  • tsx https://tsx.is/

  • Vite https://vitejs.dev/guide/ssr#building-for-production

  • ViteDevServer HMR https://vitejs.dev/guide/ssr#setting-up-the-dev-server

  • Vite Runtime API https://vitejs.dev/guide/api-vite-runtime

  • ESBuild https://esbuild.github.io/

  • Rollup https://rollupjs.org/

  • ESM https://nodejs.org/api/esm.html

Development / CI

npm install --legacy-peer-deps

Usage

Fastify

https://github.com/aoede3/taujs/blob/main/src/server/index.ts

Not utilising taujs [ τjs ] template? Add in your own ts alias object for your own particular directory setup e.g. alias: { object }

React 'entry-client.tsx'

https://github.com/aoede3/taujs/blob/main/src/client/entry-client.tsx

React 'entry-server.tsx'

Extended pipe object with callbacks to @taujs/server enabling additional manipulation of HEAD content from client code

https://github.com/aoede3/taujs/blob/main/src/client/entry-server.tsx

index.html

https://github.com/aoede3/taujs/blob/main/src/client/index.html

client.d.ts

https://github.com/aoede3/taujs/blob/main/src/client/client.d.ts

Routes

Integral to τjs is its internal routing:

  1. Fastify serving index.html to client browser for client routing
  2. Internal service calls to API to provide data for streaming/hydration
  3. Fastify serving API calls via HTTP in the more traditional sense of client/server

In ensuring a particular 'route' receives data for hydration there are two options:

  1. An HTTP call elsewhere syntactically not unlike 'fetch' providing params to a 'fetch' call
  2. Internally calling a service which in turn will make 'call' to return data as per your architecture

In supporting Option 2. there is a registry of services. More detail in 'Service Registry'.

Each routes 'path' is a simple URL regex as per below examples.

https://github.com/aoede3/taujs/blob/main/src/shared/routes/Routes.ts

Service Registry

In supporting internal calls via τjs a registry of available services and methods provides the linkage to your own architectural setup and developmental patterns

https://github.com/aoede3/taujs/blob/main/src/server/services/ServiceRegistry.ts

https://github.com/aoede3/taujs/blob/main/src/server/services/ServiceExample.ts