Skip to content

Conversation

@ysmoradi
Copy link
Member

@ysmoradi ysmoradi commented Oct 16, 2025

closes #11489

Summary by CodeRabbit

  • Refactor

    • Web interop app migrated to static HTML file; URL updated to /web-interop-app.html.
    • Removed server-side rendering of web interop component across MAUI and Windows clients.
  • Bug Fixes

    • SMTP configuration now always available in server settings (previously conditional).

@ysmoradi ysmoradi requested a review from Copilot October 16, 2025 09:40
@coderabbitai
Copy link

coderabbitai bot commented Oct 16, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The pull request converts WebInteropApp from a server-rendered Razor component to a static HTML file. It removes server-side rendering endpoints, updates all hardcoded URL references to use a centralized PageUrls constant, adds the static HTML as an asset to native projects, and simplifies build workflows.

Changes

Cohort / File(s) Change Summary
GitHub Workflows
.github/workflows/admin-sample.cd.yml, .github/workflows/todo-sample.cd.yml
Removed workflow steps that automated uncommenting of Route attributes via sed commands during the build phase.
Documentation Comments
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Scripts/WebInteropApp.ts, src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/Contracts/IExternalNavigationService.cs
Updated comment references from WebInteropApp.razor to Client.web/wwwroot/web-interop-app.html.
Static Asset Configuration
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Boilerplate.Client.Maui.csproj, src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Boilerplate.Client.Windows.csproj
Added Content items to include web-interop-app.html from web project with CopyToOutputDirectory set to PreserveNewest.
Local HTTP Server Implementations
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiLocalHttpServer.cs, src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsLocalHttpServer.cs
Removed HtmlRenderer dependency and deleted HTTP modules that previously rendered WebInteropApp component to HTML at /web-interop-app.
WebAuthn Services
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiWebAuthnService.cs, src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsWebAuthnService.cs
Replaced hardcoded "web-interop-app" path with PageUrls.WebInteropApp constant in navigation calls.
Service Worker
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js
Updated serverHandledUrls list entry from "/web-interop-app" to "/web-interop-app.html" to match new static file pattern.
Static HTML Page
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/web-interop-app.html
Simplified from Razor component with scaffolding directives to static HTML: removed Route attribute, Localizer injection, Blazor comments, Application Insights snippet, and replaced dynamic title with static text.
Server-Side Endpoint
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Endpoints/WebInteropAppEndpoint.cs
Removed entire WebInteropAppEndpoint class and its UseWebInteropApp() extension method that mapped GET /web-interop-app with HtmlRenderer-based component rendering.
Middleware Registration
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs
Removed using directive for Endpoints namespace and removed app.UseWebInteropApp() middleware registration call.
Identity Controller
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.SocialSignIn.cs
Replaced hardcoded "web-interop-app" path with PageUrls.WebInteropApp constant in SocialSignInCallback redirect URL construction.
Configuration
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json
Moved SMTP configuration entries outside conditional filesStorage == "S3" block, making them unconditionally present.
URL Constants
src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/PageUrls.cs
Added new public constant WebInteropApp = "/web-interop-app.html" for centralized URL reference.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Client
    participant Server
    participant StaticServer

    Note over User,StaticServer: OLD: Server-Rendered WebInteropApp
    User->>Server: GET /web-interop-app
    Server->>Server: HtmlRenderer: Render WebInteropApp.razor
    Server-->>Client: HTML (rendered component)
    Client->>User: Display WebInteropApp

    Note over User,StaticServer: NEW: Static HTML File
    User->>StaticServer: GET /web-interop-app.html
    StaticServer-->>Client: web-interop-app.html (static file)
    Client->>User: Display WebInteropApp

    Note over User,StaticServer: Navigation Path Updates
    Client->>Client: Navigation to PageUrls.WebInteropApp<br/>("/web-interop-app.html")
    Client->>StaticServer: Request static file
    StaticServer-->>Client: Static content served
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

The changes follow a consistent pattern of converting server-rendered component to static asset, affecting multiple systems (workflows, local servers, service worker, endpoints, configurations). While most modifications are straightforward removals and path replacements, they span diverse file types and require verification that static file serving works correctly across MAUI, Windows, and web platforms.

Poem

🐰 A tale of transformation,
From server-rendered pages to static files so bright,
WebInteropApp hops to a simpler sight,
No Razor, no rendering—just HTML light,
The boilerplate dances, more nimble in flight! 🚀

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning Most changes in the PR are directly related to the WebInteropApp fix objective; however, the modification to appsettings.json appears to be potentially out of scope. Specifically, moving the SMTP configuration block out of the conditional filesStorage == "S3" block is not clearly explained as part of fixing the WebInteropApp issue in Blazor WASM Standalone. While this change may be intentional and necessary for the WASM standalone environment, it is not documented or justified within the PR context and could represent an unrelated fix that should be addressed in a separate PR. Clarify the purpose of the SMTP configuration change in appsettings.json and explain how it relates to the WebInteropApp fix. If this change is unrelated to the primary objective, it should be moved to a separate PR to maintain clear scope and change history. If it is necessary for the fix, document the reasoning in the PR description or commit message.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "fix bit Boilerplate WebInteropApp's issue in Blazor Weasm Stadalone (#11489)" is clearly related to the primary change in the changeset and aligns with the linked issue #11489 about WebInteropApp not working in Blazor WebAssembly Standalone. The title accurately conveys the main objective of transitioning WebInteropApp from a server-rendered component to a static HTML page. However, the title contains two typos: "Weasm" should be "WASM" or "WebAssembly," and "Stadalone" should be "Standalone." Despite these orthographic errors, the title is sufficiently specific and descriptive for a teammate scanning the history to understand the primary change.
Linked Issues Check ✅ Passed The PR changes align with the objective of issue #11489: "resolve the malfunction of the bit Boilerplate WebInteropApp when running as a Blazor WebAssembly Standalone application." The changeset systematically transitions WebInteropApp from a server-rendered Razor component to a static HTML file by removing server-side rendering dependencies (HtmlRenderer, WebInteropAppEndpoint, middleware registration), updating all path references to the new static file location, and adding the static file to platform-specific project configurations. The removal of workflow steps that previously modified component routing and the consolidation of path references via PageUrls.WebInteropApp constant further support this objective.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the WebInteropApp implementation in the Bit Boilerplate template to address issues in Blazor WebAssembly Standalone deployments. The main change converts the WebInteropApp from a server-side rendered Blazor component to a static HTML file, eliminating the need for server-side rendering infrastructure in standalone scenarios.

Key Changes

  • Replace server-side WebInteropApp Blazor component with static HTML file
  • Update all references to use the new /web-interop-app.html path
  • Remove server-side endpoint and rendering logic for WebInteropApp

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Shared/PageUrls.cs Adds constant for the new HTML file path
src/Server/Boilerplate.Server.Web/Program.Middlewares.cs Removes server-side WebInteropApp endpoint registration
src/Server/Boilerplate.Server.Web/Endpoints/WebInteropAppEndpoint.cs Completely removes the server-side endpoint implementation
src/Server/Boilerplate.Server.Api/appsettings.json Minor reorganization of connection strings order
src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.SocialSignIn.cs Updates references to use new PageUrls constant and corrected comment path
src/Client/Boilerplate.Client.Windows/Services/WindowsWebAuthnService.cs Updates navigation URLs to use PageUrls constant
src/Client/Boilerplate.Client.Windows/Services/WindowsLocalHttpServer.cs Removes server-side rendering logic and updates comment references
src/Client/Boilerplate.Client.Windows/Boilerplate.Client.Windows.csproj Adds the static HTML file to build output
src/Client/Boilerplate.Client.Web/wwwroot/web-interop-app.html Converts from Blazor component syntax to standard HTML
src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js Updates service worker URL pattern for new file extension
src/Client/Boilerplate.Client.Maui/Services/MauiWebAuthnService.cs Updates navigation URLs to use PageUrls constant
src/Client/Boilerplate.Client.Maui/Services/MauiLocalHttpServer.cs Removes server-side rendering logic and updates comment references
src/Client/Boilerplate.Client.Maui/Boilerplate.Client.Maui.csproj Adds the static HTML file to build output
src/Client/Boilerplate.Client.Core/Services/Contracts/IExternalNavigationService.cs Updates comment reference to new file location
src/Client/Boilerplate.Client.Core/Scripts/WebInteropApp.ts Updates comment reference to new file location
.github/workflows/todo-sample.cd.yml Removes build step that was enabling WebInteropApp route
.github/workflows/admin-sample.cd.yml Removes build step that was enabling WebInteropApp route

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/web-interop-app.html (1)

121-122: app.js script file is missing and will cause runtime failures.

The script reference at line 122 to _content/Boilerplate.Client.Core/scripts/app.js does not have a corresponding source file. The directory src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/wwwroot/scripts/ does not exist, and no app.js file is present in the repository.

In MAUI/Windows environments, when this HTML loads, the browser will fail to fetch this script, resulting in a 404 error and broken functionality. Either create the missing app.js file in the expected location, or remove the script reference if it is no longer needed.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between bf3f7ab and 012b792.

📒 Files selected for processing (17)
  • .github/workflows/admin-sample.cd.yml (0 hunks)
  • .github/workflows/todo-sample.cd.yml (0 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Scripts/WebInteropApp.ts (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/Contracts/IExternalNavigationService.cs (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Boilerplate.Client.Maui.csproj (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiLocalHttpServer.cs (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiWebAuthnService.cs (2 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/web-interop-app.html (6 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Boilerplate.Client.Windows.csproj (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsLocalHttpServer.cs (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsWebAuthnService.cs (2 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.SocialSignIn.cs (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Endpoints/WebInteropAppEndpoint.cs (0 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs (0 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/PageUrls.cs (1 hunks)
💤 Files with no reviewable changes (4)
  • .github/workflows/admin-sample.cd.yml
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs
  • .github/workflows/todo-sample.cd.yml
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Endpoints/WebInteropAppEndpoint.cs
🧰 Additional context used
🪛 Biome (2.1.2)
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json

[error] 26-26: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 26-26: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 26-26: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 26-26: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 27-27: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 27-27: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 27-27: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 27-27: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build and test
🔇 Additional comments (14)
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Scripts/WebInteropApp.ts (1)

1-1: LGTM! Documentation updated to reflect static HTML migration.

The comment correctly references the new static HTML file location.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/Contracts/IExternalNavigationService.cs (1)

3-3: LGTM! Documentation updated consistently.

The comment correctly references the new static HTML file path.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiLocalHttpServer.cs (1)

11-11: LGTM! Removal of server-side rendering aligns with static HTML approach.

The comment update and removal of the HtmlRenderer-based WebInteropApp rendering module (mentioned in the summary) correctly reflects the migration to a static HTML asset.

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json (1)

26-27: Verify if SMTP configuration change is intentional.

The SMTP configuration has been moved outside the S3 conditional block, making it unconditional. This change appears unrelated to the WebInteropApp migration described in the PR objectives. Was this change intentional, or should it remain within the conditional block?

Note: The static analysis errors from Biome are false positives. Biome is attempting to parse this JSON file as JavaScript/TypeScript, which causes syntax errors. These can be safely ignored.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsWebAuthnService.cs (2)

19-19: LGTM! Centralized URL constant improves maintainability.

Replacing the hard-coded path with PageUrls.WebInteropApp provides a single source of truth for the WebInteropApp URL, making future changes easier to manage.


35-35: LGTM! Consistent use of centralized URL constant.

The same centralized constant is used here, ensuring consistency across both WebAuthn operations.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiWebAuthnService.cs (2)

18-18: LGTM! Centralized URL constant enhances consistency.

Using PageUrls.WebInteropApp instead of a hard-coded path ensures consistency across MAUI and Windows platforms.


33-33: LGTM! Consistent application of centralized URL.

The centralized constant is applied consistently across both credential operations.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Boilerplate.Client.Windows.csproj (1)

52-54: LGTM! Static asset properly configured for Windows client.

The Content item correctly includes the web-interop-app.html file and ensures it's copied to the output directory, aligning with the static HTML approach.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js (1)

100-100: LGTM! Service worker pattern updated for static HTML.

The URL pattern correctly matches the new .html extension, ensuring the service worker properly handles requests to the WebInteropApp page.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Boilerplate.Client.Maui.csproj (1)

122-124: LGTM - Static asset inclusion follows standard patterns.

The Content item correctly links the web-interop-app.html file from the sibling web project and ensures it's copied to the output directory. The relative path follows standard MSBuild conventions and any path issues would be caught at build time.

src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/PageUrls.cs (1)

47-48: LGTM - Centralized URL constant improves maintainability.

The new WebInteropApp constant provides a single source of truth for the web interop path, eliminating magic strings throughout the codebase. The .html extension correctly reflects that this is now a static file rather than a Razor component route.

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.SocialSignIn.cs (1)

102-102: LGTM - Eliminates magic string with centralized constant.

Replacing the hardcoded "web-interop-app" path with PageUrls.WebInteropApp improves maintainability and ensures consistency across the codebase.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsLocalHttpServer.cs (1)

11-11: LGTM - Comment accurately reflects the static file approach.

The updated comment correctly references the new static HTML file location, consistent with the removal of server-side rendering for WebInteropApp.

…te.Client.Web/wwwroot/web-interop-app.html

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Yaser Moradi <ysmoradi@outlook.com>
@ysmoradi ysmoradi merged commit 6a26883 into bitfoundation:develop Oct 17, 2025
3 checks passed
@ysmoradi ysmoradi deleted the 11489 branch October 17, 2025 07: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.

bit Boilerplate's WebInteropApp is not working in Blazor WebAssembly Standalone

1 participant