Skip to content

Commit

Permalink
Merge branch 'main' into fix-middleware-wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid authored Jul 23, 2024
2 parents e93153b + 65c8ac0 commit 0676725
Show file tree
Hide file tree
Showing 23 changed files with 123 additions and 111 deletions.
5 changes: 5 additions & 0 deletions .changeset/quiet-mirrors-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/start": patch
---

Fixed fetchEvent flakyness by storing the event in h3 context.
4 changes: 2 additions & 2 deletions examples/bare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"start": "vinxi start"
},
"dependencies": {
"@solidjs/start": "^1.0.5",
"@solidjs/start": "^1.0.6",
"solid-js": "^1.8.18",
"vinxi": "^0.4.0"
"vinxi": "^0.4.1"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"dependencies": {
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.14.1",
"@solidjs/start": "^1.0.5",
"@solidjs/start": "^1.0.6",
"solid-js": "^1.8.18",
"vinxi": "^0.4.0"
"vinxi": "^0.4.1"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions examples/experiments/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"dependencies": {
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.14.1",
"@solidjs/start": "^1.0.5",
"@solidjs/start": "^1.0.6",
"solid-js": "^1.8.18",
"vinxi": "^0.4.0"
"vinxi": "^0.4.1"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
},
"dependencies": {
"@solidjs/router": "^0.14.1",
"@solidjs/start": "^1.0.5",
"@solidjs/start": "^1.0.6",
"solid-js": "^1.8.18",
"vinxi": "^0.4.0"
"vinxi": "^0.4.1"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions examples/notes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
},
"dependencies": {
"@solidjs/router": "^0.14.1",
"@solidjs/start": "^1.0.5",
"@solidjs/start": "^1.0.6",
"date-fns": "^3.6.0",
"solid-js": "^1.8.18",
"marked": "^12.0.1",
"unstorage": "1.10.2",
"vinxi": "^0.4.0"
"vinxi": "^0.4.1"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions examples/todomvc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
},
"dependencies": {
"@solidjs/router": "^0.14.1",
"@solidjs/start": "^1.0.5",
"@solidjs/start": "^1.0.6",
"solid-js": "^1.8.18",
"unstorage": "1.10.2",
"vinxi": "^0.4.0"
"vinxi": "^0.4.1"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions examples/with-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
},
"dependencies": {
"@solidjs/router": "^0.14.1",
"@solidjs/start": "^1.0.5",
"@solidjs/start": "^1.0.6",
"solid-js": "^1.8.18",
"unstorage": "1.10.2",
"vinxi": "^0.4.0"
"vinxi": "^0.4.1"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions examples/with-authjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"@solid-mediakit/auth": "^2.0.11",
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.14.1",
"@solidjs/start": "^1.0.5",
"@solidjs/start": "^1.0.6",
"solid-js": "^1.8.18",
"vinxi": "^0.4.0"
"vinxi": "^0.4.1"
},
"engines": {
"node": ">=18"
Expand Down
2 changes: 1 addition & 1 deletion examples/with-drizzle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"better-sqlite3": "^11.0.0",
"drizzle-orm": "^0.31.2",
"solid-js": "^1.8.18",
"vinxi": "^0.4.0"
"vinxi": "^0.4.1"
},
"engines": {
"node": ">=20"
Expand Down
4 changes: 2 additions & 2 deletions examples/with-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"dependencies": {
"@mdx-js/mdx": "^2.3.0",
"@solidjs/router": "^0.14.1",
"@solidjs/start": "^1.0.5",
"@solidjs/start": "^1.0.6",
"@vinxi/plugin-mdx": "^3.7.1",
"solid-js": "^1.8.18",
"vinxi": "^0.4.0",
"vinxi": "^0.4.1",
"solid-mdx": "^0.0.7"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions examples/with-prisma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"dependencies": {
"@prisma/client": "^5.12.1",
"@solidjs/router": "^0.14.1",
"@solidjs/start": "^1.0.5",
"@solidjs/start": "^1.0.6",
"prisma": "^5.12.1",
"solid-js": "^1.8.18",
"vinxi": "^0.4.0"
"vinxi": "^0.4.1"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions examples/with-solid-styled/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"dependencies": {
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.14.1",
"@solidjs/start": "^1.0.5",
"@solidjs/start": "^1.0.6",
"solid-js": "^1.8.18",
"solid-styled": "^0.11.1",
"vinxi": "^0.4.0",
"vinxi": "^0.4.1",
"vite-plugin-solid-styled": "^0.11.1"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions examples/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
},
"dependencies": {
"@solidjs/router": "^0.14.1",
"@solidjs/start": "^1.0.5",
"@solidjs/start": "^1.0.6",
"autoprefixer": "^10.4.19",
"postcss": "^8.4.38",
"solid-js": "^1.8.18",
"tailwindcss": "^3.4.3",
"vinxi": "^0.4.0"
"vinxi": "^0.4.1"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions examples/with-trpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"dependencies": {
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.14.1",
"@solidjs/start": "^1.0.5",
"@solidjs/start": "^1.0.6",
"@trpc/client": "^10.45.2",
"@trpc/server": "^10.45.2",
"@typeschema/valibot": "^0.13.4",
"solid-js": "^1.8.18",
"valibot": "^0.29.0",
"vinxi": "^0.4.0"
"vinxi": "^0.4.1"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions examples/with-unocss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
},
"dependencies": {
"@solidjs/router": "^0.14.1",
"@solidjs/start": "^1.0.5",
"@solidjs/start": "^1.0.6",
"@unocss/reset": "^0.59.2",
"solid-js": "^1.8.18",
"unocss": "^0.59.2",
"vinxi": "^0.4.0"
"vinxi": "^0.4.1"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions examples/with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
"devDependencies": {
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.14.1",
"@solidjs/start": "^1.0.5",
"@solidjs/start": "^1.0.6",
"@solidjs/testing-library": "^0.8.7",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/user-event": "^14.5.2",
"@vitest/ui": "^1.5.0",
"jsdom": "^24.0.0",
"solid-js": "^1.8.18",
"typescript": "^5.4.5",
"vinxi": "^0.4.0",
"vinxi": "^0.4.1",
"vite": "^5.2.8",
"vite-plugin-solid": "^2.10.2",
"vitest": "^1.5.0"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"turbo": "^1.10.7",
"typescript": "5.3.3",
"valibot": "~0.29.0",
"vinxi": "^0.4.0",
"vinxi": "^0.4.1",
"vite": "^5.1.1"
},
"dependencies": {
Expand Down
6 changes: 6 additions & 0 deletions packages/start/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @solidjs/start

## 1.0.6

### Patch Changes

- d86ab61: drastically improve asset resolution performance

## 1.0.5

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/start/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@solidjs/start",
"version": "1.0.5",
"version": "1.0.6",
"type": "module",
"author": "Ryan Carniato",
"license": "MIT",
Expand Down Expand Up @@ -60,7 +60,7 @@
},
"devDependencies": {
"solid-js": "^1.8.18",
"vinxi": "^0.4.0",
"vinxi": "^0.4.1",
"typescript": "^5.4.2"
},
"dependencies": {
Expand Down
5 changes: 3 additions & 2 deletions packages/start/src/server/StartServer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ export function StartServer(props: { document: Component<DocumentComponentProps>
while (matches.length && (!matches[0].info || !matches[0].info.filesystem)) matches.shift();
const matched = matches.length && matchRoute(matches, context.routes);
if (matched) {
const inputs = import.meta.env.MANIFEST[import.meta.env.START_ISLANDS ? "ssr" : "client"]!
.inputs
for (let i = 0; i < matched.length; i++) {
const segment = matched[i];
const part = import.meta.env.MANIFEST[import.meta.env.START_ISLANDS ? "ssr" : "client"]!
.inputs[segment["$component"].src]!;
const part = inputs[segment["$component"].src]!;
assetPromises.push(part.assets() as any);
}
} else if (import.meta.env.DEV) console.warn("No route matched for preloading js assets");
Expand Down
8 changes: 4 additions & 4 deletions packages/start/src/server/fetchEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "vinxi/http";
import type { FetchEvent, ResponseStub } from "./types";

const fetchEventSymbol = Symbol("fetchEvent");
const fetchEventContext = "solidFetchEvent";

export function createFetchEvent(event: H3Event): FetchEvent {
return {
Expand All @@ -32,12 +32,12 @@ export function cloneEvent<T extends FetchEvent>(fetchEvent: T): T {
}

export function getFetchEvent(h3Event: H3Event): FetchEvent {
if (!(h3Event as any)[fetchEventSymbol]) {
if (!h3Event.context[fetchEventContext]) {
const fetchEvent = createFetchEvent(h3Event);
(h3Event as any)[fetchEventSymbol] = fetchEvent;
h3Event.context[fetchEventContext] = fetchEvent;
}

return (h3Event as any)[fetchEventSymbol];
return h3Event.context[fetchEventContext];
}

export function mergeResponseHeaders(h3Event: H3Event, headers: Headers) {
Expand Down
Loading

0 comments on commit 0676725

Please sign in to comment.