* Ensure CircuitRegistry evicts CircuitHost entries after configured
duration
* Use an active expiration token to trigger expiration
* Add logging during host state transitions
Fixes https://github.com/aspnet/AspNetCore/issues/9893
* Add Ignitor
* Finish headless Blazor client.
* Added support for click events.
* Move Ignitor into testassets folder.
- Also added Ignitor to the no deps solution.
* Add Ignitor tests to validate RenderBatchReader stays consistent.
* Fix RendererSyncContext.Post()
Fixes: #9683 - SignalR connection breaks on large DOM
The root cause here is a misbehaving sync context. It's not legal for a
Post() implementation to run a callback synchronously. We want that
behavior for most of the functionality Blazor calls directly, but Post()
should always go async or else various threading primitives are broken.
* Fix incorrect tests
These tests have the assumption that setting the result of a TCS will
execution continuations synchronously. This was a bug in our
SyncContext, and these tests needed updating to be more resiliant.
* Remove a delegate allocation
* Store component/element keys on RenderTreeFrame
Also refactored how RenderTreeFrame gets constructed. The previous arrangement of having ad-hoc ctor overloads for different scenarios became intractible (too many combinations to avoid clashes; risk of accidentally losing field values when cloning). There's now one constructor per RenderTreeFrameType, so you always know where to add any new field values, and implicitly guarantees you don't lose other field values because adding a new param forces updates at all the call sites.
* Add StackObjectPool, which will be useful momentarily
* Support keyed insertions/deletions
* Refactor AppendDiffEntriesForRange to prepare for adding "move" logic
* Apply permutations on the JS side
* Handle keyed moves by writing a post-edit permutation list
* Shrink KeyedItemInfo struct
* Include sourcemaps when building client-side Blazor apps with ReferenceFromSource
* Update struct length of edit frames now it's explicit layout
It's longer now because all the reference-type fields, except the last, now have to be 8 bytes for compatibility with 64-bit runtimes. Previously on Mono WebAssembly the reference-type fields were all 4 bytes.
* Tolerate clashing keys (i.e., produce a valid diff, even if suboptimal)
* Tolerate keys being added/removed incorrectly
* E2E test harness for 'key'
* Some more unit test cases
* Invert diffing logic to prefer matching by key over sequence
Previously it preferred sequence over key, but that's wrong, and surfaces as bugs when you mix keyed and unkeyed items. We need to prefer key over sequence, because key is meant to guarantee preservation, whereas sequence is just best-effort preservation.
* Make unit test cases more adversarial
* First actual E2E test
* In E2E test, verify correct preservation of components
* E2E tests for simple insert/delete cases (with and without keys)
* E2E test for reordering. Also extend other tests to verify simultaneous editing.
* E2E test for many simultaneous changes
* Update reference sources
* CR: Avoid x = y = z
* CR: Only use 'finally' for actual cleanup
* CR: Clean up RenderTreeFrame assignment
* CR: Include 'key' in RenderTreeFrame.ToString()
* CR: Avoid "new T()" in StackObjectPool
* CR: Make KeyedItemInfo readonly
* CR: Handle change of frame type with matching keys (and sequence)
* CR: Add E2E test showing form + key scenarios
* Preserve focus across edits
* Tweak E2E test case
* In client-side Blazor, prevent recursive event handler invocations
* Actual E2E tests for moving form elements
* Always fully build Components.Server.csproj
* Use pre-built js files instead of building on the fly
* Use a sourcemap file for Debug. .gitignore sourcemap files
* Install nodejs on CodeCheck agents
Fixes https://github.com/aspnet/AspNetCore/issues/9402
* Move contents of Microsoft.AspNetCore.Components.Services namespace to Microsoft.AspNetCore.Components
* Rename Components to Blazor
* Make Blazor server-side part of the shared framework.
* [MVC][Components] Prerendering + Robust reconnect
* Relayers prerendering support on a separate package on top of MVC and
components.
* Implements robust reconects with acknowledgements from the client.
* Improves interactive prerendering with the ability to reconnect to
prerendered components.
* Removes the need to register components statically when prerendering
them.
* Removes the need of using an element selector when prerendering an
interactive component.
* Updates the templates to use the new fallback routing pattern and
reenables the components test.
* Adds eslint to the Typescript project to help maintain a consistent
style.
* Adds logging to support better debugging based on the pattern used by
signalr.
* Fixes exception handling on the server to always report exceptions correctly to the client.
* Basic implementation of IComponentContext with IsConnected flag
* Update ref assembly code
* Begin infrastructure for prerendered E2E tests
* Actual E2E test for prerendered-to-interactive transition
* Make endpoint middleware explicit
This change makes the endpoint middleware explicit again, and updates
all of the templates.
The other change here is make UseEndpoints be the place where you
register endpoints. This is vital because it puts your code visually at
the point of the pipeline where it executes.
Lastly, I removed support for UseMvc with endpoint routing. This is
causing issues for some security features, and we're moving in the
direction of trying to make the middleware heavy implementation required
in 3.0. There are some issues we won't be able to fix in MVC if we can't
unambiguously know if UseMvc was used or the middleware.
Fixes: #8609
Currently exceptions thrown during prerendering are simply logged. This
change uses the existing *unhandled exception* mechanism of the
renderer/circuit to throw these. The result is that the developer
exception page just works for prerendering.
* Removes a bunch of trivial usage of Blazor
... in names and comments where we don't specifically mean Blazor.
* Remove obsolete Startup from Components app
* Move UseBlazor into Blazor.Server
Moves UseBlazor and the related features in Blazor.Server - along with
some other general cleanup of misc shared files.
Now Components.Server has a much slimmer set of dependencies (MVC is
gone) and doesn't contain the "double startup" pattern that we
introduced (sorry).
We'll revisit UseBlazor and the dependencies there once the new
MapFallbackToFile support is available from static files.
* minor PR feedback
* Update reference assemblies
* fix broken test
[Components] Prerrendering startup experience
* Introduces an IComponentPrerrenderer to handle Prerrendering
* MVC registers a basic static prerrrenderer.
* Components registers a more feature complete prerrender that will
handle reconnection to the original circuit after prerrendering in
the future to allow for prerrendered interactive components.
* Removes UseRazorComponents
* Removes the SPA fallback in favor of a catch all route in
Index.cshtml
* Moves the framework files to be served by the default StaticFiles
middleware in the pipeline by way of plugging specific providers
through options.
* Lifts UseSignalR(r => r.MapHub<ComponentHub>()) into startup and
replaces it with a shorthand for MapHub using endpoint routing.
* Adds extension methods to map components to selectors for a given
hub.
* Updates the razor component templates to include prerendering and use a razor page as the entry
point.
* Improve Components error handling
* Change event handlers IHandleEvent, IHandleAfterEvent to be async.
* Return faulted tasks to Renderer instead of handling exceptions in ComponentBase
* Use ILogger in RemoteRenderer, and log to console in WebAssemblyRenderer
* Cleaning up touched files
Fixes https://github.com/aspnet/AspNetCore/issues/4964
Add new command line parameters for working with the project:
* `-NoBuild`, `-NoRestore` - these already existed, but users found it hard to discover this powershell syntax: '-build:$false'
* `-Arch`/`--arch` - set the target CPU architecture to build. Defaults to x64
* `--os-name` - on non-Windows builds, manually specify if the build should target Alpine. generic Linux, or MacOS
* Rename flags used to build specific project types. The pattern now is `--build-$(group)` or `--no-build-$(group)` (In PowerShell its `-Build$(Group)` or `-NoBuild$(Group). Example: -NoBuildJava
Changes to build definitions:
* Update the ci build definition to build all supported architectures
* Support publishing multiple artifacts per job
Other changes:
* `-NoBuild` implies `-NoRestore`
* Add new properties, `TargetArchitecture`, `TargetOsName`, and `TargetRuntimeIdentifier`
* Replace usages of `SharedFxRid` with these new properties
* To make `--no-build-nodejs` actually work, replaced Components.Browser.JS.csproj with Components.Browser.JS.npmproj
* Fix errors when building for win-arm on a clean machine
* Fix a few other project errors, like using the wrong syntax for DefaultItemExcludes, or using the wrong Platform value for x86
* Updates the IComponent interface to rename Init into Configure
* Updates the IComponent interface to change SetParameters for
SetParametersAsync and make it return a Task that represents when the
component is done applying the parameters and potentially triggering
one or more renders.
* Updates ComponentBase SetParametersAsync to ensure that OnInit(Async)
runs before OnParametersSet(Async).
* Introduces ParameterCollection.FromDictionary to generate a parameter
collection from a dictionary of key value pairs.
* Introduces RenderComponentAsync on HtmlRenderer to support
prerrendering of async components.
* Introduces RenderRootComponentAsync on the renderer to allow for
asynchronous prerrendering of the root component.