solid-optimizer 1.0.0-next.6 → 1.0.0-next.8

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 CHANGED
@@ -8,6 +8,8 @@
8
8
 
9
9
  ![A small app compiled by Solid's JSX transform alone and with solid-optimizer first. The optimized build has 1 template instead of 5, and its server HTML has 1 hydration key instead of 4.](https://github.com/lxsmnsyc/solid-optimizer/blob/main/examples/showcase/comparison.png?raw=true)
10
10
 
11
+ The website, [solid-optimizer.vercel.app](https://solid-optimizer.vercel.app), shows each pass and the benchmarks for the example apps.
12
+
11
13
  ## Install
12
14
 
13
15
  The Solid 2.0 version is published under the `next` tag. The `latest` version is for Solid 1.x, which only gets fixes now, from the [`0.x` branch](https://github.com/lxsmnsyc/solid-optimizer/tree/0.x).
@@ -140,7 +142,7 @@ Each line is a pass, a reason, how many times it happened, and the names it happ
140
142
  - `no-host` means the component has statements, and the call is not in JSX that a component or one of Solid's callbacks returns. A `<Show>` child or a `fallback` is one such place.
141
143
  - `size` means the copies would be larger than the calls.
142
144
  - `lazy`, `imported`, `nested`, and `not-a-function` mean the tag is not a component declared at the top of the same module or chunk.
143
- - A reason that starts with `copy-` is about copying a component from another module. `copy-package` means it comes from a package in `node_modules` that `optimizer.packages` does not list, `copy-cycle` means the two modules import each other, `copy-wrapper` means the component only returns a call of another component in its module, and `copy-size` means the copy was larger.
145
+ - A reason that starts with `copy-` is about copying a component from another module. `copy-package` means it comes from a package in `node_modules` that `optimizer.packages` does not list, `copy-cycle` means the component's module imports the importer back, directly or through other modules, a listed package, or a virtual module, `copy-virtual` means the copy would import a virtual module that its specifier does not reach from the importer, `copy-wrapper` means the component only returns a call of another component in its module, and `copy-size` means the copy was larger.
144
146
 
145
147
  The provider pass reports `open-component`, `open-call`, `open-new`, `open-spread`, and `open-outer` for code under the provider that it cannot see into, and `provider-value`, `provider-undefined`, and `provider-shape` for a value or provider it cannot handle. The memo pass reports `memo-reads`, `memo-read-place`, `memo-constant`, and a few more for a memo it keeps, and `signal-constant` for a signal that nothing writes but that is used other than by calling it.
146
148
 
@@ -199,7 +201,7 @@ Solid then creates one template for `<main>` instead of two.
199
201
 
200
202
  A component inlines when all of these hold:
201
203
 
202
- - It is declared once at the top level, with a capitalized name. A call through an alias, like `const Separator = SeparatorRoot`, is a call of the component it names.
204
+ - It is declared once at the top level, with a capitalized name. A call through an alias, like `const Separator = SeparatorRoot`, is a call of the component it names. So is a call through a compound component, like Kobalte's `const Dialog = Object.assign(DialogRoot, { Trigger: DialogTrigger })`: `<Dialog>` calls `DialogRoot` and `<Dialog.Trigger>` calls `DialogTrigger`, as long as nothing writes to a member of either.
203
205
  - Its parameter is one identifier that is only read as `props.name`, spread onto an element as `{...props}`, or passed to `merge()` and `omit()`. See below.
204
206
  - Its body ends in the only `return`, and that `return` returns JSX.
205
207
  - It does not use `this`, `arguments`, `super`, or `new.target`.