Skip to content

Commit

Permalink
keep all entries as jsx to ensure treated as src
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed Mar 10, 2024
1 parent f13b1c8 commit 67a469f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/rude-wolves-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/start": patch
---

keep all entries as jsx to ensure treated as src
1 change: 1 addition & 0 deletions examples/experiments/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createMiddleware } from "@solidjs/start/middleware";
export default createMiddleware({
onRequest: [
event => {
event.locals.foo = "bar";
console.log("REQUEST", event.request.url);
}
],
Expand Down
4 changes: 3 additions & 1 deletion examples/experiments/src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import { Title } from "@solidjs/meta";
import { json } from "@solidjs/router";
import { clientOnly, GET } from "@solidjs/start";
import { getServerFunctionMeta } from "@solidjs/start/server";
import { getRequestEvent } from "solid-js/web";
import Counter from "~/components/Counter";
const BreaksOnServer = clientOnly(() => import("~/components/BreaksOnServer"));

const hello = GET(async (name: string) => {
"use server";
const e = getRequestEvent()!;
const { id } = getServerFunctionMeta()!;
console.log("ID", id);
console.log("ID", id, e.locals.foo);
return json(
{ hello: new Promise<string>(r => setTimeout(() => r(name), 1000)) },
{ headers: { "cache-control": "max-age=60" } }
Expand Down
2 changes: 1 addition & 1 deletion packages/start/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"exports": {
".": "./dist/index.jsx",
"./config": "./config/index.js",
"./middleware": "./dist/middleware/index.js",
"./middleware": "./dist/middleware/index.jsx",
"./router": "./dist/router/index.jsx",
"./server": "./dist/server/index.jsx",
"./server/spa": "./dist/server/spa/index.jsx",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// @refresh skip
import {
HTTPEvent,
defineMiddleware,
sendWebResponse
} from "vinxi/http";
import { getFetchEvent } from "../server/fetchEvent.js";
import { getFetchEvent } from "../server/fetchEvent";
import type { FetchEvent } from "../server/types";

/** Function responsible for receiving an observable [operation]{@link Operation} and returning a [result]{@link OperationResult}. */
Expand Down

0 comments on commit 67a469f

Please sign in to comment.