Skip to content

Use public API imports in examples, tests, and website - #5884

Merged
falkoschindler merged 1 commit into
mainfrom
use-public-api-imports
Mar 16, 2026
Merged

Use public API imports in examples, tests, and website#5884
falkoschindler merged 1 commit into
mainfrom
use-public-api-imports

Conversation

@falkoschindler

@falkoschindler falkoschindler commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Motivation

Non-library code (examples, tests, website, testing utilities) was importing internal modules directly (e.g. from nicegui.element import Element, from nicegui.events import handle_event). These should use the public API (ui.element, events.handle_event, etc.) to stay resilient against internal restructuring.

Implementation

Mechanical replacement of internal imports with their public API equivalents across examples/, tests/, website/, and nicegui/testing/. No behavioral changes.

Progress

  • I chose a meaningful title that completes the sentence: "If applied, this PR will..."
  • The implementation is complete.
  • This is not a security issue.
  • Pytests are not necessary.
  • Documentation is not necessary.

🤖 Generated with Claude Code

Replace direct internal module imports (e.g. `from nicegui.element import Element`)
with public API equivalents (`ui.element`, `events.handle_event`, etc.) in non-library code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@falkoschindler falkoschindler added feature Type/scope: New or intentionally changed behavior documentation Type/scope: Documentation, examples and website review Status: PR is open and needs review and removed feature Type/scope: New or intentionally changed behavior labels Mar 16, 2026
@falkoschindler falkoschindler added this to the 3.9 milestone Mar 16, 2026

@evnchn evnchn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. And the tests help catch regression

@falkoschindler
falkoschindler added this pull request to the merge queue Mar 16, 2026
Merged via the queue into main with commit 49bb838 Mar 16, 2026
7 checks passed
@falkoschindler
falkoschindler deleted the use-public-api-imports branch March 16, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Type/scope: Documentation, examples and website review Status: PR is open and needs review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants