solid-optimizer 0.3.0 → 1.0.0-next.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/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as readModuleConstants, i as compile, n as CompileResult, o as ImportedConstants, r as ModuleConstants, s as Primitive, t as CompileOptions } from "./compile-BroGlagZ.mjs";
2
- export { type CompileOptions, type CompileResult, type ImportedConstants, type ModuleConstants, type Primitive, compile, readModuleConstants };
1
+ import { a as readModuleConstants, c as SkipPass, i as compile, l as Primitive, n as CompileResult, o as ImportedConstants, r as ModuleConstants, s as Skip, t as CompileOptions } from "./compile-BRCj4UN7.mjs";
2
+ export { type CompileOptions, type CompileResult, type ImportedConstants, type ModuleConstants, type Primitive, type Skip, type SkipPass, compile, readModuleConstants };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { n as readModuleConstants, t as compile } from "./compile-ocDYvJUW.mjs";
1
+ import { n as readModuleConstants, t as compile } from "./compile-Cz6hbiQv.mjs";
2
2
  export { compile, readModuleConstants };
package/dist/vite.d.mts CHANGED
@@ -1,15 +1,16 @@
1
- import { t as CompileOptions } from "./compile-BroGlagZ.mjs";
1
+ import { s as Skip, t as CompileOptions } from "./compile-BRCj4UN7.mjs";
2
+ import { Options as Options$1 } from "@solidjs/vite-plugin";
2
3
  import { Plugin } from "vite";
3
- import { Options as Options$1 } from "vite-plugin-solid";
4
+ //#region src/vite/report.d.ts
5
+ /** What the optimizer left alone in one build environment. */
6
+ interface OptimizerReport {
7
+ /** The Vite environment, like `client` or `ssr`. */
8
+ readonly environment: string;
9
+ readonly skips: readonly Skip[];
10
+ }
11
+ //#endregion
4
12
  //#region src/vite/index.d.ts
5
13
  export interface OptimizerOptions extends Pick<CompileOptions, 'fold' | 'inline' | 'alwaysInline' | 'contexts' | 'memos' | 'maxPasses'> {
6
- /**
7
- * Reduce Solid's reactive primitives to what they do on the server, in
8
- * server builds. See the `server` option of `compile`.
9
- *
10
- * @default true
11
- */
12
- server?: boolean;
13
14
  /**
14
15
  * Where the optimizer runs.
15
16
  *
@@ -25,11 +26,21 @@ export interface OptimizerOptions extends Pick<CompileOptions, 'fold' | 'inline'
25
26
  * @default false
26
27
  */
27
28
  dev?: boolean;
29
+ /**
30
+ * Report what the optimizer leaves alone in each build, and why: each
31
+ * component call that stays a call, each provider that stays, and each
32
+ * memo that stays. `true` prints the report. A function receives it
33
+ * instead, once per build environment.
34
+ *
35
+ * @default false
36
+ */
37
+ report?: boolean | ((report: OptimizerReport) => void);
28
38
  }
29
39
  export interface Options extends Partial<Options$1> {
30
- /** Set to `false` to use `vite-plugin-solid` as it is. */
40
+ /** Set to `false` to use `@solidjs/vite-plugin` as it is. */
31
41
  optimizer?: OptimizerOptions | false;
32
42
  }
33
43
  export default function solidOptimizer(options?: Options): Plugin[];
34
44
  //#endregion
45
+ export type { OptimizerReport };
35
46
  //# sourceMappingURL=vite.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vite.d.mts","names":["SolidPluginOptions"],"sources":["../src/vite/index.ts"],"mappings":";;;;iBA+CiB,yBAAyB,KACxC;;;;;;;EASA;;;;;;;;;EASA;;;;;;EAMA;;iBAGe,gBAAgB,QAAQA;;EAEvC,YAAY;;wBAmJU,eAAe,UAAS,UAAe"}
1
+ {"version":3,"file":"vite.d.mts","names":["SolidPluginOptions"],"sources":["../src/vite/report.ts","../src/vite/index.ts"],"mappings":";;;;;UAUiB;;WAEN;WACA,gBAAgB;;;;iBCwCV,yBAAyB,KACxC;;;;;;;;;EAWA;;;;;;EAMA;;;;;;;;;EASA,qBAAqB,QAAQ;;iBAKd,gBAAgB,QAAQA;;EAEvC,YAAY;;wBAuIU,eAAe,UAAS,UAAe"}