Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.6.0 #1347

Merged
merged 13 commits into from
Feb 27, 2024
Merged

v0.6.0 #1347

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/clever-ties-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/start": minor
---

Update to vinxi 0.3.3 (thus also Vite 4 -> 5)
5 changes: 5 additions & 0 deletions .changeset/dry-eagles-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/start": patch
---

configurable dev overlay
5 changes: 5 additions & 0 deletions .changeset/fifty-horses-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/start": patch
---

update vinxi, fix prerendering
5 changes: 5 additions & 0 deletions .changeset/popular-rivers-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/start": patch
---

handler options as function, forward nonce to main scripts
5 changes: 5 additions & 0 deletions .changeset/serious-apples-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/start": minor
---

move server rendering options to handler
5 changes: 5 additions & 0 deletions .changeset/small-cherries-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/start": minor
---

vite.config -> app.config
5 changes: 5 additions & 0 deletions .changeset/smart-moose-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/start": patch
---

fix nojs flash update auth/prisma examples
34 changes: 34 additions & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { defineConfig } from "@solidjs/start/config";
import { docsMdx } from "solid-start-mdx";
import tailwindcss from "tailwindcss";
import { config } from "vinxi/plugins/config";

export default defineConfig({
appRoot: "./docs",
extensions: ["mdx", "md"],
islands: true,
server: {
preset: "cloudflare_module",
rollupConfig: {
external: ["__STATIC_CONTENT_MANIFEST", "node:async_hooks"]
},
prerender: {
crawlLinks: true
}
},
vite: {
optimizeDeps: {
entries: []
},
plugins: [
config("tailwind", {
css: {
postcss: {
plugins: [tailwindcss]
}
}
} as any),
docsMdx()
]
}
});
2 changes: 1 addition & 1 deletion archived_examples/notes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ npm run dev -- --open

Solid apps are built with _adapters_, which optimise your project for deployment to different environments.

By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different adapter, add it to the `devDependencies` in `package.json` and specify in your `vite.config.js`.
By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different adapter, add it to the `devDependencies` in `package.json` and specify in your `app.config.js`.
71 changes: 50 additions & 21 deletions docs/routes/api/vite.md → docs/routes/api/app-config.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
---
section: api
title: vite.config.ts
title: app.config.ts
order: 8
subsection: Entrypoints
active: true
---

# vite.config.ts
# app.config.ts

##### `vite.config.ts` is where you configure your application.
##### `app.config.ts` is where you configure your application.

<div class="text-lg">

```tsx
import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
start: {
server: {
preset: "netlify"
}
vite: {
// vite options
plugins: []
},
server: {
preset: "netlify"
}
});
```
Expand All @@ -32,9 +34,40 @@ export default defineConfig({

### Configuring your application

SolidStart is built with [Vite](https://vitejs.dev) and [Nitro](https://nitro.unjs.io). It is little more than a collection of Vite plugins that enable all the functionality that we see here. This is an incredibly powerful approach as we get to leverage Vite's whole ecosystem of plugins to enhance our applications.
SolidStart is built on top of [Vinxi](https://vinxi.vercel.app/) which combines the power of [Vite](https://vitejs.dev) and [Nitro](https://nitro.unjs.io).

The core configuration used by SolidStart is found at `@solidjs/start/config`.

SolidStart supports most vite options, including plugins via the `vite` option:

```tsx
import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
vite: {
// vite options
plugins: []
}
});
```

The `vite` option can also be a function which can be customized for each Vinxi Router. In SolidStart we use 3, `server` for SSR, `client` for the browser, and `server-function` for server functions.

The core configuration used by SolidStart is found at `@solidjs/start/config`. SolidStart uses Nitro which can run on a number of platforms.
```tsx
import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
vite({ router }) {
if (router === "server") {
} else if (router === "client") {
} else if (router === "server-function") {
}
return { plugins: [] };
}
});
```

SolidStart uses Nitro which can run on a number of platforms. The `server` option exposes some Nitro options including deployment presets.

- Node
- Static hosting
Expand All @@ -44,16 +77,14 @@ The core configuration used by SolidStart is found at `@solidjs/start/config`. S
- Cloudflare Workers & Pages
- Deno Deploy

The simplest usage is passing no arguments, which defaults to the Node preset. Some presets may be autodetected by the provider. Otherwise they must added to the configuration via the `start.server.preset` option. For example, this uses Netlify Edge:
The simplest usage is passing no arguments, which defaults to the Node preset. Some presets may be autodetected by the provider. Otherwise they must added to the configuration via the `server.preset` option. For example, this uses Netlify Edge:

```tsx
import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
start: {
server: {
preset: "netlify_edge"
}
server: {
preset: "netlify_edge"
}
});
```
Expand All @@ -66,12 +97,10 @@ SolidStart uses Async Local Storage. Not all non-node platforms support it out o
import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
start: {
server: {
preset: "cloudflare_module",
rollupConfig: {
external: ["__STATIC_CONTENT_MANIFEST", "node:async_hooks"]
}
server: {
preset: "cloudflare_module",
rollupConfig: {
external: ["__STATIC_CONTENT_MANIFEST", "node:async_hooks"]
}
}
});
Expand All @@ -92,5 +121,5 @@ The vite options are same as the default with exception of the `start` property
- `server` (_object_): Nitro server config options
- `appRoot` (_string_, default `"./src"`): Sets the root of the application code.
- `routesDir` (_string_, default `"./routes"`): The path to where the routes are located.
- `ssr` (_boolean_ | "sync" | "async", default `true`): Providing a boolean value will toggle between client rendering and [streaming](https://docs.solidjs.com/references/concepts/ssr/streaming) server rendering (ssr) mode, while "sync" and "async" will render using Solid's [renderToString](https://docs.solidjs.com/references/concepts/ssr/simple-client-fetching-ssr) and [renderToStringAsync](https://docs.solidjs.com/references/concepts/ssr/async-ssr) respectively.
- `ssr` (_boolean_ | "sync" | "async", default `true`): Providing a boolean value will toggle between client rendering and [streaming](https://docs.solidjs.com/references/concepts/ssr/streaming) server rendering (ssr) mode, while "sync" and "async" will render using Solid's [renderToString](https://docs.solidjs.com/references/concepts/ssr/simple-client-fetching-ssr) and [renderToStringAsync](https://docs.solidjs.com/references/concepts/ssr/async-ssr) respectively.
- `islands` (_boolean_, default `false`): _experimental_ toggles on "islands" mode.
4 changes: 2 additions & 2 deletions docs/routes/api/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ vinxi build
vinxi build
```

### Specify a `vite.config` file
### Specify a `app.config` file

```bash
vinxi build --config project/vite.config.ts --root project
vinxi build --config project/app.config.ts --root project
```

## Reference
Expand Down
4 changes: 2 additions & 2 deletions docs/routes/api/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ vinxi dev
vinxi dev --port 3000
```

### Specify a `vite.config` file
### Specify a `app.config` file

```bash
vinxi dev --config project/vite.config.ts --root project
vinxi dev --config project/app.config.ts --root project
```

## Reference
Expand Down
6 changes: 3 additions & 3 deletions docs/routes/api/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ active: true

# vinxi start

##### `vinxi start` starts the production build with a local version of adapter.
##### `vinxi start` starts the production build with a local version of preset.

<div class="text-lg">

Expand All @@ -28,10 +28,10 @@ Remember to run `vinxi build` before running `vinxi start`.
vinxi start --port 3000
```

### Specify a `vite.config` file
### Specify a `app.config` file

```bash
vinxi start --config project/vite.config.ts --root project
vinxi start --config project/app.config.ts --root project
```

## Reference
Expand Down
16 changes: 6 additions & 10 deletions docs/routes/core-concepts/route-prerendering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ pre-rendered to the `routes` option.
import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
start: {
server: {
prerender: {
routes: ["/", "/about"]
}
server: {
prerender: {
routes: ["/", "/about"]
}
}
});
Expand All @@ -29,11 +27,9 @@ But what if we want to pre-render all of our pages?
import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
start: {
server: {
prerender: {
crawlLinks: true
}
server: {
prerender: {
crawlLinks: true
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion docs/routes/getting-started/what-is-solidstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ SolidStart touts the following feature set:
- **Isomorphic, nested routing.** You write the same routes regardless of whether the page is rendered on the client or server. Route nesting provides parent-child relationships that simplify application logic.
- **Multiple rendering modes.** SolidStart can be used to create CSR, SSR, streaming SSR, or SSG applications.
- **Command Line Interface (CLI) and templates.** Get up and running quickly with starters.
- **Deployment adapters.** SolidStart provides adapters to support deployment to your favorite platform&mdash;Netlify, Vercel, AWS, and Cloudflare, to name a few.
- **Deployment presets.** SolidStart provides presets to support deployment to your favorite platform&mdash;Netlify, Vercel, AWS, and Cloudflare, to name a few.

## Prerequisites

Expand Down
4 changes: 2 additions & 2 deletions examples/bare/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ npm run dev -- --open

## Building

Solid apps are built with _adapters_, which optimise your project for deployment to different environments.
Solid apps are built with _presets_, which optimise your project for deployment to different environments.

By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different adapter, add it to the `devDependencies` in `package.json` and specify in your `vite.config.js`.
By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different preset, add it to the `devDependencies` in `package.json` and specify in your `app.config.js`.
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/bare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dependencies": {
"@solidjs/start": "^0.5.10",
"solid-js": "^1.8.15",
"vinxi": "^0.2.1"
"vinxi": "^0.3.4"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions examples/basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ npm run dev -- --open

## Building

Solid apps are built with _adapters_, which optimise your project for deployment to different environments.
Solid apps are built with _presets_, which optimise your project for deployment to different environments.

By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different adapter, add it to the `devDependencies` in `package.json` and specify in your `vite.config.js`.
By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different preset, add it to the `devDependencies` in `package.json` and specify in your `app.config.js`.
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@solidjs/router": "^0.12.4",
"@solidjs/start": "^0.5.10",
"solid-js": "^1.8.15",
"vinxi": "^0.2.1"
"vinxi": "^0.3.4"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions examples/experiments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ npm run dev -- --open

## Building

Solid apps are built with _adapters_, which optimise your project for deployment to different environments.
Solid apps are built with _presets_, which optimise your project for deployment to different environments.

By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different adapter, add it to the `devDependencies` in `package.json` and specify in your `vite.config.js`.
By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different preset, add it to the `devDependencies` in `package.json` and specify in your `app.config.js`.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
ssr: { external: ["@prisma/client"] }
middleware: "./src/middleware.ts"
});
2 changes: 1 addition & 1 deletion examples/experiments/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@solidjs/router": "^0.12.4",
"@solidjs/start": "^0.5.10",
"solid-js": "^1.8.15",
"vinxi": "^0.2.1"
"vinxi": "^0.3.4"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions examples/hackernews/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ npm run dev -- --open

## Building

Solid apps are built with _adapters_, which optimise your project for deployment to different environments.
Solid apps are built with _presets_, which optimise your project for deployment to different environments.

By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different adapter, add it to the `devDependencies` in `package.json` and specify in your `vite.config.js`.
By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different preset, add it to the `devDependencies` in `package.json` and specify in your `app.config.js`.
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@solidjs/router": "^0.12.4",
"@solidjs/start": "^0.5.10",
"solid-js": "^1.8.15",
"vinxi": "^0.2.1"
"vinxi": "^0.3.4"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions examples/notes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ npm run dev -- --open

## Building

Solid apps are built with _adapters_, which optimise your project for deployment to different environments.
Solid apps are built with _presets_, which optimise your project for deployment to different environments.

By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different adapter, add it to the `devDependencies` in `package.json` and specify in your `vite.config.js`.
By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different preset, add it to the `devDependencies` in `package.json` and specify in your `app.config.js`.
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/notes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"solid-js": "^1.8.15",
"marked": "^4.3.0",
"unstorage": "1.10.1",
"vinxi": "^0.2.1"
"vinxi": "^0.3.4"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions examples/todomvc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ npm run dev -- --open

## Building

Solid apps are built with _adapters_, which optimise your project for deployment to different environments.
Solid apps are built with _presets_, which optimise your project for deployment to different environments.

By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different adapter, add it to the `devDependencies` in `package.json` and specify in your `vite.config.js`.
By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different preset, add it to the `devDependencies` in `package.json` and specify in your `app.config.js`.
File renamed without changes.
Loading
Loading