-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Add support for launching a browser on file change #24220
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
|
||
async Task WebSocketRequest(HttpContext context) | ||
{ | ||
if (!context.WebSockets.IsWebSocketRequest) |
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.
Who is attaching with a WebSocket connection? (The browser I know, but how?)
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.
There's a follow up which will inject a hosting startup via environment variable.
Updated |
ad03f58
to
e0967c6
Compare
Good to go |
<ItemGroup> | ||
<_RuntimeFramework Include="@(RuntimeFramework)" /> | ||
<RuntimeFramework Remove="@(RuntimeFramework)" /> | ||
<RuntimeFramework Include="Microsoft.AspNetCore.App" FrameworkName="Microsoft.AspNetCore.App" Version="5.0.0-preview" /> |
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.
Is there a way to do this that doesn't require manually changing this for example when we aren't preview anymore?
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.
I'm on point for fixing this in 5.0. We basically want to stamp the current runtime version in here. This was copied from https://github.com/dotnet/aspnetcore/blob/master/src/Components/WebAssembly/DevServer/src/Microsoft.AspNetCore.Components.WebAssembly.DevServer.csproj#L41 so we have a few places to fix this.
_files = new HashSet<string>(files, StringComparer.OrdinalIgnoreCase); | ||
} | ||
|
||
public bool Contains(string filePath) => _files.Contains(filePath); | ||
|
||
public int Count => _files.Count; | ||
|
||
public static IFileSet Empty = new FileSet(Array.Empty<string>()); | ||
public bool IsNetCoreApp31OrNewer { get; } |
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.
What is stopping 2.1 from working?
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.
The HTML injection middleware has to target whatever version we choose here. We could have it just launch the browser the first time, but that's not very useful in itself. Picking 3.1 seems like a good middleground.
e230871
to
80b38e8
Compare
80b38e8
to
b5c9bba
Compare
Bad rebase? |
Wrong base branch. |
Contributes to #23412