Skip to content

Commit 10e5ba4

Browse files
authored
Merge branch 'main' into fix/File-System-Routing
2 parents acdd3bb + 1678f34 commit 10e5ba4

File tree

1 file changed

+115
-56
lines changed

1 file changed

+115
-56
lines changed

README.md

Lines changed: 115 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,141 @@
1-
<p>
2-
<img width="100%" src="https://assets.solidjs.com/banner?project=Start&type=core" alt="Solid Docs">
3-
</p>
1+
[![Banner](https://assets.solidjs.com/banner?project=Start&type=core)](https://github.com/solidjs)
42

5-
# SolidStart
3+
[![Version](https://img.shields.io/npm/v/@solidjs/start.svg?style=for-the-badge&color=blue)](https://www.npmjs.com/package/@solidjs/start)
4+
[![Downloads](https://img.shields.io/npm/dm/@solidjs/start.svg?style=for-the-badge&color=green)](https://www.npmjs.com/package/@solidjs/start)
5+
[![Stars](https://img.shields.io/github/stars/solidjs/solid-start?style=for-the-badge&color=yellow)](https://github.com/solidjs/solid-start)
6+
[![Discord](https://img.shields.io/discord/722131463138705510?style=for-the-badge&color=5865F2)](https://discord.com/invite/solidjs)
7+
[![Reddit](https://img.shields.io/reddit/subreddit-subscribers/solidjs?style=for-the-badge&color=FF4500)](https://www.reddit.com/r/solidjs/)
68

7-
This is the home of the SolidStart, the Solid app framework.
9+
**SolidStart** brings fine-grained reactivity fullstack with full flexibility. Built with features like unified rendering and isomorphic code execution, SolidStart enables you to create highly performant and scalable web applications.
810

9-
## Features
11+
Explore the official [documentation](https://docs.solidjs.com/solid-start) for detailed guides and examples.
1012

11-
- File-system based routing
12-
- Supports all rendering modes:
13-
- Server-side rendering (SSR)
14-
- Streaming SSR
15-
- Client-side rendering (CSR)
16-
- Static site generation (SSG)
17-
- Streaming
18-
- Build optimizations with code splitting, tree shaking and dead code elimination
19-
- API Routes
20-
- Built on Web standards like Fetch, Streams, and WebCrypto
21-
- Adapters for deployment to all popular platforms
22-
- CSS Modules, SASS/SCSS Support
23-
- TypeScript-first
13+
## Core Features
2414

25-
### Getting started
15+
- **All Rendering Modes**:
16+
- Server-Side Rendering _(SSR)_ with sync, async, and stream [modes](https://docs.solidjs.com/solid-start/reference/server/create-handler)
17+
- Client-Side Rendering _(CSR)_
18+
- Static Site Generation _(SSG)_
19+
- **TypeScript**: Full integration for robust, type-safe development
20+
- **File-Based Routing**: Intuitive routing based on your project’s file structure
21+
- **API Routes**: Dedicated server-side endpoints for seamless API development
22+
- **Streaming**: Efficient data rendering for faster page loads
23+
- **Build Optimizations**: Code splitting, tree shaking, and dead code elimination
24+
- **Deployment Adapters**: Easily deploy to platforms like Vercel, Netlify, Cloudflare, and more
2625

27-
Create a SolidStart application and run a development server using your preferred package manager:
26+
## Getting Started
27+
28+
### Installation
29+
30+
Create a template project with your preferred package manager
2831

2932
```bash
30-
mkdir my-app
31-
cd my-app
33+
# using npm
34+
npm create solid@latest -- --solidstart
35+
```
3236

33-
# with npm
34-
npm init solid@latest
35-
npm install
36-
npm run dev
37+
```bash
38+
# using pnpm
39+
pnpm create solid@latest --solidstart
40+
```
3741

38-
# or with pnpm
39-
pnpm create solid@latest
40-
pnpm install
41-
pnpm dev
42+
```bash
43+
# using bun
44+
bun create solid@latest --solidstart
45+
```
46+
47+
1. Follow the CLI prompts to set up your project
48+
2. Navigate to your project directory and install the dependencies
4249

43-
# or with Bun
44-
bun create solid@latest
45-
bun install
46-
bun dev
50+
```bash
51+
cd <project-name>
52+
npm install # or pnpm install or bun install
4753
```
4854

49-
### Development
55+
3. Start the development server
5056

51-
You should use a Node.js version manager [compatible with `.node-version`](https://stackoverflow.com/a/62978089/565877) ([asdf-vm](https://asdf-vm.com/) is a great option macOS/Linux users)
57+
```bash
58+
npm run dev # or pnpm dev or bun dev
59+
```
5260

53-
The monorepo uses `pnpm` as the package manager. To install `pnpm`, run the following command in your terminal.
61+
### Project Structure
62+
63+
- `public/`: Static assets like icons, images, and fonts
64+
- `src/`: Core application (aliased to `~/`)
65+
- `routes/`: File-based routing for pages and APIs
66+
- `app.tsx`: Root component of your application
67+
- `entry-client.tsx`: Handles client-side hydration
68+
- `entry-server.tsx`: Manages server-side request handling
69+
- **Configuration Files**: `app.config.ts`, `package.json`, and more
70+
71+
Learn more about routing in the [documentation](https://docs.solidjs.com/solid-start/building-your-application/routing).
72+
73+
## Adapters
74+
75+
Configure adapters in `app.config.ts` to deploy to platforms like Vercel, Netlify, Cloudflare, and others
76+
77+
```ts
78+
import { defineConfig } from "@solidjs/start/config";
79+
80+
export default defineConfig({
81+
ssr: true, // false for client-side rendering only
82+
server: { preset: "vercel" },
83+
});
84+
```
85+
86+
Presets also include runtimes like Node.js, Bun or Deno. For example, the `node-server` preset enables hosting on your server.
87+
Learn more about [`defineConfig`](https://docs.solidjs.com/solid-start/reference/config/define-config).
88+
89+
## Building for Production
90+
91+
Generate production-ready bundles
5492

5593
```bash
56-
npm install -g pnpm
94+
npm run build # or pnpm build or bun build
5795
```
5896

59-
Run `pnpm install` to install all the dependencies for the packages and examples in your monorepo.
97+
After the build completes, you’ll be guided through deployment for your specific preset.
6098

61-
Run `pnpm build` to build SolidStart project
99+
## Contributing
100+
101+
Join the SolidJS community and contribute!
102+
103+
- [Discord](https://discord.com/invite/solidjs): Ask for help and discuss ideas
104+
- [Issues](https://github.com/solidjs/solid-start/issues): Report bugs or suggest features
105+
- [Docs Issues](https://github.com/solidjs/solid-docs/issues): Report documentation issues
62106

63107
<details>
64-
<summary><h4>Monorepo & <code>project.json</code> <code>"workspace"</code> support</h4></summary>
108+
<summary><h3>Development Setup</h3></summary>
109+
110+
Use a Node.js version manager compatible with `.node-version`. We recommend [asdf-vm](https://asdf-vm.com/) for macOS and Linux users.
111+
112+
### Monorepo & Package Manager
113+
114+
SolidStart uses `pnpm` as the package manager. Install it globally:
115+
116+
```bash
117+
npm install -g pnpm
118+
```
119+
120+
Install dependencies for the monorepo:
121+
122+
```bash
123+
pnpm install
124+
```
65125

66-
If you are using SolidStart within a monorepo that takes advantage of the `package.json` `"workspaces"` property (e.g. [Yarn workspaces](https://classic.yarnpkg.com/en/docs/workspaces/)) with hoisted dependencies (the default for Yarn), you must include `#solidjs/start` within the optional `"nohoist"` (for Yarn v2 or higher, see further down for instructions) workspaces property.
126+
Build the project:
127+
128+
```bash
129+
pnpm build
130+
```
67131

68-
- _In the following, "workspace root" refers to the root of your repository while "project root" refers to the root of a child package within your repository._
132+
### Monorepo & `package.json` Workspaces
69133

70-
For example, if specifying `"nohoist"` options from the workspace root (i.e. for all packages):
134+
If using a monorepo with `package.json` `"workspaces"` (e.g., [Yarn Workspaces](https://classic.yarnpkg.com/en/docs/workspaces/)), ensure `@solidjs/start` is not hoisted. Add it to the `"nohoist"` field in the workspace root or project root:
135+
136+
**Workspace Root Example**:
71137

72138
```jsonc
73-
// in workspace root
74139
{
75140
"workspaces": {
76141
"packages": [
@@ -81,32 +146,26 @@ For example, if specifying `"nohoist"` options from the workspace root (i.e. for
81146
}
82147
```
83148

84-
If specifying `"nohoist"` options for a specific package using `@solidjs/start`:
149+
**Project Root Example**:
85150

86151
```jsonc
87-
// in project root of a workspace child
88152
{
89153
"workspaces": {
90154
"nohoist": ["@solidjs/start"]
91155
}
92156
}
93157
```
94158

95-
Regardless of where you specify the `nohoist` option, you also need to include `@solidjs/start` as a `devDependency` in the child `package.json`.
96-
97-
The reason why this is necessary is because `@solidjs/start` creates an `index.html` file within your project which expects to load a script located in `/node_modules/@solidjs/start/runtime/entry.jsx` (where `/` is the path of your project root). By default, if you hoist the `@solidjs/start` dependency into the workspace root then that script will not be available within the package's `node_modules` folder.
98-
99-
**Yarn v2 or higher**
100-
101-
The `nohoist` option is no longer available in Yarn v2+. In this case, we can use the `installConfig` property in the `package.json` (either workspace package or a specific project package) to make sure our deps are not hoisted.
159+
For **Yarn v2+**, use `installConfig` to prevent hoisting:
102160

103161
```jsonc
104-
// in project root of a workspace child
105162
{
106163
"installConfig": {
107164
"hoistingLimits": "dependencies"
108165
}
109166
}
110167
```
111168

169+
**Note**: Add `@solidjs/start` as a `devDependency` in the child `package.json` to ensure the `/node_modules/@solidjs/start/runtime/entry.jsx` script is available.
170+
112171
</details>

0 commit comments

Comments
 (0)