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

feat!: add typed navigation, themes, stores, and hook linting by owenthcarey · Pull Request #109 · pythonnative/pythonnative · GitHub

feat!: add typed navigation, themes, stores, and hook linting - #109

Merged
owenthcarey merged 2 commits into
mainfrom
feat/pythonic-authoring-model
Oct 2, 2026
Merged

owenthcarey merged 2 commits into
mainfrom
feat/pythonic-authoring-model

Conversation

Copy link
Copy Markdown
Contributor

Make the authoring API typed, Pythonic, and ready for 1.0, while breaking changes are still cheap. See rfcs/0004-pythonic-authoring-model.md.

  • Typed element trees: pn.Node children, .with_key() for user components, shared AccessibilityProps / ViewProps, and dev-mode prop checks against component annotations.
  • Typed navigation: screens are components whose parameters are their route params; navigators are module-level values (pn.StackNavigator(...)); nav.push(ItemScreen(id=42)) is checked by the type checker; static nesting, use_screen_options, and deep links from screen paths converted by annotations.
  • One Theme (colors, typography, spacing, radii) for the app and its navigators, ThemeProvider, use_theme(Subclass), use_styles, and StyleSheet namespaces. The spacing style key is removed everywhere.
  • pn.Store and use_store selectors; bound-method dependency equality, use_persisted_state, and transition-queue fixes.
  • Reconciler identity bailout and a per-provider context consumer registry.
  • pn lint for the rules of hooks; Fast Refresh remounts only when a class definition changes.
  • A per-user dev-server token with same-origin websockets; release bundles omit development modules.
  • Strict typing: strict_optional, no blanket suppressions, strict mypy for the Inbox and e2e apps, and typing conformance tests.
  • Examples, templates, tests, and documentation move to the new API.

BREAKING CHANGE: navigation factories, route-name navigation, LinkingConfig, NavigationTheme, the flat Theme fields, StyleSheet.create, the spacing style key, Component.keyed, and key= on user components are removed without compatibility shims. See the RFC's Removals section.

Make the authoring API typed, Pythonic, and ready for 1.0, while
breaking changes are still cheap. See rfcs/0004-pythonic-authoring-model.md.

- Typed element trees: `pn.Node` children, `.with_key()` for user
  components, shared `AccessibilityProps` / `ViewProps`, and dev-mode
  prop checks against component annotations.
- Typed navigation: screens are components whose parameters are their
  route params; navigators are module-level values
  (`pn.StackNavigator(...)`); `nav.push(ItemScreen(id=42))` is checked
  by the type checker; static nesting, `use_screen_options`, and deep
  links from screen `path`s converted by annotations.
- One `Theme` (colors, typography, spacing, radii) for the app and its
  navigators, `ThemeProvider`, `use_theme(Subclass)`, `use_styles`, and
  `StyleSheet` namespaces. The `spacing` style key is removed everywhere.
- `pn.Store` and `use_store` selectors; bound-method dependency equality,
  `use_persisted_state`, and transition-queue fixes.
- Reconciler identity bailout and a per-provider context consumer
  registry.
- `pn lint` for the rules of hooks; Fast Refresh remounts only when a
  class definition changes.
- A per-user dev-server token with same-origin websockets; release
  bundles omit development modules.
- Strict typing: `strict_optional`, no blanket suppressions, strict mypy
  for the Inbox and e2e apps, and typing conformance tests.
- Examples, templates, tests, and documentation move to the new API.

BREAKING CHANGE: navigation factories, route-name navigation,
LinkingConfig, NavigationTheme, the flat Theme fields, StyleSheet.create,
the `spacing` style key, Component.keyed, and `key=` on user components
are removed without compatibility shims. See the RFC's Removals section.
A module-level ListData (for example, the Inbox repository's) is built at import time, which runs on the device's main thread rather than the application loop thread. Subscribing from the app thread then raised. The first thread that subscribes or mutates now owns the collection.

Also give the iOS lifecycle test's settle wait room for a loaded CI simulator.
owenthcarey merged commit 109008e into main Oct 2, 2026
44 of 45 checks passed
owenthcarey deleted the feat/pythonic-authoring-model branch October 2, 2026 05:17
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL