|
| 1 | +# fastify-dx-solid [](https://www.npmjs.com/package/fastify-dx-solid) [](https://standardjs.com/) |
| 2 | + |
| 3 | +- [**Introduction**](https://github.com/fastify/fastify-dx/blob/main/packages/fastify-dx-solid/README.md#introduction) |
| 4 | +- [**Quick Start**](https://github.com/fastify/fastify-dx/blob/main/packages/fastify-dx-solid/README.md#quick-start) |
| 5 | +- [**Package Scripts**](https://github.com/fastify/fastify-dx/blob/main/packages/fastify-dx-solid/README.md#package-scripts) |
| 6 | +- [**Basic Setup**](https://github.com/fastify/fastify-dx/blob/main/docs/solid/basic-setup.md) |
| 7 | +- [**Project Structure**](https://github.com/fastify/fastify-dx/blob/main/docs/solid/project-structure.md) |
| 8 | +- [**Rendering Modes**](https://github.com/fastify/fastify-dx/blob/main/docs/solid/rendering-modes.md) |
| 9 | +- [**Routing Configuration**](https://github.com/fastify/fastify-dx/blob/main/docs/solid/routing-config.md) |
| 10 | +- [**Data Prefetching**](https://github.com/fastify/fastify-dx/blob/main/docs/solid/data-prefetching.md) |
| 11 | +- [**Route Layouts**](https://github.com/fastify/fastify-dx/blob/main/docs/solid/route-layouts.md) |
| 12 | +- [**Route Context**](https://github.com/fastify/fastify-dx/blob/main/docs/solid/route-context.md) |
| 13 | +- [**Route Enter Event**](https://github.com/fastify/fastify-dx/blob/main/docs/solid/route-enter.md) |
| 14 | +- [**Virtual Modules**](https://github.com/fastify/fastify-dx/blob/main/docs/solid/virtual-modules.md) |
| 15 | + |
| 16 | +## Introduction |
| 17 | + |
| 18 | +**Fastify DX for Solid** is a renderer adapter for [**fastify-vite**](https://github.com/fastify/fastify-vite). |
| 19 | + |
| 20 | +It lets you run and SSR (server-side render) **Solid applications built with Vite** on [Fastify](https://fastify.io/), with a minimal and transparent **server-first approach** — everything starts with `server.js`, your actual Fastify server. |
| 21 | + |
| 22 | +It also provides a set of built-in utilities for ease of development and managing a universal JavaScript context (SSR to CSR), very much like **Nuxt.js**, **Next.js** and **Remix**. All **Fastify DX** framework adapters implement the [URMA specification](https://github.com/fastify/fastify-dx/blob/main/URMA.md) and have almost the same API, with only minimal differences due to specific framework APIs or idioms. |
| 23 | + |
| 24 | +It is a **fast**, **lightweight** alternative to Nuxt.js packed with **Developer Experience** features. |
| 25 | + |
| 26 | +It has an extremely small core (~1k LOC total) and is built on top of [Fastify](https://github.com/fastify/fastify), [Vite](https://vitejs.dev/) and [Solid App Router](https://github.com/solidjs/solid-app-router). |
| 27 | + |
| 28 | +[**See the release notes for the 0.0.1 alpha release**](https://github.com/fastify/fastify-dx/releases/tag/solid-v0.0.1). |
| 29 | + |
| 30 | +> At this stage this project is mostly a [**one-man show**](https://github.com/sponsors/galvez), who's devoting all his free time to its completion. Contributions are extremely welcome, as well as bug reports for any issues you may find. |
| 31 | +
|
| 32 | +In this first alpha release it's still missing a test suite. The same is true for [**fastify-vite**](https://github.com/fastify/fastify-vite). |
| 33 | + |
| 34 | +It'll move into **beta** status when test suites are added to both packages. |
| 35 | + |
| 36 | +## Quick Start |
| 37 | + |
| 38 | +Ensure you have **Node v16+**. |
| 39 | + |
| 40 | +Make a copy of [**starters/solid**](https://github.com/fastify/fastify-dx/tree/dev/starters/solid). If you have [`degit`](https://github.com/Rich-Harris/degit), run the following from a new directory: |
| 41 | + |
| 42 | +```bash |
| 43 | +degit fastify/fastify-dx/starters/solid |
| 44 | +``` |
| 45 | + |
| 46 | +> **If you're starting a project from scratch**, you'll need these packages installed. |
| 47 | +> |
| 48 | +> ```bash |
| 49 | +> npm i fastify fastify-vite fastify-dx-solid -P |
| 50 | +> npm i vite-plugin-solid -D |
| 51 | +> ``` |
| 52 | +
|
| 53 | +
|
| 54 | +Run `npm install`. |
| 55 | + |
| 56 | +Run `npm run dev`. |
| 57 | +
|
| 58 | +Visit `http://localhost:3000/`. |
| 59 | +
|
| 60 | +## What's Included |
| 61 | +
|
| 62 | +That will get you a **starter template** with: |
| 63 | + |
| 64 | +- A minimal [Fastify](https://github.com/fastify/fastify) server. |
| 65 | +- Some dummy API routes. |
| 66 | +- A `pages/` folder with some [demo routes](https://github.com/fastify/fastify-dx/tree/dev/starters/solid/client/pages). |
| 67 | +- All configuration files. |
| 68 | +
|
| 69 | +It also includes some _**opinionated**_ essentials: |
| 70 | +
|
| 71 | +- [**PostCSS Preset Env**](https://www.npmjs.com/package/postcss-preset-env) by [**Jonathan Neal**](https://github.com/jonathantneal), which enables [several modern CSS features](https://preset-env.cssdb.org/), such as [**CSS Nesting**](https://www.w3.org/TR/css-nesting-1/). |
| 72 | +
|
| 73 | +- [**UnoCSS**](https://github.com/unocss/unocss) by [**Anthony Fu**](https://antfu.me/), which supports all [Tailwind utilities](https://uno.antfu.me/) and many other goodies through its [default preset](https://github.com/unocss/unocss/tree/main/packages/preset-uno). |
| 74 | +
|
| 75 | +
|
| 76 | +## Package Scripts |
| 77 | +
|
| 78 | +`npm run dev` boots the development server. |
| 79 | + |
| 80 | +`npm run build` creates the production bundle. |
| 81 | + |
| 82 | +`npm run serve` serves the production bundle. |
| 83 | +
|
| 84 | +## Meta |
| 85 | +
|
| 86 | +Created by [Jonas Galvez](https://github.com/sponsors/galvez), **Engineering Manager** and **Open Sourcerer** at [NearForm](https://nearform.com). |
| 87 | +
|
| 88 | +## Sponsors |
| 89 | +
|
| 90 | +<a href="https://nearform.com"><img width="200px" src="https://user-images.githubusercontent.com/12291/172310344-594669fd-da4c-466b-a250-a898569dfea3.svg"></a> |
| 91 | +
|
| 92 | +Also [**Duc-Thien Bui**](https://github.com/aecea) and [**Tom Preston-Werner**](https://github.com/mojombo) [via GitHub Sponsors](https://github.com/sponsors/galvez). _Thank you!_ |
0 commit comments