Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pytauri)!: add BuilderArgs::setup to support setup hook #80

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

WSH032
Copy link
Owner

@WSH032 WSH032 commented Feb 18, 2025

Summary

Added:

  • add BuilderArgs::setup
  • BuilderArgs::context now can be Position and Keyword arguments
  • add PyAppHandleExt::get_or_init_py_app_handle, and the methods return &Py<AppHandle> instead of impl Deref<Target = Py<AppHandle>> now.

Docs:

  • example/nicegui-app:
    • Use BuilderArgs.setup for initialization instead of listening to the RunEvent.Ready event.
    • Rewrite the FrontServer startup/shutdown event hook logic.
    • Modularize the code.

BREAKING CHANGE:

  • trait PyAppHandleExt is now sealed and no longer has generic parameters.

Checklist

  • I've read CONTRIBUTING.md.
  • I understand that this PR may be closed in case there was no previous discussion/issue. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation and/or CHANGELOG.md accordingly.

Added:

- add `BuilderArgs::setup`
- `BuilderArgs::context` now can be `Position and Keyword` arguments
- add `PyAppHandleExt::get_or_init_py_app_handle`, and the methods
  return `&Py<AppHandle>` instead of
  `impl Deref<Target = Py<AppHandle>>` now.

Docs:

- `example/nicegui-app`:
    - Use `BuilderArgs.setup` for initialization instead of listening to
      the `RunEvent.Ready` event.
    - Rewrite the `FrontServer` `startup`/`shutdown` event hook logic.
    - Modularize the code.

BREAKING CHANGE:

- `trait PyAppHandleExt` is now sealed and no longer has
  generic parameters.
@WSH032 WSH032 merged commit 47fe27d into main Feb 18, 2025
12 checks passed
@WSH032 WSH032 deleted the feat/setup branch February 18, 2025 08:23
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