@solidjs/start 2.0.0-beta.1 → 2.0.0-beta.2
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/CHANGELOG.md +7 -0
- package/dist/client/StartClient.d.ts +7 -0
- package/{src/client/StartClient.tsx → dist/client/StartClient.jsx} +7 -15
- package/dist/client/index.jsx +2 -0
- package/dist/client/mount.d.ts +1 -0
- package/dist/client/mount.js +1 -0
- package/dist/client/spa/index.d.ts +4 -0
- package/dist/client/spa/index.jsx +5 -0
- package/dist/config/constants.d.ts +16 -0
- package/dist/config/constants.js +16 -0
- package/dist/config/dev-server.d.ts +2 -0
- package/dist/config/dev-server.js +128 -0
- package/dist/config/env.d.ts +19 -0
- package/dist/config/env.js +81 -0
- package/dist/config/fs-router.d.ts +37 -0
- package/dist/config/fs-router.js +141 -0
- package/dist/config/fs-routes/fs-watcher.d.ts +3 -0
- package/dist/config/fs-routes/fs-watcher.js +53 -0
- package/dist/config/fs-routes/index.d.ts +7 -0
- package/dist/config/fs-routes/index.js +107 -0
- package/dist/config/fs-routes/router.d.ts +42 -0
- package/dist/config/fs-routes/router.js +148 -0
- package/dist/config/fs-routes/tree-shake.d.ts +2 -0
- package/dist/config/fs-routes/tree-shake.js +305 -0
- package/dist/config/index.d.ts +25 -0
- package/dist/config/index.js +217 -0
- package/dist/config/lazy.d.ts +3 -0
- package/dist/config/lazy.js +114 -0
- package/dist/config/manifest.d.ts +3 -0
- package/dist/config/manifest.js +109 -0
- package/dist/config/utils.d.ts +4 -0
- package/dist/config/utils.js +6 -0
- package/dist/config/vite-utils.d.ts +21 -0
- package/dist/config/vite-utils.js +85 -0
- package/dist/directives/bubble-function-declaration.d.ts +3 -0
- package/dist/directives/bubble-function-declaration.js +23 -0
- package/dist/directives/compile.d.ts +9 -0
- package/dist/directives/compile.js +40 -0
- package/dist/directives/generate-unique-name.d.ts +3 -0
- package/dist/directives/generate-unique-name.js +16 -0
- package/dist/directives/get-descriptive-name.d.ts +2 -0
- package/dist/directives/get-descriptive-name.js +37 -0
- package/dist/directives/get-import-identifier.d.ts +4 -0
- package/dist/directives/get-import-identifier.js +19 -0
- package/dist/directives/get-root-statement-path.d.ts +2 -0
- package/dist/directives/get-root-statement-path.js +12 -0
- package/dist/directives/index.d.ts +14 -0
- package/dist/directives/index.js +170 -0
- package/dist/directives/is-statement-top-level.d.ts +3 -0
- package/dist/directives/is-statement-top-level.js +9 -0
- package/dist/directives/paths.d.ts +9 -0
- package/dist/directives/paths.js +36 -0
- package/dist/directives/plugin.d.ts +21 -0
- package/dist/directives/plugin.js +302 -0
- package/dist/directives/remove-unused-variables.d.ts +3 -0
- package/dist/directives/remove-unused-variables.js +66 -0
- package/{src/directives/types.ts → dist/directives/types.d.ts} +5 -7
- package/dist/directives/types.js +1 -0
- package/dist/directives/xxhash32.d.ts +6 -0
- package/dist/directives/xxhash32.js +193 -0
- package/dist/fns/client.d.ts +3 -0
- package/dist/fns/client.js +106 -0
- package/dist/fns/handler.d.ts +5 -0
- package/dist/fns/handler.js +269 -0
- package/dist/fns/registration.d.ts +2 -0
- package/dist/fns/registration.js +12 -0
- package/dist/fns/serialization.d.ts +6 -0
- package/dist/fns/serialization.js +208 -0
- package/dist/fns/server.d.ts +7 -0
- package/dist/fns/server.js +38 -0
- package/dist/fns/shared.d.ts +17 -0
- package/dist/fns/shared.js +105 -0
- package/dist/http/index.d.ts +81 -0
- package/dist/http/index.js +129 -0
- package/{src/index.tsx → dist/index.d.ts} +0 -2
- package/dist/index.jsx +6 -0
- package/dist/middleware/index.d.ts +38 -0
- package/dist/middleware/index.js +59 -0
- package/dist/router.d.ts +6 -0
- package/dist/router.jsx +29 -0
- package/dist/server/StartServer.d.ts +9 -0
- package/dist/server/StartServer.jsx +34 -0
- package/dist/server/assets/PatchVirtualDevStyles.d.ts +4 -0
- package/{src/server/assets/PatchVirtualDevStyles.tsx → dist/server/assets/PatchVirtualDevStyles.jsx} +7 -10
- package/dist/server/assets/index.d.ts +2 -0
- package/dist/server/assets/index.js +52 -0
- package/dist/server/assets/render.d.ts +19 -0
- package/dist/server/assets/render.jsx +14 -0
- package/dist/server/collect-styles.d.ts +3 -0
- package/dist/server/collect-styles.js +57 -0
- package/dist/server/fetchEvent.d.ts +7 -0
- package/dist/server/fetchEvent.js +26 -0
- package/dist/server/handler.d.ts +64 -0
- package/dist/server/handler.js +222 -0
- package/dist/server/index.d.ts +9 -0
- package/{src/server/index.tsx → dist/server/index.jsx} +4 -19
- package/dist/server/manifest/client-manifest.d.ts +9 -0
- package/dist/server/manifest/client-manifest.js +6 -0
- package/dist/server/manifest/dev-client-manifest.d.ts +4 -0
- package/dist/server/manifest/dev-client-manifest.js +24 -0
- package/dist/server/manifest/dev-ssr-manifest.d.ts +5 -0
- package/dist/server/manifest/dev-ssr-manifest.js +23 -0
- package/dist/server/manifest/prod-client-manifest.d.ts +5 -0
- package/dist/server/manifest/prod-client-manifest.js +26 -0
- package/dist/server/manifest/prod-ssr-manifest.d.ts +6 -0
- package/dist/server/manifest/prod-ssr-manifest.js +85 -0
- package/dist/server/manifest/ssr-manifest.d.ts +4 -0
- package/dist/server/manifest/ssr-manifest.js +6 -0
- package/dist/server/routes.d.ts +23 -0
- package/dist/server/routes.js +74 -0
- package/dist/server/spa/StartServer.d.ts +9 -0
- package/dist/server/spa/StartServer.jsx +25 -0
- package/dist/server/spa/handler.d.ts +36 -0
- package/dist/server/spa/handler.js +20 -0
- package/{src/server/spa/index.tsx → dist/server/spa/index.d.ts} +0 -1
- package/dist/server/spa/index.jsx +5 -0
- package/dist/server/types.d.ts +75 -0
- package/dist/server/types.js +1 -0
- package/dist/server/util.d.ts +2 -0
- package/dist/server/util.js +8 -0
- package/dist/shared/ErrorBoundary.d.ts +3 -0
- package/dist/shared/ErrorBoundary.jsx +36 -0
- package/dist/shared/GET.d.ts +5 -0
- package/dist/shared/GET.js +8 -0
- package/dist/shared/HttpHeader.d.ts +10 -0
- package/dist/shared/HttpHeader.jsx +38 -0
- package/dist/shared/HttpStatusCode.d.ts +9 -0
- package/dist/shared/HttpStatusCode.js +18 -0
- package/dist/shared/clientOnly.d.ts +12 -0
- package/dist/shared/clientOnly.js +27 -0
- package/dist/shared/dev-overlay/CodeView.d.ts +7 -0
- package/dist/shared/dev-overlay/CodeView.jsx +62 -0
- package/dist/shared/dev-overlay/DevOverlayDialog.d.ts +9 -0
- package/dist/shared/dev-overlay/DevOverlayDialog.jsx +226 -0
- package/dist/shared/dev-overlay/createStackFrame.d.ts +9 -0
- package/dist/shared/dev-overlay/createStackFrame.js +56 -0
- package/dist/shared/dev-overlay/download.d.ts +1 -0
- package/dist/shared/dev-overlay/download.js +6 -0
- package/dist/shared/dev-overlay/get-source-map.d.ts +2 -0
- package/dist/shared/dev-overlay/get-source-map.js +25 -0
- package/dist/shared/dev-overlay/icons.d.ts +28 -0
- package/dist/shared/dev-overlay/icons.jsx +150 -0
- package/dist/shared/dev-overlay/index.d.ts +5 -0
- package/dist/shared/dev-overlay/index.jsx +39 -0
- package/dist/shared/lazy.d.ts +3 -0
- package/dist/shared/lazy.js +42 -0
- package/dist/shared/serverFunction.d.ts +6 -0
- package/dist/shared/serverFunction.js +8 -0
- package/dist/utils/debounce.d.ts +4 -0
- package/dist/utils/debounce.js +10 -0
- package/package.json +7 -2
- package/scripts/build.js +0 -15
- package/scripts/validate-imports.js +0 -316
- package/src/client/mount.ts +0 -1
- package/src/client/spa/index.tsx +0 -9
- package/src/config/constants.ts +0 -19
- package/src/config/dev-server.ts +0 -161
- package/src/config/env.ts +0 -105
- package/src/config/fs-router.ts +0 -162
- package/src/config/fs-routes/fs-watcher.ts +0 -66
- package/src/config/fs-routes/index.ts +0 -136
- package/src/config/fs-routes/router.ts +0 -184
- package/src/config/fs-routes/tree-shake.ts +0 -324
- package/src/config/index.ts +0 -239
- package/src/config/lazy.ts +0 -132
- package/src/config/manifest.ts +0 -120
- package/src/config/utils.ts +0 -5
- package/src/config/vite-utils.ts +0 -113
- package/src/directives/bubble-function-declaration.ts +0 -33
- package/src/directives/compile.ts +0 -54
- package/src/directives/generate-unique-name.ts +0 -22
- package/src/directives/get-descriptive-name.ts +0 -39
- package/src/directives/get-import-identifier.ts +0 -34
- package/src/directives/get-root-statement-path.ts +0 -14
- package/src/directives/index.ts +0 -233
- package/src/directives/is-statement-top-level.ts +0 -13
- package/src/directives/paths.ts +0 -63
- package/src/directives/plugin.ts +0 -389
- package/src/directives/remove-unused-variables.ts +0 -70
- package/src/directives/xxhash32.ts +0 -214
- package/src/env.d.ts +0 -17
- package/src/fns/client.ts +0 -141
- package/src/fns/handler.spec.ts +0 -85
- package/src/fns/handler.ts +0 -287
- package/src/fns/registration.ts +0 -19
- package/src/fns/serialization.ts +0 -250
- package/src/fns/server.ts +0 -46
- package/src/fns/shared.ts +0 -116
- package/src/http/index.ts +0 -216
- package/src/internal.d.ts +0 -14
- package/src/middleware/index.ts +0 -92
- package/src/router.tsx +0 -37
- package/src/server/StartServer.tsx +0 -58
- package/src/server/assets/index.ts +0 -70
- package/src/server/assets/render.tsx +0 -46
- package/src/server/collect-styles.ts +0 -70
- package/src/server/fetchEvent.spec.ts +0 -85
- package/src/server/fetchEvent.ts +0 -36
- package/src/server/handler.ts +0 -261
- package/src/server/manifest/client-manifest.ts +0 -8
- package/src/server/manifest/dev-client-manifest.ts +0 -21
- package/src/server/manifest/dev-ssr-manifest.ts +0 -23
- package/src/server/manifest/prod-client-manifest.ts +0 -21
- package/src/server/manifest/prod-ssr-manifest.ts +0 -109
- package/src/server/manifest/ssr-manifest.ts +0 -10
- package/src/server/routes.ts +0 -126
- package/src/server/spa/StartServer.tsx +0 -42
- package/src/server/spa/handler.ts +0 -29
- package/src/server/types.ts +0 -82
- package/src/server/util.ts +0 -12
- package/src/shared/ErrorBoundary.tsx +0 -52
- package/src/shared/GET.ts +0 -8
- package/src/shared/HttpHeader.tsx +0 -42
- package/src/shared/HttpStatusCode.ts +0 -27
- package/src/shared/clientOnly.ts +0 -44
- package/src/shared/dev-overlay/CodeView.tsx +0 -90
- package/src/shared/dev-overlay/DevOverlayDialog.tsx +0 -316
- package/src/shared/dev-overlay/createStackFrame.ts +0 -74
- package/src/shared/dev-overlay/download.ts +0 -6
- package/src/shared/dev-overlay/env.d.ts +0 -4
- package/src/shared/dev-overlay/get-source-map.ts +0 -33
- package/src/shared/dev-overlay/icons.tsx +0 -456
- package/src/shared/dev-overlay/index.tsx +0 -63
- package/src/shared/lazy.ts +0 -52
- package/src/shared/serverFunction.ts +0 -10
- package/src/utils/debounce.ts +0 -10
- package/src/virtual.d.ts +0 -27
- package/tsconfig.json +0 -24
- package/vitest.config.ts +0 -9
- /package/{src/client/index.tsx → dist/client/index.d.ts} +0 -0
- /package/{src → dist}/shared/dev-overlay/styles.css +0 -0
package/src/config/index.ts
DELETED
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
import { defu } from "defu";
|
|
2
|
-
import { globSync } from "node:fs";
|
|
3
|
-
import { extname, isAbsolute, join } from "node:path";
|
|
4
|
-
import type { PluginOption } from "vite";
|
|
5
|
-
import solid, { type Options as SolidOptions } from "vite-plugin-solid";
|
|
6
|
-
import { type ServerFunctionsOptions, serverFunctionsPlugin } from "../directives/index.ts";
|
|
7
|
-
import { DEFAULT_EXTENSIONS, VIRTUAL_MODULES, VITE_ENVIRONMENTS } from "./constants.ts";
|
|
8
|
-
import { devServer } from "./dev-server.ts";
|
|
9
|
-
import { envPlugin, type EnvPluginOptions } from "./env.ts";
|
|
10
|
-
import { SolidStartClientFileRouter, SolidStartServerFileRouter } from "./fs-router.ts";
|
|
11
|
-
import { fsRoutes } from "./fs-routes/index.ts";
|
|
12
|
-
import type { BaseFileSystemRouter } from "./fs-routes/router.ts";
|
|
13
|
-
import lazy from "./lazy.ts";
|
|
14
|
-
import { manifest } from "./manifest.ts";
|
|
15
|
-
import { parseIdQuery } from "./utils.ts";
|
|
16
|
-
|
|
17
|
-
export interface SolidStartOptions {
|
|
18
|
-
solid?: Partial<SolidOptions>;
|
|
19
|
-
ssr?: boolean;
|
|
20
|
-
routeDir?: string;
|
|
21
|
-
extensions?: string[];
|
|
22
|
-
middleware?: string;
|
|
23
|
-
serialization?: {
|
|
24
|
-
/**
|
|
25
|
-
* The serialization mode to use for server functions/actions.
|
|
26
|
-
* The "js" mode uses a custom binary format that is more efficient than JSON, but requires a custom deserializer (with `eval()`) on the client.
|
|
27
|
-
* A strong CSP should block `eval()` executions, which would prevent the "js" mode from working.
|
|
28
|
-
* The "json" mode uses JSON for serialization, which is less efficient but can be deserialized with `JSON.parse` on the client.
|
|
29
|
-
*
|
|
30
|
-
* @default "json"
|
|
31
|
-
*/
|
|
32
|
-
mode?: "js" | "json";
|
|
33
|
-
};
|
|
34
|
-
env?: EnvPluginOptions;
|
|
35
|
-
serverFunctions?: Pick<ServerFunctionsOptions, "filter">;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const absolute = (path: string, root: string) =>
|
|
39
|
-
path ? (isAbsolute(path) ? path : join(root, path)) : path;
|
|
40
|
-
|
|
41
|
-
export function solidStart(options?: SolidStartOptions): Array<PluginOption> {
|
|
42
|
-
const start = defu(options ?? {}, {
|
|
43
|
-
appRoot: "./src",
|
|
44
|
-
routeDir: "./routes",
|
|
45
|
-
ssr: true,
|
|
46
|
-
devOverlay: true,
|
|
47
|
-
experimental: {
|
|
48
|
-
islands: false,
|
|
49
|
-
},
|
|
50
|
-
solid: {},
|
|
51
|
-
extensions: [],
|
|
52
|
-
});
|
|
53
|
-
const extensions = [...DEFAULT_EXTENSIONS, ...(start.extensions || [])];
|
|
54
|
-
const routeDir = join(start.appRoot, start.routeDir);
|
|
55
|
-
const root = process.cwd();
|
|
56
|
-
const appEntryPath = globSync(join(root, start.appRoot, "app.{j,t}sx"))[0];
|
|
57
|
-
if (!appEntryPath) {
|
|
58
|
-
throw new Error(`Could not find an app jsx/tsx entry in ${start.appRoot}.`);
|
|
59
|
-
}
|
|
60
|
-
const entryExtension = extname(appEntryPath);
|
|
61
|
-
const handlers = {
|
|
62
|
-
client: `${start.appRoot}/entry-client${entryExtension}`,
|
|
63
|
-
server: `${start.appRoot}/entry-server${entryExtension}`,
|
|
64
|
-
};
|
|
65
|
-
return [
|
|
66
|
-
// TODO (Alexis): check if the comment below is still relevant
|
|
67
|
-
//
|
|
68
|
-
// Must be placed after fsRoutes, as treeShake will remove the
|
|
69
|
-
// server fn exports added in by this plugin
|
|
70
|
-
serverFunctionsPlugin({
|
|
71
|
-
manifest: VIRTUAL_MODULES.serverFnManifest,
|
|
72
|
-
runtime: {
|
|
73
|
-
server: '@solidjs/start/fns/server',
|
|
74
|
-
client: '@solidjs/start/fns/client',
|
|
75
|
-
},
|
|
76
|
-
filter: options?.serverFunctions?.filter,
|
|
77
|
-
}),
|
|
78
|
-
{
|
|
79
|
-
name: "solid-start:config",
|
|
80
|
-
enforce: "pre",
|
|
81
|
-
configEnvironment(name) {
|
|
82
|
-
return {
|
|
83
|
-
resolve: {
|
|
84
|
-
// remove when https://github.com/solidjs/vite-plugin-solid/pull/228 is released
|
|
85
|
-
externalConditions: ["solid", "node"],
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
},
|
|
89
|
-
async config(_, env) {
|
|
90
|
-
const clientInput = [handlers.client];
|
|
91
|
-
if (env.command === "build") {
|
|
92
|
-
const clientRouter: BaseFileSystemRouter = (globalThis as any).ROUTERS.client;
|
|
93
|
-
for (const route of await clientRouter.getRoutes()) {
|
|
94
|
-
for (const [key, value] of Object.entries(route)) {
|
|
95
|
-
if (value && key.startsWith("$") && !key.startsWith("$$")) {
|
|
96
|
-
function toRouteId(route: any) {
|
|
97
|
-
return `${route.src}?${route.pick.map((p: string) => `pick=${p}`).join("&")}`;
|
|
98
|
-
}
|
|
99
|
-
clientInput.push(toRouteId(value));
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return {
|
|
105
|
-
appType: "custom",
|
|
106
|
-
build: { assetsDir: "_build/assets" },
|
|
107
|
-
optimizeDeps: {
|
|
108
|
-
// Suppress TS errors from Vite 7 types when configuring Vite 8's Rolldown
|
|
109
|
-
...({
|
|
110
|
-
rolldownOptions: {
|
|
111
|
-
transform: {
|
|
112
|
-
jsx: "react",
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
} as any),
|
|
116
|
-
},
|
|
117
|
-
environments: {
|
|
118
|
-
[VITE_ENVIRONMENTS.client]: {
|
|
119
|
-
consumer: "client",
|
|
120
|
-
build: {
|
|
121
|
-
write: true,
|
|
122
|
-
manifest: true,
|
|
123
|
-
outDir: "dist/client",
|
|
124
|
-
rollupOptions: {
|
|
125
|
-
input: clientInput,
|
|
126
|
-
treeshake: true,
|
|
127
|
-
preserveEntrySignatures: "exports-only",
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
[VITE_ENVIRONMENTS.server]: {
|
|
132
|
-
consumer: "server",
|
|
133
|
-
build: {
|
|
134
|
-
ssr: true,
|
|
135
|
-
write: true,
|
|
136
|
-
manifest: true,
|
|
137
|
-
copyPublicDir: false,
|
|
138
|
-
rollupOptions: {
|
|
139
|
-
input: "~/entry-server.tsx",
|
|
140
|
-
},
|
|
141
|
-
outDir: "dist/server",
|
|
142
|
-
commonjsOptions: {
|
|
143
|
-
include: [/node_modules/],
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
resolve: {
|
|
149
|
-
alias: {
|
|
150
|
-
"@solidjs/start/server/entry": handlers.server,
|
|
151
|
-
"~": join(process.cwd(), start.appRoot),
|
|
152
|
-
...(!start.ssr
|
|
153
|
-
? {
|
|
154
|
-
"@solidjs/start/server": "@solidjs/start/server/spa",
|
|
155
|
-
"@solidjs/start/client": "@solidjs/start/client/spa",
|
|
156
|
-
}
|
|
157
|
-
: {}),
|
|
158
|
-
},
|
|
159
|
-
// Depending on the package manager and dependency structure Vite externalizes @solidjs/start
|
|
160
|
-
// This makes sure that @solidjs/start goes through the Vite build process
|
|
161
|
-
noExternal: ["@solidjs/start"],
|
|
162
|
-
},
|
|
163
|
-
define: {
|
|
164
|
-
"import.meta.env.MANIFEST": `globalThis.MANIFEST`,
|
|
165
|
-
"import.meta.env.START_SSR": JSON.stringify(start.ssr),
|
|
166
|
-
// Use JSON.stringify so backslashes on Windows are escaped and
|
|
167
|
-
// esbuild receives a valid JS string literal for the define value
|
|
168
|
-
"import.meta.env.START_APP_ENTRY": JSON.stringify(appEntryPath),
|
|
169
|
-
"import.meta.env.START_CLIENT_ENTRY": JSON.stringify(handlers.client),
|
|
170
|
-
"import.meta.env.START_DEV_OVERLAY": JSON.stringify(start.devOverlay),
|
|
171
|
-
"import.meta.env.SEROVAL_MODE": JSON.stringify(start.serialization?.mode || "json"),
|
|
172
|
-
},
|
|
173
|
-
builder: {
|
|
174
|
-
sharedPlugins: true,
|
|
175
|
-
async buildApp(builder) {
|
|
176
|
-
const client = builder.environments[VITE_ENVIRONMENTS.client];
|
|
177
|
-
const server = builder.environments[VITE_ENVIRONMENTS.server];
|
|
178
|
-
|
|
179
|
-
if (!client) throw new Error("Client environment not found");
|
|
180
|
-
if (!server) throw new Error("SSR environment not found");
|
|
181
|
-
|
|
182
|
-
if (!client.isBuilt) await builder.build(client);
|
|
183
|
-
if (!server.isBuilt) await builder.build(server);
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
};
|
|
187
|
-
},
|
|
188
|
-
},
|
|
189
|
-
manifest(start),
|
|
190
|
-
fsRoutes({
|
|
191
|
-
routers: {
|
|
192
|
-
client: new SolidStartClientFileRouter({
|
|
193
|
-
dir: absolute(routeDir, root),
|
|
194
|
-
extensions,
|
|
195
|
-
}),
|
|
196
|
-
ssr: new SolidStartServerFileRouter({
|
|
197
|
-
dir: absolute(routeDir, root),
|
|
198
|
-
extensions,
|
|
199
|
-
dataOnly: !start.ssr,
|
|
200
|
-
}),
|
|
201
|
-
},
|
|
202
|
-
}),
|
|
203
|
-
lazy(),
|
|
204
|
-
envPlugin(options?.env),
|
|
205
|
-
{
|
|
206
|
-
name: "solid-start:virtual-modules",
|
|
207
|
-
async resolveId(id) {
|
|
208
|
-
const { filename, query } = parseIdQuery(id);
|
|
209
|
-
|
|
210
|
-
let base;
|
|
211
|
-
if (filename === VIRTUAL_MODULES.clientEntry) base = handlers.client;
|
|
212
|
-
if (filename === VIRTUAL_MODULES.serverEntry) base = handlers.server;
|
|
213
|
-
if (filename === VIRTUAL_MODULES.app) base = appEntryPath;
|
|
214
|
-
|
|
215
|
-
if (base) {
|
|
216
|
-
let id = (await this.resolve(base))?.id;
|
|
217
|
-
if (!id) return;
|
|
218
|
-
|
|
219
|
-
if (query.size > 0) id += `?${query.toString()}`;
|
|
220
|
-
return id;
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
name: "solid-start:capture-client-bundle",
|
|
226
|
-
enforce: "post",
|
|
227
|
-
generateBundle(options, bundle) {
|
|
228
|
-
globalThis.START_CLIENT_BUNDLE = bundle;
|
|
229
|
-
(globalThis as any).START_CLIENT_OUT_DIR = options.dir;
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
devServer(),
|
|
233
|
-
solid({
|
|
234
|
-
...start.solid,
|
|
235
|
-
ssr: true,
|
|
236
|
-
extensions: extensions.map(ext => `.${ext}`),
|
|
237
|
-
}),
|
|
238
|
-
];
|
|
239
|
-
}
|
package/src/config/lazy.ts
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import type { PluginItem } from "@babel/core";
|
|
2
|
-
import babel from "@babel/core";
|
|
3
|
-
import * as t from "@babel/types";
|
|
4
|
-
import { sep as osSep } from "node:path";
|
|
5
|
-
import { basename, relative, sep } from "node:path/posix";
|
|
6
|
-
import type { PluginOption } from "vite";
|
|
7
|
-
import { VITE_ENVIRONMENTS } from "./constants.ts";
|
|
8
|
-
|
|
9
|
-
const idTransform = (id: string): PluginItem => {
|
|
10
|
-
return {
|
|
11
|
-
visitor: {
|
|
12
|
-
Program(path) {
|
|
13
|
-
path.node.body.unshift(
|
|
14
|
-
t.exportNamedDeclaration(
|
|
15
|
-
t.variableDeclaration("const", [
|
|
16
|
-
t.variableDeclarator(t.identifier("id$$"), t.stringLiteral(id)),
|
|
17
|
-
]),
|
|
18
|
-
),
|
|
19
|
-
);
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const importTransform = (): PluginItem => {
|
|
26
|
-
return {
|
|
27
|
-
visitor: {
|
|
28
|
-
ImportDeclaration(path) {
|
|
29
|
-
if (path.node.source.value !== "solid-js") return;
|
|
30
|
-
path.traverse({
|
|
31
|
-
ImportSpecifier(subPath) {
|
|
32
|
-
if (subPath.node.local.name !== "lazy") return;
|
|
33
|
-
subPath.remove();
|
|
34
|
-
path.insertAfter(
|
|
35
|
-
t.importDeclaration(
|
|
36
|
-
[t.importSpecifier(t.identifier("lazy"), t.identifier("lazy"))],
|
|
37
|
-
t.stringLiteral("@solidjs/start/server"),
|
|
38
|
-
),
|
|
39
|
-
);
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const fileEndingRegex = /(ts|js)x(\?.*)?$/;
|
|
48
|
-
|
|
49
|
-
const lazy = (): PluginOption => {
|
|
50
|
-
const cwd = process.cwd().replaceAll(osSep, sep);
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Maps module ids to their client-specific shared chunk names.
|
|
54
|
-
* Modules in shared chunks need to find their assets via the chunk name, instead of their module id.
|
|
55
|
-
*
|
|
56
|
-
* Vite includes assets of such modules in the manifest via the chunk name:
|
|
57
|
-
* https://github.com/vitejs/vite/blob/4be37a8389c67873880f826b01fe40137e1c29a7/packages/vite/src/node/plugins/manifest.ts#L179
|
|
58
|
-
* https://github.com/vitejs/vite/blob/4be37a8389c67873880f826b01fe40137e1c29a7/packages/vite/src/node/plugins/manifest.ts#L319
|
|
59
|
-
*
|
|
60
|
-
* Rollup occassionally creates shared chunks automatically,
|
|
61
|
-
* but they can also be manually created by the user via:
|
|
62
|
-
* https://rollupjs.org/configuration-options/#output-manualchunks
|
|
63
|
-
*
|
|
64
|
-
* More infos on Rollup's logic:
|
|
65
|
-
* https://github.com/rollup/rollup/issues/3772#issuecomment-689955168
|
|
66
|
-
*/
|
|
67
|
-
const sharedChunkNames: Record<string, string> = {};
|
|
68
|
-
|
|
69
|
-
return {
|
|
70
|
-
name: "solid-lazy-css",
|
|
71
|
-
enforce: "pre",
|
|
72
|
-
generateBundle(_, bundle) {
|
|
73
|
-
if (this.environment.name !== VITE_ENVIRONMENTS.client) return;
|
|
74
|
-
|
|
75
|
-
for (const chunk of Object.values(bundle)) {
|
|
76
|
-
if (chunk.type !== "chunk" || !chunk.isDynamicEntry || chunk.facadeModuleId) continue;
|
|
77
|
-
|
|
78
|
-
// Has to follow Vites implementation:
|
|
79
|
-
// https://github.com/vitejs/vite/blob/4be37a8389c67873880f826b01fe40137e1c29a7/packages/vite/src/node/plugins/manifest.ts#L179
|
|
80
|
-
const chunkName = `_${basename(chunk.fileName)}`;
|
|
81
|
-
for (const id of chunk.moduleIds) {
|
|
82
|
-
sharedChunkNames[id] = chunkName;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
async transform(src, id) {
|
|
87
|
-
if (this.environment.name !== VITE_ENVIRONMENTS.server) return;
|
|
88
|
-
if (!id.match(fileEndingRegex)) return;
|
|
89
|
-
|
|
90
|
-
// The transformed files either import "lazy" or css files
|
|
91
|
-
// Therefore we skip, if the src doesn't have any import
|
|
92
|
-
if (src.indexOf("import") === -1) return;
|
|
93
|
-
if (id.includes("entry-server")) return;
|
|
94
|
-
|
|
95
|
-
const plugins: PluginItem[] = [];
|
|
96
|
-
|
|
97
|
-
const hasDefaultExport = src.indexOf("export default") !== -1;
|
|
98
|
-
if (hasDefaultExport) {
|
|
99
|
-
const localId = relative(cwd, id);
|
|
100
|
-
const chunkName = sharedChunkNames[id];
|
|
101
|
-
plugins.push(idTransform(chunkName ?? localId));
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
const hasLazy = src.indexOf("lazy(") !== -1;
|
|
105
|
-
if (hasLazy) plugins.push(importTransform());
|
|
106
|
-
|
|
107
|
-
if (!plugins.length) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const transformed = await babel.transformAsync(src, {
|
|
112
|
-
plugins,
|
|
113
|
-
parserOpts: {
|
|
114
|
-
plugins: ["jsx", "typescript"],
|
|
115
|
-
},
|
|
116
|
-
filename: basename(id),
|
|
117
|
-
ast: false,
|
|
118
|
-
sourceMaps: true,
|
|
119
|
-
configFile: false,
|
|
120
|
-
babelrc: false,
|
|
121
|
-
sourceFileName: id,
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
if (!transformed?.code) return;
|
|
125
|
-
|
|
126
|
-
const { code, map } = transformed;
|
|
127
|
-
return { code, map };
|
|
128
|
-
},
|
|
129
|
-
};
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
export default lazy;
|
package/src/config/manifest.ts
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { type PluginOption, type ViteDevServer, version as viteVersion } from "vite";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
|
-
|
|
6
|
-
import { findStylesInModuleGraph } from "../server/collect-styles.ts";
|
|
7
|
-
import { VIRTUAL_MODULES } from "./constants.ts";
|
|
8
|
-
import { type SolidStartOptions } from "./index.ts";
|
|
9
|
-
import { wrapId } from "./vite-utils.ts";
|
|
10
|
-
|
|
11
|
-
export function manifest(start: SolidStartOptions): PluginOption {
|
|
12
|
-
let devServer: ViteDevServer = undefined!;
|
|
13
|
-
return {
|
|
14
|
-
name: "solid-start:manifest-plugin",
|
|
15
|
-
enforce: "pre",
|
|
16
|
-
configureServer(server) {
|
|
17
|
-
devServer = server;
|
|
18
|
-
},
|
|
19
|
-
async resolveId(id) {
|
|
20
|
-
if (id === VIRTUAL_MODULES.clientViteManifest)
|
|
21
|
-
return `\0${VIRTUAL_MODULES.clientViteManifest}`;
|
|
22
|
-
if (id === VIRTUAL_MODULES.getClientManifest)
|
|
23
|
-
return this.resolve(
|
|
24
|
-
fileURLToPath(new URL("../server/manifest/client-manifest", import.meta.url)),
|
|
25
|
-
);
|
|
26
|
-
if (id === VIRTUAL_MODULES.getManifest) {
|
|
27
|
-
return this.environment.config.consumer === "client"
|
|
28
|
-
? this.resolve(
|
|
29
|
-
fileURLToPath(new URL("../server/manifest/client-manifest", import.meta.url)),
|
|
30
|
-
)
|
|
31
|
-
: this.resolve(
|
|
32
|
-
fileURLToPath(new URL("../server/manifest/ssr-manifest", import.meta.url)),
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
if (id === VIRTUAL_MODULES.middleware) {
|
|
36
|
-
if (start.middleware) return await this.resolve(start.middleware);
|
|
37
|
-
return `\0${VIRTUAL_MODULES.middleware}`;
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
async load(id) {
|
|
41
|
-
if (id === `\0${VIRTUAL_MODULES.clientViteManifest}`) {
|
|
42
|
-
let clientViteManifest: Record<string, Record<string, any>>;
|
|
43
|
-
if (this.environment.config.command === "serve") {
|
|
44
|
-
clientViteManifest = {};
|
|
45
|
-
} else {
|
|
46
|
-
const entry = Object.values(globalThis.START_CLIENT_BUNDLE).find(
|
|
47
|
-
v => "isEntry" in v && v.isEntry,
|
|
48
|
-
);
|
|
49
|
-
if (!entry) throw new Error("No client entry found");
|
|
50
|
-
let rawManifest: string | undefined;
|
|
51
|
-
|
|
52
|
-
const viteMajor = parseInt(viteVersion.split('.')[0]!, 10);
|
|
53
|
-
|
|
54
|
-
const manifestKey = Object.keys(globalThis.START_CLIENT_BUNDLE).find(k => k.endsWith("manifest.json"));
|
|
55
|
-
if (manifestKey && viteMajor < 8) {
|
|
56
|
-
const manifestAsset = globalThis.START_CLIENT_BUNDLE[manifestKey] as any;
|
|
57
|
-
rawManifest = manifestAsset.source as string;
|
|
58
|
-
} else {
|
|
59
|
-
try {
|
|
60
|
-
const appRoot = (start as any).appRoot || "./src";
|
|
61
|
-
let outDir = ".solid-start/client";
|
|
62
|
-
if (devServer?.environments?.client?.config?.build?.outDir) {
|
|
63
|
-
outDir = devServer.environments.client.config.build.outDir;
|
|
64
|
-
} else if (this.environment?.config?.build?.outDir && this.environment?.config?.consumer === "client") {
|
|
65
|
-
outDir = this.environment.config.build.outDir;
|
|
66
|
-
} else if ((globalThis as any).START_CLIENT_OUT_DIR) {
|
|
67
|
-
outDir = (globalThis as any).START_CLIENT_OUT_DIR;
|
|
68
|
-
}
|
|
69
|
-
const manifestPath = path.resolve(appRoot, "..", outDir, ".vite/manifest.json");
|
|
70
|
-
rawManifest = fs.readFileSync(manifestPath, "utf-8");
|
|
71
|
-
} catch (e) {
|
|
72
|
-
throw new Error(`Manifest asset not found in bundle and could not be read from disk. Keys: ${Object.keys(globalThis.START_CLIENT_BUNDLE).join(", ")}. Error: ${e}`);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (!rawManifest) {
|
|
77
|
-
throw new Error("Failed to extract or read raw manifest.");
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
clientViteManifest = JSON.parse(rawManifest);
|
|
81
|
-
}
|
|
82
|
-
return `export const clientViteManifest = ${JSON.stringify(clientViteManifest)};`;
|
|
83
|
-
} else if (id === `\0${VIRTUAL_MODULES.middleware}`) return "export default {};";
|
|
84
|
-
else if (id.startsWith("/@manifest")) {
|
|
85
|
-
if (this.environment.mode !== "dev")
|
|
86
|
-
throw new Error("@manifest queries are only allowed in dev");
|
|
87
|
-
|
|
88
|
-
const [urlPath, query] = id.split("?");
|
|
89
|
-
const target = id.split("/")[2]!;
|
|
90
|
-
const params = new URLSearchParams(query);
|
|
91
|
-
if (!urlPath || !query) return;
|
|
92
|
-
if (urlPath.endsWith("assets")) {
|
|
93
|
-
const id = params.get("id");
|
|
94
|
-
if (!id) {
|
|
95
|
-
throw new Error("Missing id to get assets.");
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Client env does not have css dependencies in mod.transformResult
|
|
99
|
-
// Aalways use ssr env instead, to prevent hydration mismatches
|
|
100
|
-
const env = devServer.environments["ssr"];
|
|
101
|
-
const styles = await findStylesInModuleGraph(env, id);
|
|
102
|
-
|
|
103
|
-
const cssAssets = Object.entries(styles).map(
|
|
104
|
-
([key, value]) => `{
|
|
105
|
-
tag: "style",
|
|
106
|
-
attrs: {
|
|
107
|
-
type: "text/css",
|
|
108
|
-
"data-vite-dev-id": "${wrapId(key)}",
|
|
109
|
-
"data-vite-ref": "0",
|
|
110
|
-
},
|
|
111
|
-
children: () => import("${wrapId(value)}?inline").then(mod => mod.default),
|
|
112
|
-
}`,
|
|
113
|
-
);
|
|
114
|
-
|
|
115
|
-
return `export default [${cssAssets.join(",")}]`;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
};
|
|
120
|
-
}
|
package/src/config/utils.ts
DELETED
package/src/config/vite-utils.ts
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import type { DevEnvironment, Rollup } from "vite";
|
|
2
|
-
import fs from "node:fs";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
|
|
5
|
-
const postfixRE = /[?#].*$/;
|
|
6
|
-
export function cleanUrl(url: string): string {
|
|
7
|
-
return url.replace(postfixRE, "");
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const FS_PREFIX = `/@fs/`;
|
|
11
|
-
|
|
12
|
-
export const VALID_ID_PREFIX = `/@id/`;
|
|
13
|
-
|
|
14
|
-
export const NULL_BYTE_PLACEHOLDER = `__x00__`;
|
|
15
|
-
const NULL_BYTE_REGEX = /^\0/;
|
|
16
|
-
|
|
17
|
-
export function normalizeResolvedIdToUrl(
|
|
18
|
-
environment: DevEnvironment,
|
|
19
|
-
url: string,
|
|
20
|
-
resolved: Rollup.PartialResolvedId,
|
|
21
|
-
): string {
|
|
22
|
-
const root = environment.config.root;
|
|
23
|
-
const depsOptimizer = environment.depsOptimizer;
|
|
24
|
-
|
|
25
|
-
// normalize all imports into resolved URLs
|
|
26
|
-
// e.g. `import 'foo'` -> `import '/@fs/.../node_modules/foo/index.js'`
|
|
27
|
-
if (resolved.id.startsWith(withTrailingSlash(root))) {
|
|
28
|
-
// in root: infer short absolute path from root
|
|
29
|
-
url = resolved.id.slice(root.length);
|
|
30
|
-
} else if (
|
|
31
|
-
depsOptimizer?.isOptimizedDepFile(resolved.id) ||
|
|
32
|
-
// vite-plugin-react isn't following the leading \0 virtual module convention.
|
|
33
|
-
// This is a temporary hack to avoid expensive fs checks for React apps.
|
|
34
|
-
// We'll remove this as soon we're able to fix the react plugins.
|
|
35
|
-
(resolved.id !== "/@react-refresh" &&
|
|
36
|
-
path.isAbsolute(resolved.id) &&
|
|
37
|
-
fs.existsSync(cleanUrl(resolved.id)))
|
|
38
|
-
) {
|
|
39
|
-
// an optimized deps may not yet exists in the filesystem, or
|
|
40
|
-
// a regular file exists but is out of root: rewrite to absolute /@fs/ paths
|
|
41
|
-
url = path.posix.join(FS_PREFIX, resolved.id);
|
|
42
|
-
} else {
|
|
43
|
-
url = resolved.id;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// if the resolved id is not a valid browser import specifier,
|
|
47
|
-
// prefix it to make it valid. We will strip this before feeding it
|
|
48
|
-
// back into the transform pipeline
|
|
49
|
-
if (url[0] !== "." && url[0] !== "/") {
|
|
50
|
-
url = wrapId(resolved.id);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return url;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Inspired by:
|
|
58
|
-
* https://github.com/withastro/astro/blob/fddde5fad81007795eb263c7fd0cea096b8e2cba/packages/astro/src/core/util.ts#L115
|
|
59
|
-
* https://github.com/vitejs/vite/blob/130e7181a55c524383c63bbfb1749d0ff7185cad/packages/vite/src/shared/utils.ts#L11
|
|
60
|
-
*/
|
|
61
|
-
export function wrapId(id: string): string {
|
|
62
|
-
return id.replace(NULL_BYTE_REGEX, `${VALID_ID_PREFIX}${NULL_BYTE_PLACEHOLDER}`);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function unwrapId(id: string): string {
|
|
66
|
-
return id.startsWith(VALID_ID_PREFIX)
|
|
67
|
-
? id.slice(VALID_ID_PREFIX.length).replace(NULL_BYTE_PLACEHOLDER, "\0")
|
|
68
|
-
: id;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export function normalizeViteImportAnalysisUrl(environment: DevEnvironment, id: string): string {
|
|
72
|
-
let url = normalizeResolvedIdToUrl(environment, id, { id });
|
|
73
|
-
|
|
74
|
-
// https://github.com/vitejs/vite/blob/c18ce868c4d70873406e9f7d1b2d0a03264d2168/packages/vite/src/node/plugins/importAnalysis.ts#L416
|
|
75
|
-
if (environment.config.consumer === "client") {
|
|
76
|
-
const mod = environment.moduleGraph.getModuleById(id);
|
|
77
|
-
if (mod && mod.lastHMRTimestamp > 0) {
|
|
78
|
-
url = injectQuery(url, `t=${mod.lastHMRTimestamp}`);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return url;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export function withTrailingSlash(path: string): string {
|
|
86
|
-
if (path[path.length - 1] !== "/") {
|
|
87
|
-
return `${path}/`;
|
|
88
|
-
}
|
|
89
|
-
return path;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export function splitFileAndPostfix(path: string): {
|
|
93
|
-
file: string;
|
|
94
|
-
postfix: string;
|
|
95
|
-
} {
|
|
96
|
-
const file = cleanUrl(path);
|
|
97
|
-
return { file, postfix: path.slice(file.length) };
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const windowsSlashRE = /\\/g;
|
|
101
|
-
export function slash(p: string): string {
|
|
102
|
-
return p.replace(windowsSlashRE, "/");
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const isWindows = typeof process !== "undefined" && process.platform === "win32";
|
|
106
|
-
|
|
107
|
-
export function injectQuery(url: string, queryToInject: string): string {
|
|
108
|
-
const { file, postfix } = splitFileAndPostfix(url);
|
|
109
|
-
const normalizedFile = isWindows ? slash(file) : file;
|
|
110
|
-
return `${normalizedFile}?${queryToInject}${
|
|
111
|
-
postfix[0] === "?" ? `&${postfix.slice(1)}` : /* hash only */ postfix
|
|
112
|
-
}`;
|
|
113
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type * as babel from "@babel/core";
|
|
2
|
-
import * as t from "@babel/types";
|
|
3
|
-
|
|
4
|
-
export function bubbleFunctionDeclaration(path: babel.NodePath<t.FunctionDeclaration>): void {
|
|
5
|
-
const decl = path.node;
|
|
6
|
-
// Check if declaration is FunctionDeclaration
|
|
7
|
-
if (decl.id) {
|
|
8
|
-
const block = (path.findParent(current => current.isBlockStatement()) ||
|
|
9
|
-
path.scope.getProgramParent().path) as babel.NodePath<t.BlockStatement>;
|
|
10
|
-
|
|
11
|
-
if (path.parentPath.isExportNamedDeclaration()) {
|
|
12
|
-
path.parentPath.replaceWith(
|
|
13
|
-
t.exportNamedDeclaration(undefined, [t.exportSpecifier(decl.id, decl.id)]),
|
|
14
|
-
);
|
|
15
|
-
} else if (path.parentPath.isExportDefaultDeclaration()) {
|
|
16
|
-
path.replaceWith(decl.id);
|
|
17
|
-
} else {
|
|
18
|
-
path.remove();
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const [tmp] = block.unshiftContainer(
|
|
22
|
-
"body",
|
|
23
|
-
t.variableDeclaration("const", [
|
|
24
|
-
t.variableDeclarator(
|
|
25
|
-
decl.id,
|
|
26
|
-
t.functionExpression(decl.id, decl.params, decl.body, decl.generator, decl.async),
|
|
27
|
-
),
|
|
28
|
-
]),
|
|
29
|
-
);
|
|
30
|
-
block.scope.registerDeclaration(tmp);
|
|
31
|
-
tmp.skip();
|
|
32
|
-
}
|
|
33
|
-
}
|