@solidjs/vite-plugin 3.0.0-next.28 → 3.0.0-next.30
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.
- package/LICENSE +21 -0
- package/README.md +56 -1
- package/dist/cjs/index.cjs +123 -14
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +123 -14
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/src/http.d.ts +8 -1
- package/dist/types/src/ssr/index.d.ts +5 -0
- package/package.json +2 -2
- package/virtual-solid-manifest.d.ts +21 -1
package/dist/types/src/http.d.ts
CHANGED
|
@@ -4,7 +4,14 @@ import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
|
4
4
|
* different URL than the one node saw — the dev middlewares use it to
|
|
5
5
|
* restore the configured Vite `base` that the dev/preview base middleware
|
|
6
6
|
* stripped, so the handler always sees production-shaped URLs.
|
|
7
|
+
*
|
|
8
|
+
* Handles plain HTTP/1 *and* the HTTP/2 compat API: Vite's dev server uses
|
|
9
|
+
* `http2.createSecureServer({ allowHTTP1: true })` whenever `server.https`
|
|
10
|
+
* is set without a proxy, so under https the middlewares receive
|
|
11
|
+
* `Http2ServerRequest`s. The h2/protocol/abort techniques here are
|
|
12
|
+
* reimplemented from srvx's Node adapter (github.com/h3js/srvx,
|
|
13
|
+
* src/adapters/_node) — reference, not copied code.
|
|
7
14
|
*/
|
|
8
|
-
export declare function webRequestFromNode(req: IncomingMessage, urlPath?: string): Request;
|
|
15
|
+
export declare function webRequestFromNode(req: IncomingMessage, urlPath?: string, res?: ServerResponse): Request;
|
|
9
16
|
export declare function sendWebResponse(res: ServerResponse, response: Response): Promise<void>;
|
|
10
17
|
export declare function joinBase(base: string, pathname: string): string;
|
|
@@ -119,6 +119,11 @@ export interface StartOptions {
|
|
|
119
119
|
* only), so platform-injected vars work and secrets rotate without a
|
|
120
120
|
* rebuild — no secret exists in any dist artifact. Build-time server
|
|
121
121
|
* failures are a deferred-to-boot warning; dev failures stay hard.
|
|
122
|
+
* Boot validation is synchronous — the generated module carries no
|
|
123
|
+
* top-level await, so server bundles work on non-esnext targets
|
|
124
|
+
* (Nitro's node-server preset needs no `esnext` override) — which is
|
|
125
|
+
* why async validators are rejected for `server` keys at config time
|
|
126
|
+
* (`client` keys may stay async: they are awaited at build time).
|
|
122
127
|
*
|
|
123
128
|
* `true` requires the conventional file (error when missing); a string
|
|
124
129
|
* is an explicit schema path; `false` disables even the probing.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/vite-plugin",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.30",
|
|
4
4
|
"description": "solid-js integration plugin for vite 6/7/8",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@ampproject/remapping": "^2.3.0",
|
|
52
52
|
"@babel/core": "^7.23.3",
|
|
53
|
-
"@dom-expressions/compiler": "0.50.0-next.
|
|
53
|
+
"@dom-expressions/compiler": "^0.50.0-next.43",
|
|
54
54
|
"@types/babel__core": "^7.20.4",
|
|
55
55
|
"babel-preset-solid": "^2.0.0-rc.0",
|
|
56
56
|
"merge-anything": "^5.1.7",
|
|
@@ -17,7 +17,17 @@ declare module "virtual:solid-server-function-handler" {
|
|
|
17
17
|
export const endpoint: string;
|
|
18
18
|
export function handleServerFunctionRequest(
|
|
19
19
|
request: Request,
|
|
20
|
-
options?:
|
|
20
|
+
options?: {
|
|
21
|
+
/**
|
|
22
|
+
* Extra fields spread into the request event at creation — the public
|
|
23
|
+
* wrapper→event extension seam, same as the SSR handler's
|
|
24
|
+
* `handleRequest`. Conventionally `nativeEvent` carries the platform's
|
|
25
|
+
* raw request object (the plugin's dev middleware and a Node server
|
|
26
|
+
* entry pass the Node `IncomingMessage`); read it back with
|
|
27
|
+
* `getRequestEvent()`.
|
|
28
|
+
*/
|
|
29
|
+
event?: Record<string, unknown>;
|
|
30
|
+
} & Record<string, unknown>,
|
|
21
31
|
): Promise<Response>;
|
|
22
32
|
}
|
|
23
33
|
|
|
@@ -39,6 +49,16 @@ declare module "virtual:solid-ssr-handler" {
|
|
|
39
49
|
context?: Record<string, unknown>;
|
|
40
50
|
/** Status/headers for the HTML response. */
|
|
41
51
|
responseInit?: ResponseInit;
|
|
52
|
+
/**
|
|
53
|
+
* Extra fields spread into the request event at creation — the public
|
|
54
|
+
* wrapper→event extension seam. Conventionally `nativeEvent` carries
|
|
55
|
+
* the platform's raw request object; the plugin's dev/preview
|
|
56
|
+
* middlewares (and, by convention, a custom Node server entry) pass
|
|
57
|
+
* the Node `IncomingMessage` here, so `getRequestEvent().nativeEvent`
|
|
58
|
+
* answers the same on every surface. Read it back anywhere inside the
|
|
59
|
+
* request scope with `getRequestEvent()`.
|
|
60
|
+
*/
|
|
61
|
+
event?: Record<string, unknown>;
|
|
42
62
|
/** Options forwarded to the server-function handler for endpoint requests. */
|
|
43
63
|
serverFunctions?: Record<string, unknown>;
|
|
44
64
|
},
|