@pyreon/runtime-dom 0.13.1 → 0.15.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 +23 -0
- package/lib/analysis/index.js.html +1 -1
- package/lib/analysis/keep-alive-entry.js.html +5406 -0
- package/lib/analysis/transition-entry.js.html +5406 -0
- package/lib/index.js +156 -57
- package/lib/keep-alive-entry.js +1342 -0
- package/lib/transition-entry.js +168 -0
- package/lib/types/index.d.ts +54 -5
- package/lib/types/keep-alive-entry.d.ts +41 -0
- package/lib/types/transition-entry.d.ts +59 -0
- package/package.json +17 -6
- package/src/delegate.ts +16 -0
- package/src/hydrate.ts +23 -14
- package/src/hydration-debug.ts +99 -14
- package/src/index.ts +30 -6
- package/src/keep-alive-entry.ts +3 -0
- package/src/keep-alive.ts +5 -1
- package/src/mount.ts +160 -56
- package/src/nodes.ts +62 -13
- package/src/props.ts +1 -2
- package/src/template.ts +57 -2
- package/src/tests/coverage-gaps.test.ts +709 -0
- package/src/tests/dev-gate-pattern.test.ts +17 -11
- package/src/tests/dev-gate-treeshake.test.ts +20 -26
- package/src/tests/hydration-integration.test.tsx +166 -1
- package/src/tests/lis-prepend.browser.test.ts +99 -0
- package/src/tests/mount.test.ts +91 -0
- package/src/tests/native-markers.test.ts +19 -0
- package/src/tests/runtime-dom.browser.test.ts +121 -7
- package/src/tests/show-context.test.ts +93 -0
- package/src/tests/template.test.ts +135 -1
- package/src/transition-entry.ts +7 -0
- package/src/transition-group.ts +6 -1
- package/src/transition.ts +11 -3
- package/lib/index.js.map +0 -1
- package/lib/types/index.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -107,14 +107,37 @@ const App = () => (
|
|
|
107
107
|
- **`Transition`** -- Animates a single child on enter/leave with CSS classes or JS hooks.
|
|
108
108
|
- **`TransitionGroup`** -- Animates a list of keyed children, including move transitions.
|
|
109
109
|
|
|
110
|
+
Also available as a separate subpath export for apps that don't use animations:
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
import { Transition, TransitionGroup } from '@pyreon/runtime-dom/transition'
|
|
114
|
+
```
|
|
115
|
+
|
|
110
116
|
### KeepAlive
|
|
111
117
|
|
|
112
118
|
- **`KeepAlive`** -- Caches inactive component subtrees instead of destroying them.
|
|
113
119
|
|
|
120
|
+
Also available as a separate subpath export:
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
import { KeepAlive } from '@pyreon/runtime-dom/keep-alive'
|
|
124
|
+
```
|
|
125
|
+
|
|
114
126
|
### Types
|
|
115
127
|
|
|
116
128
|
`TransitionProps`, `TransitionGroupProps`, `KeepAliveProps`, `SanitizeFn`, `DevtoolsComponentEntry`, `PyreonDevtools`
|
|
117
129
|
|
|
130
|
+
## Production Performance
|
|
131
|
+
|
|
132
|
+
The mount pipeline is optimized for zero unnecessary allocations:
|
|
133
|
+
|
|
134
|
+
- **Devtools gated on `__DEV__`** -- Component ID generation (`Math.random`), parent/child tracking (`_mountingStack`), and `registerComponent`/`unregisterComponent` are all behind `if (__DEV__)`. Vite tree-shakes the entire devtools module from production bundles.
|
|
135
|
+
- **Lazy LifecycleHooks** -- `mount`/`unmount`/`update`/`error` arrays start as `null`, allocated on first hook registration. Components with no hooks (80%+) skip all hook iteration.
|
|
136
|
+
- **Lazy mountCleanups** -- Only allocated when an `onMount` callback returns a cleanup function.
|
|
137
|
+
- **makeReactiveProps scan-first** -- Scans for `_rp()` brands before allocating the getter-backed object. Static-only components return `raw` immediately.
|
|
138
|
+
- **renderEffect first-run skip** -- Skips cleanup on first run since the deps array is empty.
|
|
139
|
+
- **Text .data no-op writes** -- `_bindText` and `_bindDirect` skip DOM writes when the value hasn't changed.
|
|
140
|
+
|
|
118
141
|
## Dev-mode warnings — bundler tree-shake
|
|
119
142
|
|
|
120
143
|
Dev warnings are gated on `import.meta.env?.DEV`. Tree-shake behavior depends on both the source pattern and the consumer bundler:
|
|
@@ -5386,7 +5386,7 @@ var drawChart = (function (exports) {
|
|
|
5386
5386
|
</script>
|
|
5387
5387
|
<script>
|
|
5388
5388
|
/*<!--*/
|
|
5389
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"uid":"
|
|
5389
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"uid":"707cac82-1","name":"delegate.ts"},{"uid":"707cac82-3","name":"hydration-debug.ts"},{"uid":"707cac82-5","name":"devtools.ts"},{"uid":"707cac82-7","name":"nodes.ts"},{"uid":"707cac82-9","name":"props.ts"},{"uid":"707cac82-11","name":"mount.ts"},{"uid":"707cac82-13","name":"hydrate.ts"},{"uid":"707cac82-15","name":"keep-alive.ts"},{"uid":"707cac82-17","name":"template.ts"},{"uid":"707cac82-19","name":"transition.ts"},{"uid":"707cac82-21","name":"transition-group.ts"},{"uid":"707cac82-23","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"707cac82-1":{"renderedLength":2090,"gzipLength":1029,"brotliLength":0,"metaUid":"707cac82-0"},"707cac82-3":{"renderedLength":1395,"gzipLength":718,"brotliLength":0,"metaUid":"707cac82-2"},"707cac82-5":{"renderedLength":7009,"gzipLength":2149,"brotliLength":0,"metaUid":"707cac82-4"},"707cac82-7":{"renderedLength":16850,"gzipLength":4538,"brotliLength":0,"metaUid":"707cac82-6"},"707cac82-9":{"renderedLength":7955,"gzipLength":3028,"brotliLength":0,"metaUid":"707cac82-8"},"707cac82-11":{"renderedLength":12232,"gzipLength":3882,"brotliLength":0,"metaUid":"707cac82-10"},"707cac82-13":{"renderedLength":8312,"gzipLength":2472,"brotliLength":0,"metaUid":"707cac82-12"},"707cac82-15":{"renderedLength":1498,"gzipLength":713,"brotliLength":0,"metaUid":"707cac82-14"},"707cac82-17":{"renderedLength":5802,"gzipLength":2272,"brotliLength":0,"metaUid":"707cac82-16"},"707cac82-19":{"renderedLength":4929,"gzipLength":1410,"brotliLength":0,"metaUid":"707cac82-18"},"707cac82-21":{"renderedLength":7973,"gzipLength":2085,"brotliLength":0,"metaUid":"707cac82-20"},"707cac82-23":{"renderedLength":985,"gzipLength":549,"brotliLength":0,"metaUid":"707cac82-22"}},"nodeMetas":{"707cac82-0":{"id":"/src/delegate.ts","moduleParts":{"index.js":"707cac82-1"},"imported":[{"uid":"707cac82-24"}],"importedBy":[{"uid":"707cac82-22"},{"uid":"707cac82-12"},{"uid":"707cac82-8"}]},"707cac82-2":{"id":"/src/hydration-debug.ts","moduleParts":{"index.js":"707cac82-3"},"imported":[],"importedBy":[{"uid":"707cac82-22"},{"uid":"707cac82-12"}]},"707cac82-4":{"id":"/src/devtools.ts","moduleParts":{"index.js":"707cac82-5"},"imported":[],"importedBy":[{"uid":"707cac82-22"},{"uid":"707cac82-10"}]},"707cac82-6":{"id":"/src/nodes.ts","moduleParts":{"index.js":"707cac82-7"},"imported":[{"uid":"707cac82-25"},{"uid":"707cac82-24"}],"importedBy":[{"uid":"707cac82-12"},{"uid":"707cac82-10"}]},"707cac82-8":{"id":"/src/props.ts","moduleParts":{"index.js":"707cac82-9"},"imported":[{"uid":"707cac82-25"},{"uid":"707cac82-24"},{"uid":"707cac82-0"}],"importedBy":[{"uid":"707cac82-22"},{"uid":"707cac82-12"},{"uid":"707cac82-10"}]},"707cac82-10":{"id":"/src/mount.ts","moduleParts":{"index.js":"707cac82-11"},"imported":[{"uid":"707cac82-25"},{"uid":"707cac82-24"},{"uid":"707cac82-4"},{"uid":"707cac82-6"},{"uid":"707cac82-8"}],"importedBy":[{"uid":"707cac82-22"},{"uid":"707cac82-12"},{"uid":"707cac82-14"},{"uid":"707cac82-16"},{"uid":"707cac82-20"}]},"707cac82-12":{"id":"/src/hydrate.ts","moduleParts":{"index.js":"707cac82-13"},"imported":[{"uid":"707cac82-25"},{"uid":"707cac82-24"},{"uid":"707cac82-0"},{"uid":"707cac82-2"},{"uid":"707cac82-10"},{"uid":"707cac82-6"},{"uid":"707cac82-8"}],"importedBy":[{"uid":"707cac82-22"}]},"707cac82-14":{"id":"/src/keep-alive.ts","moduleParts":{"index.js":"707cac82-15"},"imported":[{"uid":"707cac82-25"},{"uid":"707cac82-24"},{"uid":"707cac82-10"}],"importedBy":[{"uid":"707cac82-22"}]},"707cac82-16":{"id":"/src/template.ts","moduleParts":{"index.js":"707cac82-17"},"imported":[{"uid":"707cac82-24"},{"uid":"707cac82-10"}],"importedBy":[{"uid":"707cac82-22"}]},"707cac82-18":{"id":"/src/transition.ts","moduleParts":{"index.js":"707cac82-19"},"imported":[{"uid":"707cac82-25"},{"uid":"707cac82-24"}],"importedBy":[{"uid":"707cac82-22"}]},"707cac82-20":{"id":"/src/transition-group.ts","moduleParts":{"index.js":"707cac82-21"},"imported":[{"uid":"707cac82-25"},{"uid":"707cac82-24"},{"uid":"707cac82-10"}],"importedBy":[{"uid":"707cac82-22"}]},"707cac82-22":{"id":"/src/index.ts","moduleParts":{"index.js":"707cac82-23"},"imported":[{"uid":"707cac82-0"},{"uid":"707cac82-12"},{"uid":"707cac82-2"},{"uid":"707cac82-14"},{"uid":"707cac82-10"},{"uid":"707cac82-8"},{"uid":"707cac82-16"},{"uid":"707cac82-18"},{"uid":"707cac82-20"},{"uid":"707cac82-4"}],"importedBy":[],"isEntry":true},"707cac82-24":{"id":"@pyreon/reactivity","moduleParts":{},"imported":[],"importedBy":[{"uid":"707cac82-0"},{"uid":"707cac82-12"},{"uid":"707cac82-14"},{"uid":"707cac82-10"},{"uid":"707cac82-8"},{"uid":"707cac82-16"},{"uid":"707cac82-18"},{"uid":"707cac82-20"},{"uid":"707cac82-6"}]},"707cac82-25":{"id":"@pyreon/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"707cac82-12"},{"uid":"707cac82-14"},{"uid":"707cac82-10"},{"uid":"707cac82-8"},{"uid":"707cac82-18"},{"uid":"707cac82-20"},{"uid":"707cac82-6"}]}},"env":{"rollup":"4.23.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
5390
5390
|
|
|
5391
5391
|
const run = () => {
|
|
5392
5392
|
const width = window.innerWidth;
|