Commit Graph

222 Commits

Author SHA1 Message Date
David Fowler 53841f90f9 Make some tweaks to the default content globs (dotnet/aspnetcore-tooling#820)
* Make some tweaks to the default content globs
- Don't publish/copy launchSettings.json
- Make sure static content and configuration work with single file turned on
- Added test

\n\nCommit migrated from 63e8681fff
2019-07-16 00:24:38 -07:00
Ajay Bhargav Baaskaran 7aeaa72f25 Modify tag helper infrastructure to configure case sensitivity (dotnet/aspnetcore-tooling#793)
* Modify tag helper infrastructure to configure case sensitivity

* Cleanup and added more tests

* More cleanup and added necessary diagnostics

* More feedback

* Added more tests
\n\nCommit migrated from 20b8286751
2019-07-15 17:07:27 -07:00
N. Taylor Mullen 810e32ffc4 Update tests to specify public [Parameter]
- Updated existing tests to use `public` accessibility for parameters. As part of this also updated baselines.
- We now recommend that `[Parameter]`'s should be `public`. In the future this will be a requirement.

aspnet/AspNetCoredotnet/aspnetcore-tooling#8825
\n\nCommit migrated from 2ceb597f82
2019-07-12 11:48:54 -07:00
N. Taylor Mullen c76ac7e7b0 Don't pass Analyzers to Razor declaration compilation Csc task invocation.
- Without this any diagnostics from Analyzers will be doubly reported. One for the declaration compilation and one for the view compilation.

aspnet/AspNetCoredotnet/aspnetcore-tooling#8825
\n\nCommit migrated from 6d115d460b
2019-07-10 16:04:59 -07:00
Ryan Nowak cd8ec7ae66 Move [Layout]
This will be coordinated with the equivalent change in the runtime repo.
\n\nCommit migrated from c82d53eaaa
2019-07-04 15:36:21 -07:00
N. Taylor Mullen d9f35d4482 Add support for C# 8 nullable forgiveness operator.
- Added a feature flag to ensure this functionality does not impact pre-3.0 applications. This change is in fact a breaking change because some less-common scenarios will no longer be valid. For instance, `@Name!.Hello`used to treat the `!.Hello` as markup, now it will be treated as part of the expression.ExpressionChunkGenerator
- Updated parser flags tests
- Updated parser tests
- Updated the C# 8.0 integration tests to include the new nullable forgiveness scenarios.

aspnet/AspNetCoredotnet/aspnetcore-tooling#11188
\n\nCommit migrated from 625c605607
2019-07-02 10:17:18 -07:00
Javier Calvarro Nelson 9ac7cb8f00 Unconditionally enable content in RCLs (dotnet/aspnetcore-tooling#723)
\n\nCommit migrated from 50f6b2d4d6
2019-07-02 18:35:03 +02:00
Ryan Nowak bfbb9a78a2 Fix a bug with ref and declaration phase
This fixes a regression in the new `@ref` support, where the build will
fail during the declaration pass.

The problem is that the EliminateMethodBodyPass runs really early and
wipes out the usage of `@ref` before we have a chance to see it. The
solution is to make it run really late. This makes sense because we
basically just use this pass to do cleanup.
\n\nCommit migrated from 09b50151ef
2019-07-01 17:26:14 -07:00
Ryan Nowak dbf5b80f97 PR feedback
\n\nCommit migrated from bfc2485b67
2019-07-01 15:29:08 -07:00
Ryan Nowak e9ac371854 General cleanup of bind code
Removed support for more obsolete cases and cleaned up some out-of-date
comments.
\n\nCommit migrated from 19c6a6fa4b
2019-07-01 15:29:08 -07:00
Ryan Nowak 8d6e13082d Remove handling of pre-directive-attribute cases
\n\nCommit migrated from 2e34a6ace6
2019-07-01 15:29:08 -07:00
Ryan Nowak e1f53b4bd6 Add code generation support for culture
Adds the code generation support for culture + bind.

Some additonal changes are needed for the compiler support for bind, we
need to pass the culture into the code that unwraps the value as well.

There's no need to eagerly push these changes into the runtime (can wait
for the compiler change to go in) because nothing in our runtime tests
use the new feature.
\n\nCommit migrated from 6aad9748e8
2019-07-01 15:29:08 -07:00
Ryan Nowak 04d7e63b79 Add culture parameter to element-bind tag helpers
\n\nCommit migrated from 7515e2ce49
2019-07-01 15:29:08 -07:00
Ryan Nowak 66cb243807 Add codegen for default format
\n\nCommit migrated from e5be8d4673
2019-07-01 15:29:08 -07:00
Ryan Nowak 3c84c57c61 Add the ability to specify invariant and format
Adds the ability to specify that an `<input type="..." />` for some
specific value of `type` maps to the invariant culture and/or provides
a default format.

The primary examples of usage would be the number field which wants to
use invariant culture, or datetime which wants to use invariant culture
and a format string.
\n\nCommit migrated from 60f2d563a6
2019-07-01 15:29:08 -07:00
Ryan Nowak 2c6e1dacac Use ref-assembly code in shim
Updates our Components shim to use the ref assembly code. This is just
cleanup and will help us keep up-to-date with API review changes since
we can just copy-past the files.

I made two modifications to make this simple.
- Removed our built-in components
- Removed the HTTP stuff

This makes it easier for us to maintain the shim. You can see cases
where I had to update tests because they diverged from what the real
APIs look like (no product bugs).

I'd still like to improve this workflow so suggestions wanted xD
\n\nCommit migrated from 8517be2bac
2019-07-01 14:22:26 -07:00
Ryan Nowak 895ad896c7 Fix: dotnet/aspnetcore-tooling#11197 automatic backing-field for @ref (dotnet/aspnetcore-tooling#707)
This change makes @ref define a field for you by default. We didn't do
this originally because we weren't sure if the compiler generating a
field would always be what you want, and more importantly,
we didn't have the expressiveness to add an opt-out.

Now that we have directive attributes, it's easy to create an opt-out
for the field generation. The special thing about it is that where
you opt-out has to be static. For this reason the @bind:suppressField
attribute cannot be used with a value, you either have the flag or not.

Additionally, we don't support automatic field generation for
generics, because usually we can't write the field name. If we
want to in the future could make this work when the generic
type arguments are specified. So in the case of generics,
you have to opt-out, and you will get a diagnostic
that tells you so.\n\nCommit migrated from dadf9faf22
2019-07-01 13:58:25 -07:00
Ajay Bhargav Baaskaran 0659180119 Do case insensitive comparison in DefaultRazorProjectFileSystem.GetItem (dotnet/aspnetcore-tooling#709)
\n\nCommit migrated from ff305c700f
2019-06-28 11:02:55 -07:00
Pranav K 4e16cfd4da Use LogErrorFromException when FindAssembliesWithReferencesTo throws (dotnet/aspnetcore-tooling#702)
Currently FindAssembliesWithReferencesTo produces a stacktrace when P2P builds fail - for instance
if the referenced project has a compiler error. This changes it to use LogErrorFromException.

In addition, there was a typo in the property that disabled the feature.

Fixes https://github.com/aspnet/AspNetCore/issues/11226\n\nCommit migrated from 87c12a116c
2019-06-26 11:18:54 -07:00
Javier Calvarro Nelson 19d9dbcd43 Removes the logic for sanitizing the base path for static web assets (dotnet/aspnetcore-tooling#700)
Removes the logic for sanitizing the base path for static web assets\n\nCommit migrated from 98b168c894
2019-06-25 18:35:38 +02:00
Doug Bunting adfe6f09e4 Move to 3.0 Preview 6 SDK and 2.1.11 runtime (dotnet/aspnetcore-tooling#695)
- add feeds that SDK no longer provides automatically when building test apps
- add another allowed build warning in some integration tests\n\nCommit migrated from cfd4698381
2019-06-24 10:51:23 -07:00
Ryan Nowak ef4773a2d5 Add attribute splatting compiler support (dotnet/aspnetcore-tooling#640)
* Add TagHelperDescriptorProvider

* Remove bad life-choice

* Add some AddRange love

* Add splatting lowering and codegen

* PR feedback
\n\nCommit migrated from 9c8dd1cae7
2019-06-21 14:48:09 -07:00
Ajay Bhargav Baaskaran fa65b30dce Don't require preceding @ for event handler directive attributes (dotnet/aspnetcore-tooling#658)
* Don't require preceding @ for event handler directive attributes

* updated event handler th attribute type
\n\nCommit migrated from 6dce1532be
2019-06-20 17:05:59 -07:00
Ajay Bhargav Baaskaran ab867ec5e2 Allow @bind:event override when used with @bind (dotnet/aspnetcore-tooling#687)
* Allow @bind:event override when used with @bind

* Added more tests to cover standalone @bind-value=... case

* fix
\n\nCommit migrated from a399bd072e
2019-06-20 16:01:29 -07:00
Pranav K 7a510b311d Fixup incremental builds with ApplicationPartsDiscovery (dotnet/aspnetcore-tooling#693)
\n\nCommit migrated from df3c4d533a
2019-06-20 13:53:35 -07:00
Steve Sanderson 64f56b7607 For bind on element, also write the updated attribute name to the render tree builder (dotnet/aspnetcore-tooling#689)
\n\nCommit migrated from 6e5490049d
2019-06-20 09:54:06 +02:00
Pranav K 060ff0d878 Ensure ApplicationPart attributes are added during incremental builds (dotnet/aspnetcore-tooling#686)
Fixes https://github.com/aspnet/AspNetCore/issues/11315\n\nCommit migrated from 1a7a74bce8
2019-06-19 11:43:07 -07:00
N. Taylor Mullen c16d55c63f Allow `content`, `output` and `context` as keywords to VC params.
- It looks that when we first did VCTH we never put in the effort to reduce our footprint on available parameters for `ViewComponentTagHelper`s. I went ahead and added several underscores to the generated fields/parameters to reduce collisions.
- Updated tests to reflect the new codegen.

aspnet/AspNetCoredotnet/aspnetcore-tooling#8645
\n\nCommit migrated from b545a4de75
2019-06-19 11:19:16 -07:00
N. Taylor Mullen 261b256cf8 Fix error spacing.
\n\nCommit migrated from 1fdb3f3fdb
2019-06-06 13:22:33 -07:00
Ajay Bhargav Baaskaran 30668fb196 Ignore extensible directive nodes coming from Imports when generating padding (dotnet/aspnetcore-tooling#655) (dotnet/aspnetcore-tooling#661)
\n\nCommit migrated from 6d1dea7141
2019-06-06 11:19:50 -07:00
Javier Calvarro Nelson 2c01615cad [Flaky tests] Restore package projects at build time
\n\nCommit migrated from 8ee0e6d5b4
2019-06-05 15:47:52 -07:00
Javier Calvarro Nelson 22f593b796 [Static Web Assets] Removes support for embedding the development manifest
* Stops embedding the manifest in favor of using a file copied to the output folder.
\n\nCommit migrated from 4c65b1947f
2019-06-05 13:40:11 -07:00
N. Taylor Mullen 48eeaefc1e Add Razor component TagHelper detection.
- 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
2019-06-03 16:29:45 -07:00
Ajay Bhargav Baaskaran c588d53a42 Use an explicit intermediate node for directive attributes (dotnet/aspnetcore-tooling#638)
* Use an explicit intermediate node for directive attributes

* More cleanup
\n\nCommit migrated from f8d7f4cc3b
2019-06-03 13:54:28 -07:00
Pranav K 6be2d3dfcd Allow UpToDateReloadFileTypes to be modified by packages (dotnet/aspnetcore-tooling#639)
* Allow UpToDateReloadFileTypes to be modified by packages

* Allow file watching with dotnet-watch
\n\nCommit migrated from fbcd0c2416
2019-06-02 08:44:27 -07:00
Pranav K 9d8e9fb3a7 Allow file watching with dotnet-watch
\n\nCommit migrated from 42d3a88fed
2019-06-01 08:10:10 -07:00
Pranav K 5c59b78415 Allow UpToDateReloadFileTypes to be modified by packages
\n\nCommit migrated from 81c2e03bc3
2019-05-31 15:16:09 -07:00
Javier Calvarro Nelson 1c27d78420 Adds support for packing and publishing static web assets
* 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
2019-05-30 21:51:44 +02:00
Ryan Nowak 33e8098b4f Remove obsolete project file
\n\nCommit migrated from a7d1373707
2019-05-29 20:06:31 -07:00
Nate McMaster b45c32fa5b Add support for source-build (dotnet/aspnetcore-tooling#620)
\n\nCommit migrated from 986c224acf
2019-05-29 13:06:38 -07:00
Ajay Bhargav Baaskaran f25734acf4 Support parsing directive attributes - Part 2/2 (dotnet/aspnetcore-tooling#619)
* Support parsing directive attributes
\n\nCommit migrated from 5eb8ef43eb
2019-05-26 12:43:13 -07:00
Javier Calvarro Nelson 68f5fec0b0 Suports discovery of static web assets from referenced projects (dotnet/aspnetcore-tooling#605)
* 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
2019-05-24 10:42:38 +02:00
Pranav K 66dd6b35d3 Specify UpToDateReloadFileTypes (dotnet/aspnetcore-tooling#611)
* 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
2019-05-22 16:43:02 -07:00
Ajay Bhargav Baaskaran db66452bbd Fix bug in bind lowering logic
\n\nCommit migrated from 5bcd008779
2019-05-22 14:06:32 -07:00
Ryan Nowak 95bb698c5a Make duplicate attribute names an error (dotnet/aspnetcore-tooling#604)
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
2019-05-21 16:37:08 -07:00
Ajay Bhargav Baaskaran 72d017cc1b Added support for @attribute directive (dotnet/aspnetcore-tooling#607)
\n\nCommit migrated from 67b8a838da
2019-05-21 15:42:56 -07:00
Ajay Bhargav Baaskaran 5bad5de7ee Directive attributes part 1: Support parameters in bound attributes (dotnet/aspnetcore-tooling#597)
* 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
2019-05-21 13:07:23 -07:00
Javier Calvarro Nelson 13397dd4d6 Initial support for static assets in Razor Class Libraries (dotnet/aspnetcore-tooling#580)
* 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
2019-05-21 15:03:00 +02:00
Javier Calvarro Nelson 111e26dd03 Conditionally enable content items in the razor SDK (dotnet/aspnetcore-tooling#589)
* 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
2019-05-20 21:06:38 +02:00
Alex Lorimer 98a2a4348b fixed destructive property assignment (reference self correctly using `$(GetCopyToOutputDirectoryItemsDependsOn)` instead of `$(GetCopyToOutputDirectoryItems)`) (dotnet/aspnetcore-tooling#603)
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
2019-05-20 06:39:51 -07:00