* Remove IVTs from Microsoft.AspNetCore.Components.Web to .Blazor/.Server
* Eliminate RendererRegistry from .Web, as it's not needed for server-side Blazor
* Reintroduce RendererRegistry as a WebAssembly-specific concept. Refactor event data parsing.
* Remove redundant guard
* Corresponding test updates
* Update ref sources
* CR: Remove renderer ID fully from server-side Blazor code
* CR: Make WebEventData internal and shared-source
* Hub test updates
* Clean whitespace
* Update binaries
* Regenerate binaries AGAIN
* Update Jest test
* CR: Replace constructor with static parse
* Yet again attempt to refresh the .js binaries
* Fix ref assembly
* Fix test
* Adds a new API endpoint to trigger graceful disconnection from blazor clients.
* Uses the sendBeacon API on the Blazor client to trigger graceful disconnections on the client when the document gets unloaded, which happens when closing the window, navigating away from the page or refreshing the page.
* Add analzyer for pubternal
This is based on some existing code from EF. I'm having a discussion
with them right now on the best way to share this logic.
I also added support for parameters here which was missing. We might
want to make this code converge with `BannedApiAnalyzer` which is much
more thorough than this.
This is using our existing package for testing analyzers thats the
*official* way to do it in our repo. Filed #12868 to track that.
* Add S C A R Y warnings to render tree types
* PR feedback
* Improve SetParametersAsync docs
Fixes: #12820
* Clarify semantics of clashing cascading parameters
This change attempts to lock down the semantics of how cascading
parameters behave inside ParameterView.SetParameterProperties.
Previously a cascading value could be used to set a non-cascading
parameter, and vice-versa. We were just missing tests in general for how
cascading values are interpreted by the parameter set logic.
[Blazor][Fixes#11964] Limit the amount of pending renders
* Adds a default limit of 10 queued pending renders per application.
* Stops producing new render batches after that limit is hit.
* Resumes producing render batches as soon as the client acknowledges a batch.
* Revert "Revert "Improve components infrastructure (#12145)" (#12679)"
This reverts commit e2d57e2806. The improvement to components infrastructure is now reinstated with the following changes:
* Check in release JS artifacts and use them as a fallback when it's not possible to build npmproj.
* Dont' build nodejs in source build.
This change adds a fail-fast mechanism to our E2E tests based on
the browser console. This will fail super hard if an unhandled exception
is thrown.
I think it would be interesting to also see if we could do the same
thing for 404s.
The goal of this change is to make it so that the E2E tests can fail
faster (3-4s) than the 30s timeout in the case that something
catastrophic happens. As a nice side benefit you get to see the
exception message.
- In preview8 we warned users for non-public `[Parameter]`s and `[Parameter]` setters. For preview9 this is now an error because things will not work as they expect.
- Updated existing tests to reflect the new error expectation.
#12294
* Rename IUriHelper -> NavigationManager
- Remove IUriHelper interface
- Rename to NavigationManager
- Remove all traces of old naming
There's no functional or design change in this commit - just removing
all traces of the old name. The next few iterations will try to improve
the design.
* Minor API tweaks to NavigationManager
Making Initialize protected causes problems because right now the
server-side code needs to deal with one of two different
implementations, hence an exchange type is used. I followed the same
pattern that was used for auth for symmetry but I have some *cool*
thoughts.
- We can remove this when we remove stateful prerendering
- I have another idea to banish this pattern to the land of wind and
ghosts
If this ends up sticking around longer than a week in the code, lets
discuss other ideas and try to improve the pattern.
* Use hub method for server-side navigation
* Get rid of async local
* Add hub method test
* Misc bikeshedding
* Update src/Components/Server/src/Circuits/DefaultCircuitFactory.cs
Co-Authored-By: campersau <buchholz.bastian@googlemail.com>
* PR feedback
Fixes: #5496Fixes: #10448
This change adds a *utility* base class that encourages you to do the
right thing when you need to interact with a disposable scoped or
transient service.
This solution ties the lifetime of a DI scope and a service to a
component instance. Note that this is not recursive - we expect users to
pass services like this around (or as cascading values) if the design
dictates it.
Fixes: #12245Fixes: #12630
This change removes stateful pre-rendering from Server-Side Blazor. This
means that when you render a component during the initial HTTP request,
we we will no longer preserve the component instances and their
parameters. While this feature was useful, it cause serious scalability
concerns.
This means that it will now be required to register "entry-point"
components in startup similar to client-side Blazor.
* Immediately releases the circuit when the client disconnects gracefully.
* This functionality is limited to websockets.
* We are able to release the circuit in the following situations:
* The user closes the browser.
* The user navigates away.
* The user reloads the page.
Fixes: #12548
Renaming properties to drop 'Content' as a suffix. We haven't been
consistent in using this, and we're removing it instead of adding it
elsewhere.
Fixes: #12550
Removes UIEventArgs in favor of EventArgs as the base class.
Moving Type into all of our event args types - this is important because
many of the events types are used for multiple events.
The only think about this that isn't perfect is that we have keep
special casing change because of how binding works. I renamed the type
to drop the `UI` prefix. It's not possible to define a subclass in the
Web project because of the way covariance works (or doesn't work) in
.NET.
Fixes: #12631
These mappings were missing and adding them restores the correct
behaviour. Mixing up the usage of `@bind` vs `@bind-value` so we have
more coverage of this.
* Remove generated Web.JS javascript files files
* Build NodeJS project referenced by managed projects by default
* Build Web.JS before other CI jobs
- We can't build Web.JS on Linux Musl for example
* Make BuildAll not override explicit BuildJava/NodeJS/Native/Managed settings
* Capture CodeCheck logs for debugging
* Skip NodeJS projects when generation ref assemblies
* Do not build dependent projects if NodeJS is not built
* Make build fail immediately if BuildNodeJS is true but NodeJS is not installed
* Do not build nodejs in installer builds
[Blazor] [Fixes#11847] Renderer.DispatchEventAsync throws null
reference exception if event handler throws synchronously
* Returns after handling the exception.
* Adds a unit test and an E2E test to validate expected behavior.
* E2E test to show current behavior
* Actually support base-relative, root-relative, and absolute redirections during prerendering
* Fix MVC functional test