-
-
Notifications
You must be signed in to change notification settings - Fork 261
fix bit Boilerplate WebInteropApp's issue in Blazor Weasm Stadalone (#11489) #11490
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
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit 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. WalkthroughThe 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
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
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
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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. Comment |
There was a problem hiding this 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.htmlpath - 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 |
...s/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/web-interop-app.html
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.jsdoes not have a corresponding source file. The directorysrc/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/wwwroot/scripts/does not exist, and noapp.jsfile 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.jsfile 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
📒 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.WebInteropAppprovides 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.WebInteropAppinstead 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
.htmlextension, 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.WebInteropAppimproves 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.
...s/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/web-interop-app.html
Show resolved
Hide resolved
…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>
closes #11489
Summary by CodeRabbit
Refactor
Bug Fixes