* 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.
* The tests are low value.
* The tests are flaky.
* The tests cover mostly browser behavior not spec compliance.
* It's an area that doesn't change often.
* We have unit tests to cover the casuistic.
- #11924
- change ci.yml to use stages and post-build.yml
- add use of publish-build-assets.yml and post-build.yml
- create manifests and push to artifacts in last build step of each job
- pass more MSBuild properties into those builds
- use Arcade to publish installers
- use distinct `$(AssetManifestFileName)` values per job
- set global property to override what's hard-coded in Publish.proj
- change codesign-xplat.yml to use empty.proj and normal Arcade signing and publication process
- remove XPlatPackageSigner.proj
- change default-build.yml to use job.yml
- remove unused parameters e.g. `matrix`, `poolName`, `variables`
- use `enableMicrobuild` and `enablePublishTestResults` to eliminate duplicate build steps
- add .dll's and .exe's as files to sign w/ Microsoft400
- add signcheck exclusions
- remove custom manifest generation i.e. the `GenerateBuildAssetManifest` target and related artifacts
- update docker infrastructure to use same paths in and out of the container
- avoids problems adding to artifacts from within the builds
- correct typo in build.sh
- use `$env:DOTNET_INSTALL_DIR` in `DotNetCommands`
- relax expectations that an arch-specific folder exists under (say) `$env:DOTNET_HOME`
- avoids need to define `$env:DOTNET_HOME` in all jobs on CI
- update dependencies from dotnet/arcade build '20190908.2'
- upgrade to eg. Arcade SDK '1.0.0-beta.19458.2' package version
- pick up dotnet/arcade@dd593acc8b fix
- enable use of `%(PublishFlatContainer)` metadata and correct signing validation issues
- use `$(DotNetFinalVersionKind)` in preparation for servicing builds
- set `$(IsStableBuild)` for use in Arcade infrastructure
- disable signing validation for now (see #13864)
nits:
- upload logs in first artifact
- remove attempts to package non-existent VSIX
- follow-up to 29cf7ecb80
- respect verbosity setting in build.sh
- add more information to Artifacts.md
- enable test signing in internal PRs
* Automatically capture a screenshot when an assertion fails.
* Enable configurable options for different environments (CI|Dev).
* Include log errors in all exceptions.
* Add default timeout configurations and failure timeout configurations for CI and Dev environments.
* Catches HttpClient exceptions and retries on IdentityUI_ScriptTags_SubresourceIntegrityCheck and IdentityUI_ScriptTags_FallbackSourceContent_Matches_CDNContent
* Rimraf has reliability issues on windows.
* This change runs rimraf with a few retries before starting the app with `dotnet run` so that `npm run start` on the ReactDeveloperMiddleware has a better chance to succeed.
* Updates the angular template to exclude the client-side files from the single file publish output
* Updates the react template to exclude the client-side files from the single file publish output
* Updates the react-redux template to exclude the client-side files from the single file publish output
- #4914
- test service ref MSBuild tasks
- add `MockBuildEngine` class to support tests where a task logs
- correct an incredibly minor product issue about logging errors for `@(OpenApiProjectReference)` items
- set `%(SourceProject)` metadata and use it when logging
- add test project that builds and can be tested in the future
- #4923
- typo caused problems when cleaning files
- add `%(OpenApiProjectReference.GlobalPropertiesToRemove)` metadata
- stop removing `$(Configuration)` or `$(Platform)` global properties
- address timing issues cropping up occasionally in builds using service ref features
- avoid `AfterTargets="Build"`; referencing projects sometimes continue while post-build work is done
- instead use `BeforeTargets="Build"` since that's a no-op target wrapping up a build
- set only properties in buildMultiTargeting\Microsoft.Extensions.ApiDescription.Server.targets
- items not evaluated early enough to reference in all cases
- rename Microsoft.Extensions.ApiDescription.Client tasks
- remove net461 task assembly
- add '--quiet' option
- add '--debug' option (when building Debug configuration)
- support `--` in `dotnet-getdocument`; users may want to explictly add options for GetDocument.Insider
- remove '--no-color' option
- use `IReporter` extension methods instead of static `Reporter` class
- reduce `static` use to ease testing (coming soon) and share the `IConsole` and `IReporter`
- add `ProgramBase`
- allow mix of known and unknown command-line arguments
- maintain existing behaviour using switch added in aspnet/Extensions#2210
nits:
- add a couple more `CommandLineApplicationExtensions` methods
- take VS suggestions
Fixes: #13086
- Fixed some wrong logging (wrong EventIds)
- Added a base class for ignitor tests
- Centralized code for capturing data in ignitor
- Make `WaitForXyz` methods return the thing they found
- Make `WaitForXyz` methods report logs on timeout
- Fix synchronization problems with some tests
- Split invalid event tests into their own class for code reuse
The main thing here is that some of the JS interop reliability tests had
causality/synchronization problems. They were either not waiting for a
render batch, or they were not *triggering* a render batch.
In addition to that, I did a general consolidation of the infrastructure
for these tests to make sure that they are all using the same set of
practices. I found and fixed cases where tests were using timeouts that
were too small (inconsistency) or where they were using non-threadsafe
data structures (these tests always involve concurrency).
Adds the ability to specify multiple assemblies to the Router
component.
Prior to preview 8, the router would search all dependencies of
`AppAssembly` for routable components. We made an intentional change to
stop that. However, we haven't yet give users a way to specify multiple
assemblies if their components are split across assemblies.
* [Blazor] Allows multiple components as entry points
* Removes all overloads that register a component statically with aborts
selector.
* Updates render component to have a RenderMode parameter that indicates
how the component must render. Valid values are Static, Server, and
ServerPrerendered.
* When using Server or ServerPrerendered we emit marker comments into
the page that are later used by blazor.server.js to bootrstrap a
blazor server-side application.
- start of #4914 and #4896
- make infrastructure more accessible to these projects
- update list of projects
- run `.\eng\scripts\GenerateProjectList.ps1`
* Ignore overriden properties in component parameters
* Modify MemberAssignment to return shadowed properties, but not inherited properties
* Modify ComponentProperties to throw if a Parameter property is non-public
Fixes https://github.com/aspnet/AspNetCore/issues/13162
- #12792
- client:
- add error if OpenAPI file does not exist
- separate unsupported TFM case from targets being called when disabled
- server:
- generalize multi-targeting handling in Microsoft.Extensions.ApiDescription.Server
- add `$(_OpenApiGenerateDocumentsTFM)`, the TFM used when invoking inner build
- default `$(OpenApiGenerateDocuments)` to 'true' only when a supported TFM exists
- add separate error for non-existent cache file in `OpenApiGetDocuments` target
- add error in `GetDocumentInsider` if no documents are found
- make `<Warning />` in the targets file an `<Error />`
- add more text to existing `ServiceNotFound` error
- both:
- write errors to `stderr`
- clean up top-level output for `Exception`s
- stop writing the `Message` twice
* Correct "Open API" mentions; should be "OpenAPI"
- change package tags and comments
* Add service reference projects to MvcNoDeps.slnf
nits:
- add "service reference" tag in Microsoft.Extensions.ApiDescription.* packages
- add "document generation" tag in Microsoft.Extensions.ApiDescription.Server package
- `.Trim()` TFM properties because `<TargetFrameworks>;netcoreapp3.0;;</TargetFrameworks>` is allowed
- don't use bold black for verbose messages
- reorder MSBuild property settings for readability
Fixes: #12553
This change renames all of our browser/DOM specific types from
`UIFooEventArgs` to `FooEventArgs` and puts the in the `.Web` namespace.
In addition to this, we're moving `EventHandlers` and `BindAttributes`
to the same. This has the impact of scoping the mappings those classes
provide based on the `.Web` namespace.
This means that we now expect `.Web` to be present as a using in
basically all contexts for a browser-based Blazor app. Updated
templates, samples and tests. I'll also need to update about a million
tests in the compiler codebase.
I've logged https://github.com/aspnet/AspNetCore.Docs/issues/13832 to
track the docs and release notes part of this work.
Fixes: #13012
This change introduces a circuit id 'secret' as the concept that's used when
doing handshaking between the client and the server, and makes CircuitId
(visible to user-code) a separate concept (not a secret, can't be used
to open a connection).
The scope of this grew once I realized that we probably shouldn't be
logging Circuit Secret in so many places, we should be logging CircuitId
as the piece of data we use for correlation, and try to keep the secret
out of logs except where really necessary (and with trace level).
I ended up creating a new type to represent the combination of the
circuit id and secret and prevent
accidental misuse, and then chased down all of the build errors.
As an extra detail, the circuit id is part of the data-protected payload
that's used as the secret. This way we can always get the id back from
the secret without any external storage.
Fixes: #12552
We're not documenting these types for public use in this release. We
already have an analyzer implemented to chase you away from taking a
dependency.
- Expanded `ReconnectDisplay` to have a `rejected` method on it. This is the method that indicates we will never be able to reconnect to the server. By default we provide a nice little message letting users know that reconnection is no longer possible and that a refresh must take place.
- Added a logger to the `DefaultReconnectionDisplay` since part of its job is handling `Retry` clicks which indirectly call `reconnect()`. Therefore, it needed the ability to log information to the console to inform users why certain reconnects were not possible.
- Updated the `UserSpecifiedDisplay` to have a `refused` understanding. Added a new CSS class to represent the `refused` state as well.
- Updated existing tests to abide by the new `ReconnectDisplay` structure
- Added a new test to validate that the `refused``ReconnectDisplay` method results in proper behavior.
#12442
- Updated text of reconnect dialog to be more clear.
- Added user feedback to the `Retry` event button click. The current flow is `Attempting to reconnect` -> `Failed to reconnect ... [Retry]` -> Click Retry -> `Attempting to reconnect`.
- Found that in cases where the server went away entirely the reconnect event would through unexpectedly preventing the reconnect display from handling a failed reconnect. Added a separate error flow to understand when the server went away/could not start a SignalR connection to.
- Could not find a great way to add tests for this scenario.
Addresses #12442
- Relaxed the `maxRetries` and `retryIntervalMilliseconds` parameters to enable the test to complete quicker. Couldn't reproduce a failure even as the test is originally on my own Mac.
#12578
Fixes part of: #12553
We don't believe that this is needed anymore. We no longer call
OnAfterRender when you're prerendering, so the main use case of this
type is gone.
* Does not produce warnings when receiving invalid event arguments.
* Does not produce warnings when receiving an invalid event handler id.
* Does not produce warnings when receiving an ack for an unknown batch.
- We initially did this change as part of EndpointRouting but the impact of that change resulted in a variety of performance regressions. To mitigate the impact of resetting state for a request we now only reset the state when an exception has occurred in a way that does not require any additional state machines to be allocated.
- Added a test to validate that http context state gets reset on exception handling.
#12897
[ApiAuthorization] Updates dependency versions
* Updates to the latest version of Identity Server.
* Updates to the latest version of oidc-client.
* Removes unncessary code from the templates.
* Updates EF migrations.
* Removes unnecessary ref assembly.
Fixes: #11610
I took the approach here of building this into `ComponentBase` instead
of `IHandleAfterRender` - *because* my reasoning is that `firstTime` is
an opinionated construct. There's nothing fundamental about `firstTime`
that requires tracking by the rendering, it's simply an opinion that
it's going to be useful for component authors, and reinforces a common
technique.
Feedback on this is welcome.
This is no longer shipped, because the templates installed by `dotnet
new -i` show up in VS now. Removing it now so we don't have to keep it
around in servicing forever.
* Add empty Authorization src and test projects
* Add references
* Move auth types into .Authorization project
* Move auth tests
* Fix Mvc.ViewFeatures
* Remove the reference from .Web to .Authorization, so it's truly optional
* Add empty Forms src and test projects
* Remove dependencies from Components.csproj
* Move forms sources and tests
* Reference .Forms from .Web (needed unless we also have .Forms.Web)
* Rebase on #12936
* Update reference assemblies
* CR: Add Authorization namespace
* Update ref sources
* Add missing using
* Add another missing using
This change prevents thread pool starvation when running a bunch of
selenium-based tests, by turning the blocking wait for a WebDriver to
start into an async wait.
This also seems to help with speed, and reliability since we're not
running too many browsers at once. I was experencing timeouts, and
seeing them in the debugger while running tests locally, this no longer
happens.
* 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.
* Ensure JsonSerializer always HTML encodes output.
* Update JsonOptions.JsonSerializerOptions to use encoder scheme that does not encode non-ASCII
characters by default. This makes the encoding comparable to Json.NET's defaults
* In SystemTextJsonHelper, ensure that the content is always HTML-encoded
* Unskip skipped test
Fixes https://github.com/aspnet/AspNetCore/issues/9946
Fixes https://github.com/aspnet/AspNetCore/issues/11459
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
- #12786
- escape `'<'` chars in attribute values to make the .targets file valid XML
- escape `'\''` chars nested within single-quoted values to make `msbuild` conditions valid
* 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.
* Insert seed localization for templates.
* Updated loc strings for Worker for some langs
* Update en string.json for Blazor project template
* Refresh strings for initial seeding
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
* Update HubProtocol.md
Updated the code sample in the protocol doc to reflect the actual programming API
* Update src/SignalR/docs/specs/HubProtocol.md
Co-Authored-By: Brennan <brecon@microsoft.com>
* fix#12516 by cleaning up error page
* add a Diagnostics.slnf because I was there
* missed the IIS update
* update WebHost's error page
* Fix slnf path
* Moves Identity UI to use Static Web Assets
* Removes the static files as embedded content.
* Stops plugging the static assets through the embedded file provider.
* Selects the UI framework at build time instead of runtime.
- In the case that other middleware change the path of an `HttpContext` and cause middleware to re-invoke we used to short-circuit on second time through the middleware pipeline, now we allow routing to occur.
- Added unit tests to validate the clearing of state.
#11233
[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.
* Add converters for ProblemDetails and ValidationProblemDetails
ProblemDetails & ValidationProblemDetails require IgnoreNullValues to be
applied on the types. We'll use a converter to workaround the absence of this
feature
Fixes https://github.com/aspnet/AspNetCore/issues/11522
* E2E test to show current behavior
* Actually support base-relative, root-relative, and absolute redirections during prerendering
* Fix MVC functional test
- We made a change to dispatch connection execution but that also ended up dispatching the tracking of those connections in the connection manager. While it's not a huge deal most of the time it can affect graceful shutdown as there can be queued connections that are delayed in the thread pool queue which are untracked. This change makes it so we track the KestrelConnection before dispatching.
- This change goes from pooling just the HttpContext to pooling the entire TContext. In the past this was a huge struct that got copied around and now it can be a class. Servers can provide the storage for the TContext via a new `IHostContextContainer<TContext>` interface.
- Removed IDefaultHttpContextContainer since it's been superseded by IHostContextContainer
- Move DefaultHttpContextFactory to Hosting to take advantage of internal methods
- Also handle a null FeatureCollection and null HttpContext and throw a better exception
We used to be inconsistent between what we'd do when formatting a value
based on whether or not you specified a format.
This change brings us back into consistency.
For a `default` DateTime/DateTimeOffset we will just call ToString on
it. For a `default` nullable of these types we will return the empty
string.
While it's definitly intended for `@bind` to have culture-sensitive
output for most cases, we want the tests to behave consistently for all
developers.
So this is an attempt to use a fixed culture for all of our testing.
- #12363
- correct a few VS issues
- void silent failures
- improve documentation
- support the `clean` target
- stop using experimentatal package version
* Allows the server to accept acks with a higher sequence number than the first queued pending render and caches up to it.
* Makes the client send acks for previous render batches.
* Makes the client repeat acks for errored render batches if it keeps receiving new render batches.
* Client awaits sending acks to ensure that they get send in order.