Skip to content
Open
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
2 changes: 1 addition & 1 deletion osmium/src/ui/layout/main-navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function DirList(props: { items: SidebarItem[] }) {
<li>
<Collapsible defaultOpen={true}>
<Collapsible.Trigger class="group relative flex w-full justify-between pl-3.5 hover:cursor-pointer dark:text-slate-300">
<span class="font-semibold dark:text-slate-100">
<span class="text-left font-semibold dark:text-slate-100">
{child.title}
</span>
<Icon
Expand Down
15 changes: 5 additions & 10 deletions osmium/src/ui/layout/version-selector.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
import { Popover } from "@kobalte/core/popover";
import { createMemo, createSignal, For, Show } from "solid-js";
import { useRouteConfig } from "../../utils";
import { useSolidBaseRoute } from "@kobalte/solidbase/client";
import {
getSolidBaseRouteFallbackOptions,
SolidBaseRouteOption,
} from "@kobalte/solidbase/config/route";
useSolidBaseRoute,
useSolidBaseRouteFallbackOptions,
} from "@kobalte/solidbase/client";
import type { SolidBaseRouteOption } from "@kobalte/solidbase/config/route";
import { Icon } from "solid-heroicons";
import { chevronUpDown, tag } from "solid-heroicons/solid";

export default function VersionSelector() {
const [open, setOpen] = createSignal(false);

const config = useRouteConfig();

const current = useSolidBaseRoute();
const options = createMemo(() =>
getSolidBaseRouteFallbackOptions(config().routes, "version", current())
);
const options = useSolidBaseRouteFallbackOptions("version");
const currentOption = createMemo(() =>
options().find((option) => option.name === current().version)
);
Expand Down
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ packages:
- "osmium"

catalog:
"@kobalte/solidbase": ^0.6.11
"@kobalte/solidbase": ^0.6.13

allowBuilds:
esbuild: true
Expand Down
22 changes: 21 additions & 1 deletion src/middleware/legacy-routes-redirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,12 @@ const LEGACY_ROUTES = {
"/solid-router/reference/response-helpers/revalidate":
"/solid-router/reference/data-apis/revalidate",

"/solid-start/guides/data-loading": "/solid-start/guides/data-fetching",
"/solid-start/guides/data-loading": "/solid-start/v1/guides/data-fetching",
} as const;

const SOLID_START_PATH = "/solid-start";
const SOLID_START_VERSIONED_ROUTE = /^\/solid-start\/v\d+(?:\/|$)/;

function isLegacyRoute(path: string): path is keyof typeof LEGACY_ROUTES {
return path in LEGACY_ROUTES;
}
Expand All @@ -194,4 +197,21 @@ export const handleLegacyRoutes = (event: FetchEvent) => {
if (isLegacyRoute(pathname)) {
return redirect(LEGACY_ROUTES[pathname], 301);
}

if (pathname === SOLID_START_PATH || pathname === `${SOLID_START_PATH}/`) {
return redirect(
`${SOLID_START_PATH}/v2${pathname.endsWith("/") ? "/" : ""}`,
301
);
}

if (
pathname.startsWith(`${SOLID_START_PATH}/`) &&
!SOLID_START_VERSIONED_ROUTE.test(pathname)
) {
return redirect(
`${SOLID_START_PATH}/v1${pathname.slice(SOLID_START_PATH.length)}`,
301
);
}
};
2 changes: 1 addition & 1 deletion src/routes/(1)quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ solid
```

This command installs and runs [create-solid](https://github.com/solidjs-community/solid-cli/tree/main/packages/create-solid), the official project scaffolding tool for Solid.
The CLI will guide you through a series of prompts, allowing you to choose options such as [starter templates](https://github.com/solidjs/templates), TypeScript support, and whether to include [Solid's full-stack framework, SolidStart](/solid-start):
The CLI will guide you through a series of prompts, allowing you to choose options such as [starter templates](https://github.com/solidjs/templates), TypeScript support, and whether to include [Solid's full-stack framework, SolidStart](/solid-start/v2):

```shell
◆ Project Name
Expand Down
25 changes: 18 additions & 7 deletions src/routes/(2)guides/(1)deployment-options/aws-via-sst.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: AWS via SST
title: AWS via SST (SolidStart v1)
category: Guides / Deployment
order: 1
mainNavExclude: true
Expand All @@ -15,15 +15,19 @@ tags:
- containers
version: "1.0"
description: >-
Deploy SolidStart apps to AWS Lambda or containers using SST framework with
streamlined configuration and deployment.
Deploy SolidStart v1 apps to AWS Lambda or containers using SST framework
with streamlined configuration and deployment.
---

[SST](https://sst.dev/) is a framework for deploying applications to any cloud provider. It has a built-in way to deploy SolidStart apps to AWS Lambda. For additional details, you can [visit their docs](https://sst.dev/docs/).

:::caution[SolidStart v1 only]
SST's built-in `sst.aws.SolidStart` component currently expects `app.config.ts` and the Vinxi output used by SolidStart v1. It is not compatible with SolidStart v2's Vite-based build. For a SolidStart v2 app, see [Deployment plugins](/solid-start/v2/guides/deployment-plugins).
:::

## Quick start

1. [Create a SolidStart app](/solid-start/getting-started).
1. [Create a SolidStart app](/solid-start/v1/getting-started).

2. In your project, init SST.

Expand All @@ -34,9 +38,16 @@ sst@latest init
3. This will detect your SolidStart app and ask you to update your `app.config.ts`.

```ts title="app.config.ts"
server: {
preset: "aws-lambda-streaming";
}
import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
server: {
preset: "aws-lambda",
awsLambda: {
streaming: true,
},
},
});
```

4. When you are ready, you can deploy your app using:
Expand Down
2 changes: 1 addition & 1 deletion src/routes/(2)guides/(5)testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ If using TypeScript, add `@testing-library/jest-dom` to `tsconfig.json#compilerO

#### SolidStart configuration

When using [SolidStart](/solid-start), create a `vitest.config.ts` file:
When using [SolidStart](/solid-start/v2), create a `vitest.config.ts` file:

```ts title="vitest.config.ts"
import solid from "vite-plugin-solid";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ Routing serves as a key component of web applications.
Within SolidStart, there are two types:

- **UI routes** &mdash; define the user interface in your app
- **[API routes](/solid-start/building-your-application/api-routes)** &mdash; define the serverless functions in your app
- **[API routes](/solid-start/v1/building-your-application/api-routes)** &mdash; define the serverless functions in your app

To read more about API routes, [see the API Routes section.](/solid-start/building-your-application/api-routes)
To read more about API routes, [see the API Routes section.](/solid-start/v1/building-your-application/api-routes)

## Creating new routes

SolidStart uses file based routing which is a way of defining your routes by creating files and folders in your project.
This includes your pages and API routes.

SolidStart traverses your `routes` directory, collects all of the routes, and then makes them accessible using the [`<FileRoutes />`](/solid-start/reference/routing/file-routes).
SolidStart traverses your `routes` directory, collects all of the routes, and then makes them accessible using the [`<FileRoutes />`](/solid-start/v1/reference/routing/file-routes).
This component will only include your UI routes, not your API routes.
Rather than manually defining each `Route` inside a `Router` component, `<FileRoutes />` will generate the routes for you based on the file system.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Some reasons for wanting API Routes include:
- Having URLs not serving HTML, but other kinds of documents like PDFs or images.

For these use cases, SolidStart provides a way to write these routes in a way that is easy to understand and maintain.
API routes are just similar to other routes and follow the same filename conventions as [UI Routes](/solid-start/building-your-application/routing).
API routes are just similar to other routes and follow the same filename conventions as [UI Routes](/solid-start/v1/building-your-application/routing).

The difference between API routes and UI routes is in what you should export from the file.
UI routes export a default Solid component, while API Routes do not.
Expand Down Expand Up @@ -123,7 +123,7 @@ export async function GET(event: APIEvent) {
```

In this example, you can see that the `userId` is read from the cookie and then used to look up the user in the store.
For more information on how to use cookies for secure session management, read the [session documentation](/solid-start/advanced/session).
For more information on how to use cookies for secure session management, read the [session documentation](/solid-start/v1/advanced/session).

## Exposing a GraphQL API

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SolidStart builds on these capabilities, extending them to provide a comprehensi

This page assumes you are familiar with the fundamental concepts of Solid and Solid Router.
If you are a beginner, we highly recommend starting with the [queries documentation](/solid-router/data-fetching/queries).
You can also find many practical examples in the [data fetching how-to guide](/solid-start/guides/data-fetching).
You can also find many practical examples in the [data fetching how-to guide](/solid-start/v1/guides/data-fetching).

## Server functions and queries

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SolidStart builds upon the capabilities of actions, extending their scope to pro

This page does not cover the foundational concepts from Solid Router.
If you are a beginner, we highly recommend starting with the [actions documentation](/solid-router/concepts/actions).
You can also find many practical examples in the [data mutation how-to guide](/solid-start/guides/data-mutation).
You can also find many practical examples in the [data mutation how-to guide](/solid-start/v1/guides/data-mutation).

## Server functions and actions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ While middleware is powerful, certain tasks are better handled in other parts of
## Basic usage

Middleware is configured by exporting a configuration object from a dedicated file (e.g., `src/middleware/index.ts`).
This object, created using the [`createMiddleware`](/solid-start/reference/server/create-middleware) function, defines when middleware functions execute throughout the request lifecycle.
This object, created using the [`createMiddleware`](/solid-start/v1/reference/server/create-middleware) function, defines when middleware functions execute throughout the request lifecycle.

```ts title="src/middleware/index.ts"
import { createMiddleware } from "@solidjs/start/middleware";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default defineConfig({
});
```

See the full config reference in [`defineConfig`](/solid-start/reference/config/define-config#serialization).
See the full config reference in [`defineConfig`](/solid-start/v1/reference/config/define-config#serialization).

## Modes

Expand Down Expand Up @@ -74,5 +74,5 @@ Seroval supports additional value types. The compatibility list is broader than

## Related guidance

- Configure modes and defaults in [`defineConfig`](/solid-start/reference/config/define-config#serialization).
- CSP implications and nonce examples live in the [Security guide](/solid-start/guides/security#content-security-policy-csp).
- Configure modes and defaults in [`defineConfig`](/solid-start/v1/reference/config/define-config#serialization).
- CSP implications and nonce examples live in the [Security guide](/solid-start/v1/guides/security#content-security-policy-csp).
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function getPrivatePosts() {
}
```

The `getUser` function can be [implemented using sessions](/solid-start/advanced/session).
The `getUser` function can be [implemented using sessions](/solid-start/v1/advanced/session).

## Protected Routes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ Each directory and file in this structure serves a specific purpose in your Soli
- `src/` - where your Start application code will live.
It is aliased to `~/` for importing in your code.
- `src/routes/` - any files or pages will be located in this directory.
You can learn more about the [`routes` folder in the routing section](/solid-start/building-your-application/routing).
- [`src/entry-client.tsx`](/solid-start/reference/entrypoints/entry-client) - this file is what loads and _hydrates_ the JavaScript for our application on the client side (in browser).
You can learn more about the [`routes` folder in the routing section](/solid-start/v1/building-your-application/routing).
- [`src/entry-client.tsx`](/solid-start/v1/reference/entrypoints/entry-client) - this file is what loads and _hydrates_ the JavaScript for our application on the client side (in browser).
In most cases, you will **not** need to modify this file.
- [`src/entry-server.tsx`](/solid-start/reference/entrypoints/entry-server) - this file will handle requests on the server.
- [`src/entry-server.tsx`](/solid-start/v1/reference/entrypoints/entry-server) - this file will handle requests on the server.
Like `entry-client.tsx`, in most cases you will **not** need to modify this file.
- [`app.tsx`](/solid-start/reference/entrypoints/app) - this is the HTML root of your application both for client and server rendering. You can think of this as the shell inside which your application will be rendered.
- [`app.tsx`](/solid-start/v1/reference/entrypoints/app) - this is the HTML root of your application both for client and server rendering. You can think of this as the shell inside which your application will be rendered.
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ It is highly recommended to read the [Cross Site Scripting Prevention Cheat Shee

## Content Security Policy (CSP)

To configure the `Content-Security-Policy` HTTP header, a [middleware](/solid-start/advanced/middleware) can be used.
To configure the `Content-Security-Policy` HTTP header, a [middleware](/solid-start/v1/advanced/middleware) can be used.

If you enforce a strict CSP, configure SolidStart to use JSON serialization mode to avoid `unsafe-eval` requirements. See [defineConfig serialization](/solid-start/reference/config/define-config#serialization). Note that `unsafe-eval` is only required for `serialization.mode: "js"`.
If you enforce a strict CSP, configure SolidStart to use JSON serialization mode to avoid `unsafe-eval` requirements. See [defineConfig serialization](/solid-start/v1/reference/config/define-config#serialization). Note that `unsafe-eval` is only required for `serialization.mode: "js"`.

### With nonce (recommended)

If you want to use a [strict CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP#strict_csp) with nonces:

1. Create a middleware that configures the CSP header.
It must then be registered using the [`onRequest`](/solid-start/advanced/middleware#onrequest) event.
It must then be registered using the [`onRequest`](/solid-start/v1/advanced/middleware#onrequest) event.
2. Create a nonce using a cryptographic random value generator, such as the [`randomBytes`](https://nodejs.org/api/crypto.html#cryptorandombytessize-callback) function from the `crypto` module.
3. Store the nonce in the [`locals`](/solid-start/advanced/middleware#locals) object.
4. Configure SolidStart to use the nonce in your [`entry-server.tsx`](/solid-start/reference/entrypoints/entry-server) file.
3. Store the nonce in the [`locals`](/solid-start/v1/advanced/middleware#locals) object.
4. Configure SolidStart to use the nonce in your [`entry-server.tsx`](/solid-start/v1/reference/entrypoints/entry-server) file.

```tsx tab title="Middleware"
import { createMiddleware } from "@solidjs/start/middleware";
Expand Down Expand Up @@ -87,7 +87,7 @@ export default createHandler(

### Without nonce

To configure CSP without a nonce, a middleware that sets the CSP header is required, and it should be registered to run during the [`onBeforeResponse`](/solid-start/advanced/middleware#onbeforeresponse) event:
To configure CSP without a nonce, a middleware that sets the CSP header is required, and it should be registered to run during the [`onBeforeResponse`](/solid-start/v1/advanced/middleware#onbeforeresponse) event:

```tsx
import { createMiddleware } from "@solidjs/start/middleware";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export default function Page() {

## Using a database or an ORM

To safely interact with your database or ORM in a query, use a [server function](/solid-start/reference/server/use-server):
To safely interact with your database or ORM in a query, use a [server function](/solid-start/v1/reference/server/use-server):

```tsx tab title="TypeScript" {7-8}
// src/routes/index.tsx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ export default function Page() {

## Using a database or an ORM

To safely interact with your database or ORM in an action, ensure it's server-only by adding [`"use server"`](/solid-start/reference/server/use-server) as the first line of your action:
To safely interact with your database or ORM in an action, ensure it's server-only by adding [`"use server"`](/solid-start/v1/reference/server/use-server) as the first line of your action:

```tsx tab title="TypeScript" {6}
// src/routes/index.tsx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ mount(() => <StartClient />, document.getElementById("app")!);
## Related

- [`hydrate`](/reference/rendering/hydrate)
- [`StartClient`](/solid-start/reference/client/start-client)
- [`StartClient`](/solid-start/v1/reference/client/start-client)
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ mount(() => <StartClient />, document.getElementById("app")!);

## Related

- [`mount`](/solid-start/reference/client/mount)
- [`mount`](/solid-start/v1/reference/client/mount)
Loading
Loading