solid-optimizer 1.0.0-next.9 → 1.0.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 +5 -5
- package/dist/{compile-DptOANJi.mjs → compile-Cvjy2e11.mjs} +311 -159
- package/dist/compile-Cvjy2e11.mjs.map +1 -0
- package/dist/{compile-X_SMDFr2.d.mts → compile-ioIkBKzR.d.mts} +1 -2
- package/dist/compile-ioIkBKzR.d.mts.map +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.mts.map +1 -1
- package/dist/vite.mjs +55 -14
- package/dist/vite.mjs.map +1 -1
- package/package.json +6 -6
- package/src/compile.ts +6 -8
- package/src/conditional.ts +29 -22
- package/src/context.ts +3 -3
- package/src/copy-size.ts +6 -5
- package/src/fold.ts +57 -53
- package/src/inline.ts +67 -59
- package/src/jsx.ts +16 -14
- package/src/memo.ts +12 -6
- package/src/text.ts +297 -0
- package/src/vite/index.ts +66 -12
- package/dist/compile-DptOANJi.mjs.map +0 -1
- package/dist/compile-X_SMDFr2.d.mts.map +0 -1
package/README.md
CHANGED
|
@@ -12,18 +12,18 @@ The website, [solid-optimizer.vercel.app](https://solid-optimizer.vercel.app), s
|
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
This version is for Solid 2.0. Solid 1.x users stay on `solid-optimizer@0`, which only gets fixes now, from the [`0.x` branch](https://github.com/lxsmnsyc/solid-optimizer/tree/0.x).
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
npm i -D solid-optimizer
|
|
18
|
+
npm i -D solid-optimizer
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
yarn add -D solid-optimizer
|
|
22
|
+
yarn add -D solid-optimizer
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
pnpm add -D solid-optimizer
|
|
26
|
+
pnpm add -D solid-optimizer
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
## Usage
|
|
@@ -232,7 +232,7 @@ Inlining accepts two differences:
|
|
|
232
232
|
- A prop called as `props.name()` runs with its own receiver as `this`, not the props object.
|
|
233
233
|
- Moved statements run before the host's JSX is created. The order of effect registration between siblings can change.
|
|
234
234
|
|
|
235
|
-
|
|
235
|
+
The source map points each copied character at the one it copies, so inlined JSX maps to the component's own JSX and a prop value to the call site's attribute. Code a pass writes itself, such as a folded constant or a renamed local, maps to what it replaces.
|
|
236
236
|
|
|
237
237
|
#### Only where it is smaller
|
|
238
238
|
|