Skip to content

[Blazor] Move to MapBlazorWebAssemblyApplication #19147

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 3 commits into from
Feb 20, 2020

Conversation

javiercn
Copy link
Member

  • Blazor assets will be plugged in through endpoint routing.
  • This is not the final design, but we want to get this in for preview2.

@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Feb 19, 2020
}
});

appBuilder.UseStaticFiles(options);
Copy link
Member

Choose a reason for hiding this comment

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

Just to check, what are the possible scenarios where this might conflict unexpectedly with other things a developer might be doing? Are they safe to have their own separate UseStaticFiles calls with different options elsewhere?

Not saying it's the wrong design - just want to get my understanding right.

Copy link
Member Author

Choose a reason for hiding this comment

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

Just to check, what are the possible scenarios where this might conflict unexpectedly with other things a developer might be doing? Are they safe to have their own separate UseStaticFiles calls with different options elsewhere?

Not saying it's the wrong design - just want to get my understanding right.

Yes, you can have your own static files middleware and except for the case they are being mapped into the same subpath (or to "/") this should not interfere.

In the future, I want to flow the paths into the host so that it can map exactly the files the blazor app is meant to serve and nothing else. At that point there's no room for ever conflicting with the static files middleware.

Copy link
Member

Choose a reason for hiding this comment

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

except for the case they are being mapped into the same subpath (or to "/") this should not interfere.

In the default "hosted" template case, if someone puts app.UseStaticFiles() into their server project because they also want to serve static files from there (independently of their Blazor application), is this likely to result in any conflicts or unexpected behavior?

As long as it's not hugely disruptive it's probably OK for preview2, but just checking we know what to expect.

In the future, I want to flow the paths into the host so that it can map exactly the files the blazor app is meant to serve and nothing else.

Totally makes sense as a future enhancement.

@SteveSandersonMS SteveSandersonMS self-requested a review February 19, 2020 15:28
…pointRouteBuilderExtensions.cs

Co-Authored-By: Steve Sanderson <[email protected]>
@javiercn javiercn merged commit c39bc6a into blazor-wasm Feb 20, 2020
@javiercn javiercn deleted the javiercn/blazor-wasm-hosting branch February 20, 2020 07:56
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.

2 participants