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/README.md +94 -42
- package/dist/{compile-BroGlagZ.d.mts → compile-BRCj4UN7.d.mts} +39 -19
- package/dist/compile-BRCj4UN7.d.mts.map +1 -0
- package/dist/{compile-ocDYvJUW.mjs → compile-Cz6hbiQv.mjs} +1312 -705
- package/dist/compile-Cz6hbiQv.mjs.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/vite.d.mts +21 -10
- package/dist/vite.d.mts.map +1 -1
- package/dist/vite.mjs +648 -269
- package/dist/vite.mjs.map +1 -1
- package/package.json +10 -11
- package/src/ast.ts +12 -4
- package/src/compile.ts +69 -42
- package/src/constants.ts +42 -2
- package/src/context.ts +32 -0
- package/src/copy-size.ts +73 -0
- package/src/fold.ts +619 -17
- package/src/index.ts +1 -0
- package/src/inline.ts +568 -299
- package/src/memo.ts +197 -33
- package/src/provider.ts +104 -82
- package/src/scope.ts +14 -1
- package/src/size.ts +35 -73
- package/src/vite/globals.ts +67 -0
- package/src/vite/index.ts +475 -217
- package/src/vite/inject.ts +51 -2
- package/src/vite/refs.ts +99 -0
- package/src/vite/report.ts +74 -0
- package/src/vite/runtime.ts +3 -3
- package/dist/compile-BroGlagZ.d.mts.map +0 -1
- package/dist/compile-ocDYvJUW.mjs.map +0 -1
- package/src/server.ts +0 -275
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
|
|
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-
|
|
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-
|
|
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
|
-
|
|
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
|
|
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
|
package/dist/vite.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.mts","names":["SolidPluginOptions"],"sources":["../src/vite/index.ts"],"mappings":";;;;
|
|
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"}
|