solid-optimizer 0.2.0 → 0.4.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.
Files changed (53) hide show
  1. package/README.md +294 -14
  2. package/dist/compile-BQuBDA0Q.d.mts +199 -0
  3. package/dist/compile-BQuBDA0Q.d.mts.map +1 -0
  4. package/dist/compile-D3caSUtw.mjs +4244 -0
  5. package/dist/compile-D3caSUtw.mjs.map +1 -0
  6. package/dist/index.d.mts +2 -0
  7. package/dist/index.mjs +2 -0
  8. package/dist/vite.d.mts +53 -0
  9. package/dist/vite.d.mts.map +1 -0
  10. package/dist/vite.mjs +1743 -0
  11. package/dist/vite.mjs.map +1 -0
  12. package/package.json +60 -58
  13. package/src/ast.ts +271 -0
  14. package/src/compile.ts +355 -0
  15. package/src/constants.ts +249 -0
  16. package/src/context.ts +116 -0
  17. package/src/fold.ts +850 -0
  18. package/src/index.ts +5 -107
  19. package/src/inline.ts +2237 -0
  20. package/src/jsx.ts +170 -0
  21. package/src/memo.ts +416 -0
  22. package/src/provider.ts +899 -0
  23. package/src/scope.ts +588 -0
  24. package/src/server.ts +275 -0
  25. package/src/size.ts +309 -0
  26. package/src/value.ts +386 -0
  27. package/src/vite/index.ts +1378 -0
  28. package/src/vite/inject.ts +350 -0
  29. package/src/vite/namespace.ts +66 -0
  30. package/src/vite/refs.ts +99 -0
  31. package/src/vite/report.ts +74 -0
  32. package/src/vite/runtime.ts +370 -0
  33. package/src/vite/usage.ts +405 -0
  34. package/dist/cjs/development/index.cjs +0 -228
  35. package/dist/cjs/development/index.cjs.map +0 -7
  36. package/dist/cjs/production/index.cjs +0 -1
  37. package/dist/esm/development/index.mjs +0 -197
  38. package/dist/esm/development/index.mjs.map +0 -7
  39. package/dist/esm/production/index.mjs +0 -1
  40. package/dist/types/checks.d.ts +0 -9
  41. package/dist/types/checks.d.ts.map +0 -1
  42. package/dist/types/index.d.ts +0 -3
  43. package/dist/types/index.d.ts.map +0 -1
  44. package/dist/types/path-references-import.d.ts +0 -3
  45. package/dist/types/path-references-import.d.ts.map +0 -1
  46. package/dist/types/unwrap-node.d.ts +0 -7
  47. package/dist/types/unwrap-node.d.ts.map +0 -1
  48. package/dist/types/unwrap-path.d.ts +0 -6
  49. package/dist/types/unwrap-path.d.ts.map +0 -1
  50. package/src/checks.ts +0 -42
  51. package/src/path-references-import.ts +0 -82
  52. package/src/unwrap-node.ts +0 -27
  53. package/src/unwrap-path.ts +0 -18
@@ -0,0 +1,2 @@
1
+ import { a as readModuleConstants, c as Skip, i as compile, l as SkipPass, n as CompileResult, o as ImportedConstants, r as ModuleConstants, s as Primitive, t as CompileOptions } from "./compile-BQuBDA0Q.mjs";
2
+ export { type CompileOptions, type CompileResult, type ImportedConstants, type ModuleConstants, type Primitive, type Skip, type SkipPass, compile, readModuleConstants };
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { n as readModuleConstants, t as compile } from "./compile-D3caSUtw.mjs";
2
+ export { compile, readModuleConstants };
@@ -0,0 +1,53 @@
1
+ import { c as Skip, t as CompileOptions } from "./compile-BQuBDA0Q.mjs";
2
+ 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
12
+ //#region src/vite/index.d.ts
13
+ export interface OptimizerOptions extends Pick<CompileOptions, 'fold' | 'inline' | 'alwaysInline' | 'contexts' | 'memos' | 'maxPasses'> {
14
+ /**
15
+ * Reduce Solid's reactive primitives to what they do on the server, in
16
+ * server builds. See the `server` option of `compile`.
17
+ *
18
+ * @default true
19
+ */
20
+ server?: boolean;
21
+ /**
22
+ * Where the optimizer runs.
23
+ *
24
+ * - `auto` uses chunk mode for client builds that do not hydrate, and module mode otherwise.
25
+ * - `module` optimizes each module on its own.
26
+ *
27
+ * @default 'auto'
28
+ */
29
+ mode?: 'auto' | 'module';
30
+ /**
31
+ * Also optimize while serving, in module mode.
32
+ *
33
+ * @default false
34
+ */
35
+ dev?: boolean;
36
+ /**
37
+ * Report what the optimizer leaves alone in each build, and why: each
38
+ * component call that stays a call, each provider that stays, and each
39
+ * memo that stays. `true` prints the report. A function receives it
40
+ * instead, once per build environment.
41
+ *
42
+ * @default false
43
+ */
44
+ report?: boolean | ((report: OptimizerReport) => void);
45
+ }
46
+ export interface Options extends Partial<Options$1> {
47
+ /** Set to `false` to use `vite-plugin-solid` as it is. */
48
+ optimizer?: OptimizerOptions | false;
49
+ }
50
+ export default function solidOptimizer(options?: Options): Plugin[];
51
+ //#endregion
52
+ export type { OptimizerReport };
53
+ //# sourceMappingURL=vite.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite.d.mts","names":["SolidPluginOptions"],"sources":["../src/vite/report.ts","../src/vite/index.ts"],"mappings":";;;;;UAUiB;;WAEN;WACA,gBAAgB;;;;iBCsCV,yBAAyB,KACxC;;;;;;;EASA;;;;;;;;;EASA;;;;;;EAMA;;;;;;;;;EASA,qBAAqB,QAAQ;;iBAKd,gBAAgB,QAAQA;;EAEvC,YAAY;;wBAmOU,eAAe,UAAS,UAAe"}