FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs(events,mutations,platform_metrics): add API reference pages by ernesthenry · Pull Request #34 · pythonnative/pythonnative · GitHub

Repository navigation

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .md  (4) .yml  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
21 changes: 21 additions & 0 deletions docs/api/events.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Events

Tag-based event routing between native views and Python callbacks.
The reconciler strips callable props from view payloads and registers
them in a Python-side registry keyed by `(tag, name)`. Native listeners
dispatch through [`dispatch_event`][pythonnative.events.dispatch_event],
meaning re-renders that only update closure identities don't trigger native
calls across the bridge.

::: pythonnative.events
options:
show_root_heading: false
show_root_toc_entry: false
members_order: source
filters: ["!^_"]

## Next steps

- See how native views are updated and wired in [Native views](native_views.md).
- Read about mutation ops in [Mutations](mutations.md).
- Learn about touch and gesture handling in [Gestures](gestures.md).
21 changes: 21 additions & 0 deletions docs/api/mutations.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Mutations

Batched mutation protocol between the reconciler and native backends.
During the commit phase, the reconciler produces an ordered list of
mutation operations (`CreateOp`, `InsertOp`, `UpdateOp`, `SetFrameOp`,
`DestroyOp`) referencing integer tags. The entire transaction is applied
in a single batch via [`apply_mutations`][pythonnative.native_views.NativeViewRegistry.apply_mutations],
minimizing bridge crossings.

::: pythonnative.mutations
options:
show_root_heading: false
show_root_toc_entry: false
members_order: source
filters: ["!^_"]

## Next steps

- Read how the virtual view tree is diffed in [Reconciler](reconciler.md).
- See how mutation operations map to platform widgets in [Native views](native_views.md).
- Read the high-level reconciliation model in [Reconciliation](../concepts/reconciliation.md).
21 changes: 3 additions & 18 deletions docs/api/native_views.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,6 @@ the platform-specific handlers are registered lazily so importing
members_order: source
filters: ["!^_"]

## Mutation ops

::: pythonnative.mutations
options:
show_root_heading: false
show_root_toc_entry: false
members_order: source
filters: ["!^_"]

## Event routing

::: pythonnative.events
options:
show_root_heading: false
show_root_toc_entry: false
members_order: source
filters: ["!^_"]

## Base classes

::: pythonnative.native_views.base
Expand All @@ -56,6 +38,9 @@ the platform-specific handlers are registered lazily so importing

## Next steps

- See the mutation ops protocol in [Mutations](mutations.md).
- See tag-based event routing in [Events](events.md).
- Read the high-level model in
[Native views (concept)](../concepts/native-views.md).
- See how the reconciler drives handlers in [Reconciler](reconciler.md).

19 changes: 19 additions & 0 deletions docs/api/platform_metrics.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Platform metrics

Platform-level metrics shared between screen hosts and native view handlers.
The screen host writes window metrics, safe-area insets, and keyboard heights,
which view handlers query on demand in layout units (`pt` on iOS, `dp` on Android)
to size bars and insets correctly without manual threading through measurement signatures.

::: pythonnative.platform_metrics
options:
show_root_heading: false
show_root_toc_entry: false
members_order: source
filters: ["!^_"]

## Next steps

- See how platform detection works in [Platform](platform.md).
- Learn how screens host root views in [Screen](screen.md).
- Read about platform and accessibility integration in the [Platform & Accessibility guide](../guides/platform-accessibility.md).
3 changes: 3 additions & 0 deletions mkdocs.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ nav:
- Navigation: api/navigation.md
- Native modules: api/native_modules.md
- Native views: api/native_views.md
- Events: api/events.md
- Mutations: api/mutations.md
- Platform metrics: api/platform_metrics.md
- SDK: api/sdk.md
- Hot reload: api/hot_reload.md
- Diagnostics: api/diagnostics.md
Expand Down
Loading

Back | FazBrowse Home | New Git URL