@solidjs/start 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { type Component } from "solid-js";
2
- export default function lazyRoute<T>(component: any, clientManifest: any, serverManifest: any, exported?: string): Component<T> & {
2
+ export default function lazyRoute<T extends Record<string, any>>(component: any, clientManifest: any, serverManifest: any, exported?: string): Component<T> & {
3
3
  preload: () => Promise<{
4
4
  default: Component<T>;
5
5
  }>;
@@ -38,7 +38,7 @@ const router = createRouter({
38
38
  routes: fileRoutes.reduce((memo, route) => {
39
39
  if (!containsHTTP(route))
40
40
  return memo;
41
- let path = route.path.replace(/\/\([^)/]+\)/g, "").replace(/\([^)/]+\)/g, "").replace(/\*([^/]*)/g, (_, m) => `**:${m}`);
41
+ let path = route.path.replace(/\/\([^)/]+\)/g, "").replace(/\([^)/]+\)/g, "").replace(/\*([^/]*)/g, (_, m) => `**:${m}`).split('/').map(s => (s.startsWith(':') || s.startsWith('*')) ? s : encodeURIComponent(s)).join('/');
42
42
  if (/:[^/]*\?/g.test(path)) {
43
43
  throw new Error(`Optional parameters are not supported in API routes: ${path}`);
44
44
  }
@@ -41,10 +41,11 @@ export function StartServer(props) {
41
41
  matches.shift();
42
42
  const matched = matches.length && matchRoute(matches, context.routes);
43
43
  if (matched) {
44
+ const inputs = import.meta.env.MANIFEST[import.meta.env.START_ISLANDS ? "ssr" : "client"]
45
+ .inputs;
44
46
  for (let i = 0; i < matched.length; i++) {
45
47
  const segment = matched[i];
46
- const part = import.meta.env.MANIFEST[import.meta.env.START_ISLANDS ? "ssr" : "client"]
47
- .inputs[segment["$component"].src];
48
+ const part = inputs[segment["$component"].src];
48
49
  assetPromises.push(part.assets());
49
50
  }
50
51
  }
@@ -1,5 +1,5 @@
1
1
  import { appendResponseHeader, getRequestIP, getResponseHeader, getResponseHeaders, getResponseStatus, getResponseStatusText, getWebRequest, removeResponseHeader, setResponseHeader, setResponseStatus } from "vinxi/http";
2
- const fetchEventSymbol = Symbol("fetchEvent");
2
+ const fetchEventContext = "solidFetchEvent";
3
3
  export function createFetchEvent(event) {
4
4
  return {
5
5
  request: getWebRequest(event),
@@ -15,11 +15,11 @@ export function cloneEvent(fetchEvent) {
15
15
  };
16
16
  }
17
17
  export function getFetchEvent(h3Event) {
18
- if (!h3Event[fetchEventSymbol]) {
18
+ if (!h3Event.context[fetchEventContext]) {
19
19
  const fetchEvent = createFetchEvent(h3Event);
20
- h3Event[fetchEventSymbol] = fetchEvent;
20
+ h3Event.context[fetchEventContext] = fetchEvent;
21
21
  }
22
- return h3Event[fetchEventSymbol];
22
+ return h3Event.context[fetchEventContext];
23
23
  }
24
24
  export function mergeResponseHeaders(h3Event, headers) {
25
25
  for (const [key, value] of headers.entries()) {
@@ -1,8 +1,8 @@
1
1
  // @refresh skip
2
- import { ErrorBoundary as DefaultErrorBoundary, catchError } from "solid-js";
2
+ import { ErrorBoundary as DefaultErrorBoundary, catchError, lazy } from "solid-js";
3
3
  import { isServer } from "solid-js/web";
4
4
  import { HttpStatusCode } from "./HttpStatusCode";
5
- import { DevOverlay } from "./dev-overlay";
5
+ const DevOverlay = lazy(() => import("./dev-overlay"));
6
6
  export const ErrorBoundary = import.meta.env.DEV && import.meta.env.START_DEV_OVERLAY
7
7
  ? (props) => <DevOverlay>{props.children}</DevOverlay>
8
8
  : (props) => {
@@ -2,4 +2,4 @@ import { type JSX } from "solid-js";
2
2
  export interface DevOverlayProps {
3
3
  children?: JSX.Element;
4
4
  }
5
- export declare function DevOverlay(props: DevOverlayProps): JSX.Element;
5
+ export default function DevOverlay(props: DevOverlayProps): JSX.Element;
@@ -8,7 +8,7 @@ const DevOverlayDialog =
8
8
  return <></>;
9
9
  }
10
10
  : /* #__PURE__ */ clientOnly(() => import("./DevOverlayDialog"));
11
- export function DevOverlay(props) {
11
+ export default function DevOverlay(props) {
12
12
  const [errors, setErrors] = createSignal([]);
13
13
  function resetError() {
14
14
  setErrors([]);
package/env.d.ts CHANGED
@@ -13,8 +13,8 @@ interface ImportMetaEnv extends Record<`VITE_${string}`, any>, SolidStartMetaEnv
13
13
  }
14
14
 
15
15
  interface SolidStartMetaEnv {
16
- START_SSR: string;
17
- START_ISLANDS: string;
18
- START_DEV_OVERLAY: string;
16
+ START_SSR: boolean;
17
+ START_ISLANDS: boolean;
18
+ START_DEV_OVERLAY: boolean;
19
19
  SERVER_BASE_URL: string;
20
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidjs/start",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "type": "module",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
@@ -55,14 +55,14 @@
55
55
  }
56
56
  },
57
57
  "devDependencies": {
58
- "solid-js": "^1.8.18",
59
- "vinxi": "^0.4.0",
58
+ "solid-js": "^1.9.1",
59
+ "vinxi": "^0.4.3",
60
60
  "typescript": "^5.4.2"
61
61
  },
62
62
  "dependencies": {
63
- "@vinxi/plugin-directives": "^0.4.1",
64
- "@vinxi/server-components": "^0.4.1",
65
- "@vinxi/server-functions": "^0.4.1",
63
+ "@vinxi/plugin-directives": "^0.4.3",
64
+ "@vinxi/server-components": "^0.4.3",
65
+ "@vinxi/server-functions": "^0.4.3",
66
66
  "defu": "^6.1.2",
67
67
  "error-stack-parser": "^2.1.4",
68
68
  "glob": "^10.3.10",
@@ -73,7 +73,6 @@
73
73
  "shikiji": "^0.9.12",
74
74
  "source-map-js": "^1.0.2",
75
75
  "terracotta": "^1.0.4",
76
- "vite-plugin-inspect": "^0.7.33",
77
76
  "vite-plugin-solid": "^2.10.2"
78
77
  },
79
78
  "scripts": {