- WTE needs a way to detect if a `TagHelperDescriptor` is a component based `TagHelper` in order to turn features like validation, completion etc. on/off.
- Updated tests to add verification points for the new `IsRazorComponentTagHelper` method.
\n\nCommit migrated from 6fcd12e60b
* Adds support for publishing static web assets
* At publish time, it copies all the referenced assets from referenced
projects and packages into their final locations.
* Automatically pack static web assets for consumption
* Generate Microsoft.AspNetCore.StaticWebAssets.props and pack it into
build\Microsoft.AspNetCore.StaticWebAssets.props
* Generate `<<PackageId>>.props` and pack it into `build\<<PackageId>>.props`
importing Microsoft.AspNetCore.StaticWebAssets.props
* Generate `<<PackageId>>.props` and pack it into buildMultiTargeting\`<<PackageId>>.props`
importing `build\<<PackageId>>.props`
* Generate `<<PackageId>>.props` and pack it into buildTransitive\`<<PackageId>>.props`
importing buildMultiTargeting\`<<PackageId>>.props`
* Pack all the static web assets from the current project into `staticwebassets\**`\n\nCommit migrated from 87817bed3e
* Define static web assets in the current project
* These are assets under the wwwroot folder.
* By convention, the base path for these assets is `_content/<<PackageId>>`
with spaces and dots removed and all characters lower-cased.
* Retrieve static web assets from referenced projects\n\nCommit migrated from 50646aae64
* Specify UpToDateReloadFileTypes
Specify a list of file extensions that VS will monitor for file changes to reload the app.
Includes .razor and .cshtml files.
\n\nCommit migrated from 9a964127bf
This came up in the context of discussion around aspnet/AspNetCoredotnet/aspnetcore-tooling#5071.
Browsers use a 'first attribute wins' rule for evaluating attributes and
building the DOM - though duplicate attributes are considered to be a
spec violation.
Blazor wants to use 'last attribute wins' rules because that's most
sensible when you consider evaluation order and splatting.
This means that we have to have the markup block pass do the same thing
as the Blazor runtime when duplicates appear. However, since this is a
spec violation I'm proposing that we just make it an error (like we do
for malformed tags). There's no useful purpose for duplicate attributes
since browsers ignore it.
Since we're not going to allow this for elements. Let's go all of the
way and block it for components as well. And while we're here, lets
block some of the invalid cases where users try to mix onchange and
bind. These don't work today, so we should make them an error. If we
decide to add support for this case to the runtime that would require
compiler work anyway.
\n\nCommit migrated from 0c59ca5f74
* Directive attributes part 1: Support parameters in bound attributes
* update
* Fix test
* feedback
* Updated design
* Do case sensitive comparison
* more
* Bug fix
\n\nCommit migrated from 9bbf240948
* Imports static assets from packages containing custom msbuild
targets defining a StaticWebAsset item group.
* Generates an embeds a manifest into the application assembly
that contains a list of paths to the content roots of the
assets defined in the packages custom msbuild targets.\n\nCommit migrated from 8e70013b70
* Move the globs from the project system into the Razor SDK on a separate file that can be imported by itself.
* Import the file conditionally based on the EnableRazorContent property\n\nCommit migrated from 62e33dac1d
The intention here would have been to add to the existing GetCopyToOutputDirectoryItemsDependsOn property, defined in Microsoft.Common.Targets. Instead what was happening is that it was being completely overwitten with the _RazorGetCopyToOutputDirectoryItems entry, given that $(GetCopyToOutputDirectoryItems) doesn't exist as a property and must have been a typo (it exists as a task, not a property).
An effect of this bug was that the `AssignTargetPaths` target is not always executed before the `GetCopyToOutputDirectoryItems` target, which should explicitly depend on it. `AssignTargetPaths` is responsible for populating the `ContentWithTargetPath` itemgroup. Left empty, it appears to `GetCopyToOutputDirectoryItems` task that there are no Content files to copy to the final output directory, when in fact there are.\n\nCommit migrated from 4597bc3d55
- This is a pre-requisite to properly warnings users about TagHelpers in code blocks. With this change VS indicates that there's an asynchronous operation happening in a code block but because the code is auto-generated it happens behind the scenes and therefore always gets logged as a line 1 error (unusable). Therefore, to fix this issue there will be a partner PR that will go out in AspNetCore that adds analyzer errors for cases where `__tagHelperRunner.RunAsync` exists in code blocks that do not return `Task` and are not marked with `async` properly.
- Updated test files to reflect the new TagHelper codegen at design time.
- Note: This doesn't solve the `~/` case that will be in a follow up PR.
aspnet/AspNetCoredotnet/aspnetcore-tooling#8630
\n\nCommit migrated from 17af3efccd
- This adds support for C# single line variations of: `if`, `for`, `foreach`, `do`, `while`, `lock` and `using`.
- Turns out the existing parser had 99% of the support for these scenarios already. Therefore, in this change set I went ahead and added exhaustive tests to verify things worked end-to-end.
- Added a restriction to single line markup to not allow markup in single line control flow statements. Updated resx to provide a better error message for cases when users do use markup in single line control flow statements.
dotnet/aspnetcore-tooling#9637
\n\nCommit migrated from cf474c97aa
- Diagnostics were not being raised to the `RazorSyntaxTree` and weren't being ordered on final output. This resulted in some of our tests missing the fact that certain cases were generating errors.
- Made all three phases of Razor parsing order their diagnostics.
- Added `GetAllDiagnostics` methods to `SyntaxNode`s to be more consistent with IR documents.
- Updated test files. In some cases new errors were found because we're now lifting them to the `SyntaxTree`, in most others the errors are re-ordered.
**Note: In end-to-end scenarios diagnostics were not hidden, only unordered. The IR phase would find nested/hidden documents and lift them to the IR/C# documents.**
\n\nCommit migrated from ef31a9683b
The newline in the warning messages causes the warning message to appear as two separate warnings in the build output:
Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.targets(805,5): warning RAZORSDK1004: One or more Razor view or page files were found, but the project is not configured to add Razor support for MVC. The MSBuild property 'AddRazorSupportForMvc' must be set to correctly
Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.targets(805,5): warning RAZORSDK1004: compile Razor files that target MVC. For more information, see https://go.microsoft.com/fwlink/?linkid=868374.
This change fixes the warning message to appear as a single warning:
Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.targets(805,5): warning RAZORSDK1004: One or more Razor view or page files were found, but the project is not configured to add Razor support for MVC. The MSBuild property 'AddRazorSupportForMvc' must be set to correctly compile Razor files that target MVC. For more information, see https://go.microsoft.com/fwlink/?linkid=868374.\n\nCommit migrated from 373bf2b74f
* Shorten Microsoft.AspNetCore.Razor.Language.Test paths
- aspnet/AspNetCoredotnet/aspnetcore-tooling#9358 and aspnet/AspNetCoredotnet/aspnetcore-tooling#7882
- do 4046 renames
- adjust solutions to renamed directory
- special-case directory of the Microsoft.AspNetCore.Razor.Language.Test project in `TestProject`\n\nCommit migrated from 72b939d855
* Correctly update the .NET Core SDK used in Razor
* Replace LangVersion 8.0 with LangVersion Preview
* Remove AddRazorSupportForMvc from projects that do not require it
* Cleanup how AspNetCore.App is not referenced in the project
* Remove uses of _RazorComponentInclude from tests\n\nCommit migrated from 81ea07caf7
- Obsoleted old `GetItem` API.
- Updated tests to take new API.
- Added a new test to verify the broken scenario.
dotnet/aspnetcore-tooling#8972
\n\nCommit migrated from 2dd34b8dd8