vite-plugin-kiru 0.32.0-preview.1 → 0.32.0

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/build.dev.ts CHANGED
@@ -3,13 +3,13 @@ import fs from "node:fs"
3
3
 
4
4
  await esbuild
5
5
  .context({
6
- entryPoints: ["src/index.ts", "src/server.ts"],
6
+ entryPoints: ["src/index.ts"],
7
7
  bundle: true,
8
8
  platform: "node",
9
9
  target: "esnext",
10
10
  format: "esm",
11
- outdir: "./dist",
12
- external: ["kiru", "vite", "virtual:kiru:entry-server"],
11
+ outfile: "./dist/index.js",
12
+ external: ["kiru", "vite"],
13
13
  write: true,
14
14
  plugins: [
15
15
  {
@@ -18,7 +18,6 @@ await esbuild
18
18
  onEnd(() => {
19
19
  console.log("[vite-plugin-kiru]: Build complete!")
20
20
  fs.copyFileSync("./src/types.d.ts", "dist/index.d.ts")
21
- fs.copyFileSync("./src/types.server.d.ts", "dist/server.d.ts")
22
21
  })
23
22
  },
24
23
  },
package/dist/index.d.ts CHANGED
@@ -116,11 +116,6 @@ export interface SSGOptions {
116
116
  * @default "layout.{tsx,jsx}"
117
117
  */
118
118
  layout?: string
119
- /**
120
- * The filename of guard files to search for
121
- * @default "guard.{ts,js}"
122
- */
123
- guard?: string
124
119
  /**
125
120
  * Enable transitions for all routes and loading states
126
121
  * @default false
@@ -138,49 +133,6 @@ export interface SSGOptions {
138
133
  build?: SSGBuildOptions
139
134
  }
140
135
 
141
- export interface SSROptions {
142
- /**
143
- * The path to the server entry file
144
- * @example "src/server.ts"
145
- */
146
- runtimeEntry: string
147
- /**
148
- * The base URL of the app
149
- * @default "/"
150
- */
151
- baseUrl?: string
152
- /**
153
- * The directory of the app
154
- * @default "src/pages"
155
- */
156
- dir?: string
157
- /**
158
- * The name of the document component
159
- * @default "document.{tsx,jsx}"
160
- */
161
- document?: string
162
- /**
163
- * The filename of page components to search for
164
- * @default "index.{tsx,jsx}"
165
- */
166
- page?: string
167
- /**
168
- * The filename of layout components to search for
169
- * @default "layout.{tsx,jsx}"
170
- */
171
- layout?: string
172
- /**
173
- * The filename of guard files to search for
174
- * @default "guard.{ts,js}"
175
- */
176
- guard?: string
177
- /**
178
- * Enable transitions for all routes and loading states
179
- * @default false
180
- */
181
- transition?: boolean
182
- }
183
-
184
136
  export interface DevtoolsOptions {
185
137
  /**
186
138
  * Specifies the path to the devtools app displayed via popup
@@ -198,6 +150,27 @@ export interface DevtoolsOptions {
198
150
  formatFileLink?: FileLinkFormatter
199
151
  }
200
152
 
153
+ export interface ExperimentalOptions {
154
+ /**
155
+ * Enable static JSX hoisting optimization
156
+ * @default false
157
+ * @example
158
+ * ```tsx
159
+ * function MyComponent() {
160
+ * return <div>Hello, world!</div>
161
+ * }
162
+ * // becomes:
163
+ * const $k0 = createElement("div", null, "Hello, world!")
164
+ * function MyComponent() {
165
+ * return $k0
166
+ * }
167
+ * // because the JSX is static, it can be hoisted to the top of the component.
168
+ * // our 'div' with 'Hello, world!' is _never rerendered_.
169
+ * ```
170
+ */
171
+ staticHoisting?: boolean
172
+ }
173
+
201
174
  export interface KiruPluginOptions {
202
175
  /**
203
176
  * Whether the devtools should be injected into the build during development
@@ -228,25 +201,15 @@ export interface KiruPluginOptions {
228
201
  onFileExcluded?: (id: string) => void
229
202
 
230
203
  /**
231
- * Options for SSG
232
- * @example
233
- * ```ts
234
- * ssg: {
235
- * dir: "./src/app",
236
- * document: "document.{tsx,jsx}",
237
- * page: "index.{tsx,jsx}",
238
- * layout: "layout.{tsx,jsx}",
239
- * transition: true
240
- * }
241
- * ```
204
+ * Experimental options
242
205
  */
243
- ssg?: SSGOptions | true
206
+ experimental?: ExperimentalOptions
244
207
 
245
208
  /**
246
- * Options for SSR
209
+ * Options for SSG
247
210
  * @example
248
211
  * ```ts
249
- * ssr: {
212
+ * ssg: {
250
213
  * dir: "./src/app",
251
214
  * document: "document.{tsx,jsx}",
252
215
  * page: "index.{tsx,jsx}",
@@ -255,7 +218,7 @@ export interface KiruPluginOptions {
255
218
  * }
256
219
  * ```
257
220
  */
258
- ssr?: SSROptions
221
+ ssg?: SSGOptions | true
259
222
  }
260
223
 
261
224
  export const defaultEsBuildOptions: ESBuildOptions