Commit Graph

36 Commits

Author SHA1 Message Date
Javier Calvarro Nelson 8fa4df9bda
[Fixes #11454] Fix encoding bug on prerendering (#11504)
We replace double dash sequences with double dots sequences as double dash sequences are not allowed into HTML.
2019-07-12 18:53:21 +02:00
Ryan Nowak a27b9fc335
Blazor API Review: Design concept for Dispatcher (#11930)
* Design concept for Dispatcher

Part of: #11610

This change brings forward the Dispatcher as a more primary and more
expandable concept.
- Dispatcher shows up in more places
- Dispatcher is an abstract class for horizontal scalability
- Dispatcher has parallels with S.Windows.Threading.Dispatcher where
possible

Looking for feedback on this approach. I feel pretty strongly that
making this an abstract class is the right choice, I want to see
opinions on how much to push it into people's faces.

* WIP

* PR feedback
2019-07-11 17:31:57 -07:00
Steve Sanderson 6534bcff32
Expand Blazor logging (#11919) 2019-07-08 13:50:19 +01:00
Steve Sanderson 6f6d099113
Make ArrayBuilder<T>.ToSegment() safe even when reusing underlying arrays (#11903) 2019-07-05 16:01:53 +01:00
Javier Calvarro Nelson 7d545d40aa
Javiercn/js interop improvements part 1 (#11809)
* Adds exception sanitization to RemoteJSRuntime
* Adds default async timeouts of 1 minute for JS async calls to server-side blazor
2019-07-05 16:28:41 +02:00
Steve Sanderson b31cd35f92 Ensure DI scope is disposed if prerendering fails 2019-07-05 09:41:04 +01:00
Steve Sanderson ee1cbda155 Ensure CircuitHost disposes DI scope even if other disposals throw 2019-07-05 09:41:04 +01:00
Ryan Nowak db0d065b76 Rename Invoke -> InvokeAsync 2019-07-03 10:04:55 -07:00
Ryan Nowak 291ad25f5d Rename .Components.Browser -> Components.Web
This is part of API review for Blazor. We're renaming these projects to
reflect the fact that they are for Blazor using web technologies (html
+css).

The old naming of .Browser of whether it meant client-side (in the
browser).
2019-07-01 15:36:35 -07:00
David Fowler d3640d59a2
Add a diagnostic source event that fires when a route is matched (#11685)
* Add a diagnostic source event that fires when a route is matched
- Usually more information becomes available about a request once route is matched. This event shoud allow diagnositc systems to enlighten the typical "begin request" metadata to include more information about the matched route and more importantly the selected endpoint and associated metadata.

* Update src/Http/Routing/test/UnitTests/EndpointRoutingMiddlewareTest.cs

Co-Authored-By: campersau <buchholz.bastian@googlemail.com>

* PR feedback and test fixes
2019-07-01 00:13:37 -07:00
Pranav K b7ad834b8d
Remove Circuit test (#11623) 2019-06-27 09:46:19 -07:00
Chris Ross 4ef204e13b
Remove or make public pubternals for Http #11312 (#11429) 2019-06-21 17:56:53 -07:00
Justin Kotalik c288baf967 mark test as flaky (#11306) 2019-06-17 19:52:46 -07:00
Pranav K 8fd85ec8ce
Ensure CircuitRegistry evicts CircuitHost entries after configured (#11157)
* 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
2019-06-17 13:15:15 -07:00
Javier Calvarro Nelson 2d2806b083
Better circuit ids (#10688)
* Better circuit ids.
* Generates cryptographically strong circuit ids.
  * 32 bits of entropy from a PRNG.
  * DataProtected for authenticated encryption.
2019-06-01 00:26:46 +02:00
Javier Calvarro Nelson 3c2e16bf92
Exposes the underlying HttpConnectionDispatcherOptions in MapBlazorHub (#10690)
* Expose new overloads to customize connection dispatch options
2019-05-31 22:25:08 +02:00
Ryan Nowak 2948c81aea
Fix RendererSyncContext.Post() (#10451)
* 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
2019-05-23 10:39:53 -07:00
Steve Sanderson 1dbc203e19
Components auth: basic services and components (#10227) 2019-05-16 09:59:12 +01:00
Nate McMaster 77e08c26d5
Replace all usages of RepositoryRoot with RepoRoot (#10267)
Preparing to adopt the Arcade SDK, which uses the shorter variable name instead
2019-05-15 12:00:19 -07:00
Ryan Nowak b3836954ed Fix #9316 Expose Blazor HubOptions 2019-05-08 16:22:13 -07:00
Hao Kung 9e4647d6e4
Reenable Components.Server.Tests (#9432) 2019-04-16 15:20:41 -07:00
Javier Calvarro Nelson b9e600a45c
Renames for blazor server-side, inclusion in shared framework, and other renaming fixes (#9001)
* 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.
2019-04-04 21:36:36 +02:00
Javier Calvarro Nelson 8499a27c7f
[Components] Relayer + Robust reconnect (#8911)
* [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.
2019-04-02 19:17:03 +02:00
Pranav K d86c9b3f07
Use MessagePackReader \ MessagePackWriter to implement IHubProtocol for server-side Blazor (#8687)
* Use MessagePackReader \ MessagePackWriter to implement IHubProtocol for server-side Blazor

Fixes #7311
2019-04-01 14:25:23 -07:00
Steve Sanderson 77d9fae439
Supply "IsConnected" state info to components (#8888)
* 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
2019-03-29 14:53:29 +00:00
Steve Sanderson 49b074d3c0
Fix base URI during prerendering (#8910) 2019-03-29 12:41:59 +00:00
Steve Sanderson 03357bf92b
Components: don't block the SignalR loop during init. Fixes #8274 (#8863) 2019-03-28 16:42:55 +00:00
Pranav K 33839dc66a
Client reconnects when state's available on the server (#7395)
Reconnect if we have state on the server

Fixes #7537
2019-03-04 17:27:51 -08:00
Javier Calvarro Nelson 2d9cba86fd [Components] Prerrendering startup experience (#7770)
[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.
2019-02-21 16:26:44 -08:00
Pranav K cddbc2e888
Improve Components error handling (#7165)
* 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
2019-02-13 14:22:46 -08:00
Hao Kung c9499e14e4
Run helix tests on master (#6728) 2019-02-07 09:20:08 -08:00
Javier Calvarro Nelson f456e3d153
[Components] [Fixes #6953, #7226]
* Moves the Synchronization context from the remote renderer to the base renderer.
* Removes all the locking from the base renderer.
2019-02-07 07:03:52 -08:00
Pranav K f1e70ec897
More PR changes 2019-02-04 09:38:40 -08:00
Pranav K e312d64194
[Design]: Introduce CircuitHandler to handle circuit lifetime events
Partial fix to https://github.com/aspnet/AspNetCore/issues/6353
2019-02-04 09:38:39 -08:00
Javier Calvarro Nelson 19b543e45f [Components] Support for prerrendering asynchronous components.
* 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.
2019-01-17 08:39:00 -08:00
Nate McMaster 5a70f5312f
Convert Components projects to use ProjectRef (#6698)
This addresses #4246 for src/Components/. A few other changes were necessary because components had been using stale dependencies.
2019-01-16 12:28:04 -08:00