@opentf/web 0.10.0 → 0.11.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 CHANGED
@@ -25,7 +25,8 @@ and drive it with [`@opentf/web-cli`](https://github.com/Open-Tech-Foundation/We
25
25
  `Portal`, `ErrorBoundary`, and event dispatch (`emit`).
26
26
  - **Compiler macros** — authored in your components, resolved at compile time:
27
27
  `$state`, `$derived`, `$ref`, `$context`, `$effect`, `$expose`, and the
28
- `onMount` / `onCleanup` lifecycle hooks.
28
+ `onMount` / `onCleanup` / `onResize` / `onVisibilityChange` / `onMediaQuery`
29
+ lifecycle hooks.
29
30
  - **`<Link>`** — client-side navigation, shipped as JSX source and compiled by your
30
31
  app's pipeline.
31
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentf/web",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "The native-first OTF Web runtime — signal-based reactivity and zero-VDOM DOM operations, paired with the IR-based compiler.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,9 +1,14 @@
1
- // Lifecycle hooks. `onMount`/`onCleanup` are compiler macros: the OpenTF
2
- // compiler collects their callbacks and wires them into a component's
3
- // connect/disconnect (Custom Element) or a page/layout factory's `__lifecycle`
4
- // record. These exports exist so the source-level `import { onMount } from
5
- // "@opentf/web"` resolves, and so calling them outside a compiled component (or
6
- // during SSR) is a safe no-op rather than a crash.
1
+ // Lifecycle hooks. `onMount`/`onCleanup`/`onResize`/`onMediaQuery`/
2
+ // `onVisibilityChange` are compiler macros: the OpenTF compiler collects their
3
+ // callbacks and wires them into a component's connect/disconnect (Custom
4
+ // Element) or a page/layout factory's `__lifecycle` record the DOM hooks
5
+ // desugar to ResizeObserver/IntersectionObserver/matchMedia setup with
6
+ // automatic teardown. These exports exist so the source-level `import {
7
+ // onMount } from "@opentf/web"` resolves, and so calling them outside a
8
+ // compiled component (or during SSR) is a safe no-op rather than a crash.
7
9
 
8
10
  export function onMount() {}
9
11
  export function onCleanup() {}
12
+ export function onResize() {}
13
+ export function onMediaQuery() {}
14
+ export function onVisibilityChange() {}