solid-optimizer 1.0.0-next.4 → 1.0.0-next.5

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
@@ -49,6 +49,7 @@ The input and the output both keep their JSX. Run the JSX transform after `compi
49
49
  - `sharedComponents` maps top-level components that other modules use too to the number of modules that use them, this one included. Inlining one only counts its share of the declaration. `0` keeps the declaration whatever is inlined.
50
50
  - `contexts` turns context provider removal on or off. Defaults to `true`.
51
51
  - `memos` turns memo inlining on or off. Defaults to `true`.
52
+ - `conditionals` turns `<Show>` and `<Switch>` lowering on or off. A `<Show>` without `keyed` becomes a ternary, which Solid's JSX transform compiles to one memo instead of a component and three memos. A callback child like `{(user) => <b>{user().name}</b>}` becomes its body, with `user()` read as `when` again, when `when` reads names, members, and signal or memo getters. A `<Switch>` of such `<Match>`es becomes a chain of ternaries. Defaults to `true`.
52
53
  - `builtIns` lists the names of Solid's built-in components. A tag only folds when it is one of them. An empty list turns control-flow folding off.
53
54
  - `moduleSources` lists the modules Solid's built-ins are imported from. Defaults to `['solid-js', '@solidjs/web']`.
54
55
  - `importedConstants` holds the constants of imported modules, keyed by the import specifier as the code writes it, then by export name. An import of one of them folds like a local `const`. See [Constants from other modules](#constants-from-other-modules).
@@ -113,7 +114,7 @@ The optimizer is off while serving. Set `optimizer.dev` to run module mode in de
113
114
  The plugin takes every option of `@solidjs/vite-plugin`, plus `optimizer`.
114
115
 
115
116
  - `optimizer: false` uses `@solidjs/vite-plugin` as it is.
116
- - `optimizer.fold`, `optimizer.inline`, `optimizer.alwaysInline`, `optimizer.contexts`, `optimizer.memos`, and `optimizer.maxPasses` work like the `compile` options.
117
+ - `optimizer.fold`, `optimizer.inline`, `optimizer.alwaysInline`, `optimizer.contexts`, `optimizer.memos`, `optimizer.conditionals`, and `optimizer.maxPasses` work like the `compile` options.
117
118
  - `optimizer.mode` is `'auto'` by default. Set it to `'module'` to never keep JSX through bundling.
118
119
  - `optimizer.dev` also optimizes while serving. Defaults to `false`.
119
120
  - `optimizer.report` reports what stays as written in each build, and why. `true` prints it. A function receives it instead, once per build environment. Defaults to `false`.