Skip to content

Change MapBlazorWebAssemblyApplication to UseBlazorFrameworkFiles #19198

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

Merged
merged 2 commits into from
Feb 21, 2020

Conversation

javiercn
Copy link
Member

  • We discovered some issues with the interactions between static files and endpoint routing and we need to re-assess the design.
  • In the mean time, we go back to MapBlazorFrameworkFiles that only handles _framework files

@javiercn javiercn force-pushed the javiercn/blazor-mapblazorframeworkfiles branch from 091c17f to f82f661 Compare February 20, 2020 15:41
@javiercn javiercn force-pushed the javiercn/blazor-mapblazorframeworkfiles branch from f82f661 to e745d3a Compare February 20, 2020 15:52
@javiercn javiercn marked this pull request as ready for review February 20, 2020 16:08
@Pilchie Pilchie added the area-blazor Includes: Blazor, Razor Components label Feb 20, 2020
@rynowak
Copy link
Member

rynowak commented Feb 20, 2020

What are the strange interactions?

@javiercn
Copy link
Member Author

@rynowak Ordering issues.

I plan to talk to you about them and see if we can come up with a solution together. We just don't have time to do something better for preview2.

{
var endpoint = ctx.GetEndpoint();
try
subBuilder.Use(async (ctx, next) =>
Copy link
Member

Choose a reason for hiding this comment

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

Out of interest, would an alternative working implementation have been to configure the "on prepare response" callback for options and put the header controls in there, then just have subBuilder.UseStaticFiles(options) without the extra bit of middleware?

I'm not saying that's better. Just want to understand the options.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just did the most straightforward transformation from what we had before, using OnPrepareResponse would have also worked.

Copy link
Member

Choose a reason for hiding this comment

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

I think the difference you'd seen in behavior here is that OnPrepareResponse would handle the cases where the file was found - this will add a header for a 404.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I think you are right, not a big deal since I plan to work on this for preview 3 and a 404 can’t be cached anyways?

Thanks Steve!

Co-Authored-By: Steve Sanderson <[email protected]>
@javiercn javiercn merged commit 9ded8e1 into blazor-wasm Feb 21, 2020
@javiercn javiercn deleted the javiercn/blazor-mapblazorframeworkfiles branch February 21, 2020 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants