Commit Graph

12 Commits

Author SHA1 Message Date
Sébastien Ros 5f26302eaa
Quarantining CanDispatchAsyncWorkToSyncContext (#22803)
* Quarantining CanDispatchAsyncWorkToSyncContext

* Missing using

* Make method virtual
2020-06-11 09:30:26 -07:00
Pranav K c935e9aa2d
Blazor WebAssembly package renames (#19026)
Fixes https://github.com/dotnet/aspnetcore/issues/18384
2020-02-18 10:54:28 -08:00
Javier Calvarro Nelson df771dbf43
[Blazor] Cleans up infrastructure used for tests (#13515)
* Removes unnecessary test projects.
* Add a sample project to quickly test changes.
* Breaks off tests based on multiple startups.
* Unifies assertions across tests.
* Captures all logs on test failures.
2019-09-11 15:15:50 +02:00
Steve Sanderson f162ba1961
For two-way bindings, enforce consistency between .NET model and DOM by patching old tree. Fixes #8204 (#11438) 2019-06-24 23:15:33 +01:00
Ryan Nowak 6ca30bbfc9
Add runtime support for Blazor attribute splatting (#10357)
* Add basic tests for duplicate attributes

* Add AddMultipleAttributes improve RTB

- Adds AddMultipleAttributes
- Fix RTB to de-dupe attributes
- Fix RTB behaviour with boxed EventCallback (#8336)
- Add lots of tests for new RTB behaviour and EventCallback

* Harden EventCallback test

This was being flaky while I was running E2E tests locally, and it
wasn't using a resiliant equality comparison.

* Add new setting on ParameterAttribute

Adds the option to mark a parameter as an *extra* parameter. Why is this
on ParameterAttribute and not a new type? It makes sense to make it a
modifier on Parameter so you can use it both ways (explicitly set it, or
allow it to collect *extras*).

Added unit tests and validations for interacting with the new setting.

* Add renderer tests for 'extra' parameters

* Refactor Diagnostics for more analyzers

* Simplify analyzer and fix CascadingParameter

This is the *easy way* to write an analyzer that looks at declarations.
The information that's avaialable from symbols is much more high level
than syntax. Much of what's in this code today is needed to reverse
engineer what the compiler does already. If you use symbols you get to
benefit from all of that.

Also added validation for cascading parameters to the analyzer that I
think was just missing due to oversight.

The overall design pattern here is what I've been converging on for the
ASP.NET Core analyzers as a whole, and it seems to scale really well.

* Add analyzer for types

* Add analyzer for uniqueness

This involved a refactor to run the analyzer per-type instead of
per-property.

* Fix project file

* Adjust name

* PR feedback on PCE and more renames

* Remove unused parameter

* Fix #10398

* Add E2E test

* Pranavs cool feedback

* Optimize silent frame removal

* code check

* pr feedback
2019-05-28 17:17:50 -07:00
Steve Sanderson 147880f796
Components auth step 2 (#10293)
* CR feedback left over from #10227

* Begin adding E2E test case

* Add cookie auth and test login page

* Make E2E auth component work client-side too

* Restructure auth E2E tests around a router so there can easily be multiple such test components

* Add E2E test case for AuthorizeView

* Prepare for E2E test implementations

* Fix ToBaseRelativePath handling of hashes

... otherwise E2E test will fail, because we're using the hash to control server-or-client execution

* Decouple E2E execution mode from hosting mode

* Actual E2E tests for cascading authentication state

* Actual E2E tests for AuthorizeView (in "no authentication rule" mode)

* Fix inconsistent namespace

* CR: Manual ref assembly definitions for AuthorizeView/CascadingAuthenticationState
2019-05-20 15:41:02 +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
Steve Sanderson 7f4dd27551
Support triggering rendering from OnAfterRenderAsync. Fixes #8435 (#8960) 2019-04-01 13:01:33 +01:00
Javier Calvarro Nelson 9f1a978230
[Infrastructure improvements] (#8275)
* Improved selenium start and tear down
  * Selenium is set up and torn down in an assembly fixture.
  * Selenium is initialized lazily and in a non-blocking way.
  * Selenium processes are tracked as part of the build and their pids
    written to a file on disk for cleanup in the event of unexpected
    termination of the test process.
  * Browser fixture retries with linear backoff to create a remote
    driver. Under heavy load (like when we are doing a simultaneous NPM
    restore) the selenium server can become unresponsive so we retry
    three times, with a longer comand timeout allowance each time up to
    a max of 3 minutes.
* Moved test project setup to build time instead of runtime.
  * Added target PrepareForTest to create the required files for testing
    * The template creation folder.
    * The template props file to use our built packages.
    * The folder for the custom hive.
  * Added assembly metadata attributes to find all the data we need to
    run the tests.
    * Path to the artifacts shipping packages folder.
    * Path to the artifacts non-shipping packages folder.
    * Path to the test templates creation folder.
    * Path to use for the custom templating hive used in tests.
  * Proper cleanup as part of the build
    * Remove the test templates creation folder.
    * Remove the test packages restore path.
    * Recreate the test templates creation folder.
    * Recreate the test packages restore path.
  * Generated Directory.Build.Props and Directory.Build.Targets in the
    test templates creation folder.
  * Cleaned up potentially stale templatetestsprops.
* Improved test flows
  * Initialization is done lazily and asynchronously.
    * Selenium
    * Browser fixture
    * Template initialization.
  * Flattened test flows to avoid assertions inside deep callstacks.
    * All assertions happen at the test level with improved error messages.
      * With the exception of the migrations assertions.
    * Assertions contain information about which step failed, for what
      project and what failure details.
  * Broke down tests to perform individual steps instead of mixing build
    and publish.
    * Publish project.
    * Build project. (Debug)
    * Run built project.
    * Run published project.
  * Concentrated build logic into the Project class.
    * Context between the different steps of a test is maintained in
      this class.
    * All operations that require coordination are performed within this
      class.
      * There is a lock for dotnet and a lock for nodejs. When building
        SPAs we acquire the nodejs lock to correctly prevent multiple
        runs of nodejs in parallel.

[ApiAuthorization template cleanups]
  * Fix preview3 issues with breaking changes on Entity framework by
    manually configuring the model in ApiAuthorizationDbContext.
  * Add app.db to the project file when using local db.
  * Fix linting errors on angular template.
  * Fix react tests
  * Add tests to cover new auth options in the SPA templates.
2019-03-20 08:44:20 +01:00
Javier Calvarro Nelson d7a9606040
[Templating][Components] Unify and improve E2E testing infrastructure (#8188)
* Unify the Templating and Components testing infrastructure.
* Enable test project discovery in the components E2E tests.
* Enable selectively disabling Selenium tests through build properties.
2019-03-11 18:40:18 +01:00
Ryan Nowak cb21edc500
Fix #7258 - remove components.server dependencies on blazor-specific plumbing (#7934)
* 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
2019-02-28 10:36:07 -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