Commit Graph

70 Commits

Author SHA1 Message Date
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
Steve Sanderson 37aadc2aab Add comment to RemoteRenderer clarifying #11107 2019-06-27 21:01:30 +01:00
Pranav K b7ad834b8d
Remove Circuit test (#11623) 2019-06-27 09:46:19 -07:00
Javier Calvarro Nelson 0a4f42a7e2
Add support for static web assets in blazor client-side (#11042)
* Add support for static web assets in blazor client-side
* Blazor serve use MSBuild data instead of heuristics to run the app
* Remove blazor-client-side app Static Web Assets when hosted in an ASP.NET Core
2019-06-24 17:47:08 +02: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
Pranav K 17c7ea95a2
Add API to configure CircuitOptions (#11166)
* Add API to configure CircuitOptions
2019-06-17 09:00:45 -07:00
Pranav K cd7eda9a33
Use a valid canceled task (#11161) 2019-06-14 13:13:53 -07:00
N. Taylor Mullen 874050f1dd Headless Blazor client (#11112)
* 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.
2019-06-13 10:05:40 -07:00
Pranav K d935ea2d25
Guarantee ordering for SignalR client HttpConnection.send #10780 (#10987)
Fixes https://github.com/aspnet/AspNetCore/issues/9901
2019-06-08 14:35:29 -07:00
Javier Calvarro Nelson 1165a6fb16
Support navigation during prerendering (#10694) 2019-06-01 01:40:45 +02: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
Pranav K b9546df5d4
Defer link interception until Router is initialized (#10062)
* Defer link interception until Router is initialized

Fixes https://github.com/aspnet/AspNetCore/issues/9834
2019-05-17 15:33:35 -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 0b590ff46f Fix #6764 EndpointConventionBuilder API review 2019-05-09 19:38:43 -07:00
Ryan Nowak b3836954ed Fix #9316 Expose Blazor HubOptions 2019-05-08 16:22:13 -07:00
Nick Sullivan 48d2f40192 blazor.boot.json - don't set physicalpath 2019-05-08 17:45:43 +01:00
Steve Sanderson e0c32f42f4
Key support. Implements #8232 (#9850)
* 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
2019-05-07 18:22:10 +01:00
BrennanConroy 14496c9989
React to SignalR hub protocol change (#10010)
https://github.com/aspnet/AspNetCore/issues/5320
2019-05-07 08:18:12 -07:00
Pranav K 3c40df452d
Update MessagePack commit to be inline with upstream changes (#9753)
* Update MessagePack commit to be inline with upstream changes
2019-05-03 10:43:45 -07:00
James Newton-King da66edc8ff
Change IEndpointConventionBuilder extension methods to use generic argument (#8906) 2019-05-02 07:25:54 +12:00
Pranav K 9e4d5c14c7
Use LogicalName that works consistently in all platforms (#9527) 2019-04-18 19:27:25 -07:00
Pranav K 11842e75e2
Update MessagePack and fix build warning (#9464) 2019-04-18 10:06:58 -07:00
Pranav K 56e2080ef7
Always fully build Components.Server.csproj (#9421)
* 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
2019-04-17 09:17:42 -07:00
Hao Kung 9e4647d6e4
Reenable Components.Server.Tests (#9432) 2019-04-16 15:20:41 -07:00
Steve Sanderson eaf63a670d Fix log message in RemoteRenderer 2019-04-05 17:05:17 +01:00
Pranav K 896537bb8c Update MessagePack-CSharp commit 2019-04-05 06:50:30 -07:00
Ryan Nowak b142daeccb [Blazor] Fix #9089 don't log mundane stuff at info level (#9098)
Reduce the noise of some logging that's really
only useful for troubleshooting/debugging.
2019-04-05 06:45:33 +02: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
Steve Sanderson 42511e8652
Replace Blazor CLI tool with new DevServer package (#9028) 2019-04-04 09:47:56 +01: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
Ryan Nowak 658b37d2bd
Make UseEndpoints a thing (#8765)
* 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.
2019-03-28 15:41:11 -07: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 cb6fb32529
Make building Components & Mvc solutions work out of the box (#8830)
* Make building Components & Mvc solutions work out of the box

Fixes https://github.com/aspnet/AspNetCore/issues/8413
2019-03-27 09:27:11 -07:00
Ryan Nowak b743ba2f66 Throw unhandled exceptions during prerendering
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.
2019-03-20 13:02:24 -07: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