Feat: rework of codebase to enable InfiniFrameApplication - #422
Open
AnnaSasDev wants to merge 38 commits into
Open
Feat: rework of codebase to enable InfiniFrameApplication#422AnnaSasDev wants to merge 38 commits into
AnnaSasDev wants to merge 38 commits into
Conversation
This change introduces a process-scoped InfiniFrameApplication registry for native windows and connects it to the Win32, GTK, and Cocoa window constructors/destructors. It also adds managed application abstractions for registering, building, running, and shutting down windows through a shared application model. The new API exposes IInfiniFrameApplication and InfiniFrameApplication in the managed layer, supporting named and unnamed window registration, lazy creation, lookup, and shutdown semantics while preserving the current per-window native loop behavior until a full app-level loop is introduced.
Introduce a native application lifecycle and managed integration: add NativeApplicationHandle (SafeHandle) and LibraryImport bindings for application ctor/register/run/shutdown/dtor (and GetWindowCount). Implement native exports to create/register/run/shutdown/destroy InfiniFrameApplication and track window counts. Add application lifecycle methods (Register/Run/Shutdown/NotifyWindowClosed) and thread-aware Windows message loop; ensure app quits when last window closes. Update Win32 window code to notify application and adjust show/track ordering. Managed InfiniFrameApplication now constructs/ registers native app, runs native loop, and shuts down/ disposes native handle. Also warm WebView2 CDP connection in tests setup.
This introduces application-owned web server registration and shutdown hooks, centralizes window builder registration, and updates the native Windows app to reuse process-wide notification and AppUserModelId settings. It also updates examples/tests to the new builder pattern and adds safeguards for desktop startup collisions under parallel test execution.
Introduces application-centric initialization for web server and Blazor WebView scenarios via InfiniFrameApplication.Initialize().WithWebServer/WithBlazorWebView. The app now defers startup until Run/RunAsync, tracks startup and shutdown actions, supports late web app configuration, and updates examples and tests to use the new lifecycle.
…tifications This commit integrates application-first window and lifecycle management, centralizes notification initialization, overhauls native app loops, and refactors examples to use modern patterns. Includes API additions for shutdown, window creation/destruction events, and refined cross-platform behavior.
Introduce InfiniFrameApplicationBuilder and application-first integration APIs (UseBlazorWebView, UseWebServer, WithWindow). Add InfiniFrameBlazorWebViewConfiguration, InfiniFrameWebServerConfiguration and ApplicationConfiguration record. Move Blazor/WebServer wiring into builder/configuration objects, attach service provider lifecycle, register window conventions, and support single-file file providers. Remove legacy InfiniFrameBlazorApp/Builders and many old WebServer builder types. Update examples, tests, and README to use the new CreateBuilder()/Use...() pattern and adjust SingleFile API. Ensure proper service-provider disposal and improved startup/shutdown integration.
- Updated `BlazorPlaywrightContextBase` to implement explicit timeout handling for Blazor app startup and CDP endpoint probing, with custom `TimeoutException` messages. - Ensured proper disposal of resources and adjusted exception paths for cancellation scenarios. - Refactored `InfiniFrameApplication` window lifecycle to invoke `WindowCreated` event post-construction. - Improved service provider lifecycle management in `InfiniFrameApplicationBuilder`. - Moved `IInfiniFrameWindow` registration to support delayed window resolution.
… processing across WebView and Blazor scenarios.
This change adds standard import/code section divider comments to the BlazorWebView extension file for readability and consistency. No functional behavior was changed.
- Introduced `TakeWindowConfiguration` in `InfiniFrameApplicationBuilder` to support unnamed window handling in integrations. - Ensured window validation with `IValidator<InfiniFrameNativeParameters>` happens before resolution in `InfiniFrameWindowBuilder`. - Updated BlazorWebView integration to apply unnamed window configurations correctly. - Added related tests to verify validation and unnamed window handling functionality.
…or improved platform consistency.
…an up legacy code for modularity.
…for better organization. Update CMakeLists.txt accordingly.
…ndow, Security, StaticAssets, Interop) and update dependencies across tests and workflows.
…es to `InfiniFrame.Js` and `InfiniFrame.Window` modules. Update references across projects, tests, and workflows accordingly.
…nd `Window` submodules. Update imports across the solution to reflect the changes.
…Parameters` with unit tests.
…for multi-window support, and streamline dependency handling across tests.
This change adds a single-run guard to InfiniFrameApplication, serializes window disposal, and ensures builder-owned service providers are cleaned up on failed window creation. It also enforces single-window BlazorWebView targeting, normalizes WebServer startup/shutdown and wildcard URL handling, and updates docs/tests for the new application-first APIs.
Multiple fixes and enhancements: - Prevent registering windows once the application run has started. - Use configured InfiniFrameBlazorAppConfiguration.AppBaseUri for HttpClient (and add test); WebViewManager now stores _appBaseUri and fixes message-origin logic. - Native bridge: return success status from ApplicationDestructor SafeHandle release; native C++ tracks closed windows, fixes NotifyWindowClosed/Track/Untrack logic, and returns thread_local strings under lock for stable C-string returns. - WebServer: ensure WebApplication is disposed on Build failures. - Window lifecycle: maintain parent/child lists on creation and detach on dispose; adjust teardown to keep native callback/milestone roots alive until native closed. - Docs: clarify which packages are validated by NativeAOT smoke publish. These changes address cleanup/ownership bugs, improve AOT/Blazor configuration correctness, and harden shutdown behavior.
This commit hardens native initialization and lifecycle teardown. It enforces required embedded single-file native resources, improves disposal error handling for application and window shutdown, and preserves child-window cleanup behavior. It also updates packaging/build paths, refreshes docs for the NativeBridge layout and singleton-file API naming, removes stale native clean targets, and modernizes the Blazor static asset configuration.
This commit improves application and window lifecycle management. It hardens shutdown behavior by ensuring complete teardown milestones are observed before native handle release, refines Windows message pump logic to defer shutdown until all windows reach proper states, and optimizes service provider disposal. It also introduces new tests for shutdown scenarios, ensures better native/managed synchronization, and simplifies teardown logic for both native and managed components.
This commit adds a `ReadyFailureCallback` mechanism to handle WebView2 initialization failures. It enhances window lifecycle management by enforcing completion milestones before disposal, adjusts the message pump logic to handle `WM_CLOSE` for tracked windows on `WM_QUIT`, and introduces robust window tracking for natural closures. Additionally, it modernizes disposal
This commit introduces extensive tests for multi-window lifecycle management, BlazorWebView configurations, and WebServer integrations. It includes new scenarios for file-based windows, independent server configurations, BlazorWebView targeting, and proper handling of sibling window closures. These additions enhance coverage for complex application behaviors and ensure robust testing of window and application lifecycle events.
…NET 8, 9, and 10.
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.