Skip to content

Conversation

@bar-qodo
Copy link

Benchmark PR dotnet#64629

Type: Clean (correct implementation)

Original PR Title: Accept blazor.web.js startup options format in blazor.server.js and blazor.webassembly.js
Original PR Description: - [x] Analyze issue requirements and understand the codebase

  • Check if the repository has been built and JavaScript assets exist
  • Implement the fix in Boot.Server.ts to accept the circuit: nested option format
  • Implement the fix in Boot.WebAssembly.ts to accept the webAssembly: nested option format
  • Build JavaScript to verify TypeScript compiles correctly
  • Create sample scenarios in test assets
  • Test the fix interactively using Playwright
  • Implement E2E tests for both old and new option formats
  • Run E2E tests to validate the changes
  • Run code review and CodeQL checks
  • Address PR feedback: Remove /// XML doc comments from test files
  • Address PR feedback: Simplify test approach by using query parameter in index.html
  • Fix test failure: Use query parameter approach for nested options test
  • Revert unintended changes to package-lock.json

Security Summary

No security vulnerabilities were introduced by these changes.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Blazor] Accept the blazor.web.js startup options format in blazor.{server|webassembly}.js</issue_title>
<issue_description>## Problem

When a Blazor app uses blazor.web.js, the options object passed to Blazor.start() has the following format:

Blazor.start({
  ssr: { /* ... */ },
  circuit: { /* ... */ },
  webAssembly: { /* ... */ },
});

However, when using blazor.server.js or blazor.webassembly.js, runtime-specific options are specified as top-level properties on the options object. So, for example, if you're using blazor.webassembly.js and you attempt to customize the loading of boot resources like this:

Blazor.start({
  webAssembly: {
    loadBootResource: function (/* ... */) {
      // ...
    },
  },
});

...then it will just silently "not work". This could create a pit of failure for customers who see examples in docs using the blazor.web.js options format but are writing a Blazor WebAssembly standalone app, for example.

Solution

We should update blazor.webassembly.js and blazor.server.js to accept the options format used by blazor.web.js.
Include end-to-end test that will assert that options are passed correctly

Summary Comment: dotnet#51611 (comment)
</issue_description>

<agent_instructions>Follow the instructions in src/Components/Agents.md

You MUST follow this workflow when implementing new features or fixing bugs in the Components area.

  • Add the workflow to your todos and follow it strictly.
  • Create a sample scenario.
  • If working on a bug, use playwright to reproduce the behavior/problem first.
  • You MUST have reproduced the problem before attempting to fix it.
  • Research the problem area using the microsoft docs, existing code, git history, and logging on the sample project.
  • Implement the fix or feature in the sample project first.
  • Test the fix or feature interactively using Playwright.
  • Once the fix or feature is validated in the sample, implement E2E tests for it.
    • When you create an E2E test. First execute it interactively with Playwright.
    • If an E2E test is failing, debug it by running the test server manually and navigating to the scenario in a browser.
  • Only after the E2E tests are passing, remove the sample code you added in the Samples projects.

In this case, for the E2E tests you can probably modify one of the App.razor files in the testassets that use blazor.web.js and take parameters to use the new format. Make sure that there is at least one file that uses the new format and one that uses the old format.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@ Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.</comment_new>
<comment_new>@
Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.</comment_new>
<comment_new>@MackinnonBuck

Help Wanted

Issue Summary

See dotnet#51611 (comment)

Potential Design

We can add one additional property to CircuitStartOptions and `WebAssemblySt...


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Original PR URL: dotnet#64629

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.

3 participants