Commit Graph

572 Commits

Author SHA1 Message Date
Pranav K 500bdc1fd4 Exclude RazorComponent items from RazorGenerate item group
Interim solution to allow components to share the .cshtml extension. When declared in
the project file, the SDK will prevent RazorComponent items from being included
in the RazorGenerate itemgroup.
\n\nCommit migrated from 92e2c70b69
2019-01-07 15:17:41 -08:00
Nate McMaster 9556cc133d
Merge branch 'release/2.1' into release/2.2 2019-01-04 14:17:28 -08:00
Ryan Nowak e6e8fba39c SDK updates for components tooling
This is a bug fix for the RazorComponentWithTargetPath xaml rule. We
need to have separate targets for components and views.

The other fix here is a change to the set of workarounds we're using for
components currently. We need this project capability for the correct
project host to be used when loading the project.
\n\nCommit migrated from 78163f7e4f
2019-01-04 13:08:05 -08:00
Pranav K 49dfd7dacc Add a test using 2.2 project with current Sdk (dotnet/aspnetcore-tooling#91)
* Add a test using 2.2 project with current Sdk

Fixes https://github.com/aspnet/AspNetCore/issues/5101

* Do not reference Microsoft.AspNetCore.App in test apps
\n\nCommit migrated from 9b4fd448d4
2019-01-04 10:36:41 -08:00
Ajay Bhargav Baaskaran 07a62871d0 Make whitespace in extensible directives be SpanKind.None (dotnet/aspnetcore-tooling#90)
\n\nCommit migrated from 9035677e46
2019-01-03 15:58:48 -08:00
Ryan Nowak 7f725e099c Pass filekind through the workspace layer
This commit enables us to initialize projects with the correct file
kind, thus allowing mixed views and components in the same project.

This isn't hooked up to MSBuild yet, so for now nothing will initialize
this code with the correct file kind.
\n\nCommit migrated from 7216d18cfb
2019-01-03 08:50:15 -08:00
Ryan Nowak 19bc651858 Add design-time MSBuild support for components
\n\nCommit migrated from f6f6e16467
2019-01-03 08:50:15 -08:00
Ryan Nowak 14abd88648 Clean up usage of FileKinds
\n\nCommit migrated from b45125a755
2019-01-03 08:50:15 -08:00
Ajay Bhargav Baaskaran 053121e0b7 Refined Start tag and End tag structure (dotnet/aspnetcore-tooling#62)
Regenerated baselines\n\nCommit migrated from d54460296f
2019-01-02 15:32:55 -08:00
Ajay Bhargav Baaskaran a10aff3a03
Specify correct global.json path for Razor.Design tests (#6311) 2019-01-02 14:30:01 -08:00
Nate McMaster 61e505c894
Merge branch 'release/2.1' into release/2.2 2019-01-02 08:58:22 -08:00
Ryan Nowak 583113686c Test cleanup for component tests
This code all got dumped here during the port. This change deletes tests
that have already **moved** to the aspnet/AspNetCore repo.

Also fixed the markup rewriter tests for components.
\n\nCommit migrated from 86cc904004
2019-01-01 22:30:04 -08:00
Ryan Nowak 74d56ce024 Ignore markup comments in components
Fixes: aspnet/AspNetCoredotnet/aspnetcore-tooling#6184

This gives us parity with the current behavior. Since comments aren't
meaningful in a component/render-tree context, we ignore everything
inside of them for codegen/lowering.
\n\nCommit migrated from 7250dd2624
2019-01-01 20:06:32 -08:00
Ryan Nowak f741241171 Fix lowering of data- with HTML for components
This was missed in the previous attempt to fix data- attributes. HTML
wasn't being translated into the correct IR.
\n\nCommit migrated from 239a88d973
2019-01-01 19:40:06 -08:00
Ryan Nowak 724178680f Provide a public entry point for Roslyn features
We need to be able to wire up these features from outside of the Razor
repo. For layering reasons this can't be done in the main Razor
assembly, so it can't be done by default.
\n\nCommit migrated from 386e2b3797
2019-01-01 17:51:48 -08:00
Ryan Nowak f973693438 Fix aspnet/AspNetCoredotnet/aspnetcore-tooling#6186
The issue here is that the compiler generates a different syntax tree
for `data-` attributes :(. I've added a note to dotnet/aspnetcore-tooling#6112 to follow up on
the compiler behavior. We used to parse data- attributes differently for
components, but I really don't think having the compiler special case
them makes sense.

For now I've added a workaround here to lower `data-` attributes in a
fashion similar to other dynamic attribute values.
\n\nCommit migrated from f5109fbfec
2018-12-31 16:14:04 -08:00
Ryan Nowak 7f3a187455 Fix aspnet/AspNetCoredotnet/aspnetcore-tooling#6187
The bug here is that we have extra whitespace being written out when the
component renders. This happens because parser adds an empty C#
statement node to wrap all of the whitespace that precedes `@functions`.
This is tracked by aspnet/AspNetCoredotnet/aspnetcore-tooling#6207.

To fix this issue I'm allowing the whitespace pass to skip over an empty
C# statement to remove whitespace. This is sound because an empty C#
statement produces no output - we allow removing whitespace before and
after all nodes that produce no output.
\n\nCommit migrated from e68d93f458
2018-12-31 14:43:16 -08:00
Ryan Nowak 14a8159919 Enable component class libraries in SDK
This change contains the enabling features to use Razor Components in a
class library. Currently we require a few workarounds, see the test
project file. This is good enough to get things unblocked.

One part that was needed was to register the correct component features
in the rzc. This is a good example, of why we don't like to add new
features that get registered conditionally, it's error-prone :)

The other part that was needed was to make some of the MVC-related
features for assembly attributes conditional on the TFM. We need to be
able to use the 3.0 (all inclusive) SDK, but without the MVC-related
features. This isn't the right heuristic, but it gets us unblocked.
\n\nCommit migrated from 8dbf02076b
2018-12-28 14:27:33 -08:00
Ryan Nowak 0c1c05efc6 Implement Components with new HTML parser
This change ports the existing Blazor component compiler features to
work on top of the Razor compiler. These new features are on once Razor
Language version is set to V3 or higher.

The tests and code for the old Blazor compiler were added to this repo
in previous changes. This change adds the necessary enabling features,
and gets the tests working.

Code generation for tests tests is identical with a few exceptions.
Design time directives now include line mappings (as they should). The
infrastructure seems to prefer windows style line-endings whereas the
Blazor code did the opposite. I plan to leave this alone unless it's a
problem for testing on *nix.

IR Generation will be cosmetically different due to different node names
and formatting. Structure should generally be the same.

----

In order to implement this support, I had to add the following core
features.

Configuring passes/engine-features based on the langauge version. This
required revisiting a *lot* of old tests and forcing them to use a
version appropriate Razor engine. A lot of our tests for legacy things
were using new versions of the language :(.

Configuring passes/engine-features to switch on/off depending on the
document kind.

Configuring directives depending on the file-kind. Directives are a
parser feature, so this decision needs to be made before the IR phase.
Directives that are specific to a file kind will override directives
that are not - this allows components to customize templates for
instance.

Adding functions/inherits/implements directive as mainline features that
are always on in V3. I'm not quite motivated to do this yet for
typeparam, but we might end up there. Remember that directives are
reserved words in Razor.
\n\nCommit migrated from a04addb86f
2018-12-23 23:37:54 -08:00
Nate McMaster 3641761d18
Convert AADIntegration projects to ProjectRef (#6082) 2018-12-21 11:43:09 -08:00
Ryan Nowak 45ad1c0ae8 Formalize Component node types
This change cleans up the intermediate node types that we have so far
for components and changes the naming, visibility, etc to match our
existing nodes.

The next change will integrate these types with the IR lowering process.
\n\nCommit migrated from 34cf523c0d
2018-12-21 11:07:12 -08:00
Nate McMaster c3beb1f9b1
build.cmd/sh changes (#5958)
Update the build scripts to support building subfolders or subgroups of projects

* Add build scripts for ci
* Remove obsolete scripts
* Add flags like --test and --pack to control running just test or packaging
* Add flags like --managed and --native to control building sub-types of projects
* Remove KoreBuild bootstrapper flags
* Update to extensions 3.0.0-preview.18619.1 (needed to get a fix for aspnet/Extensions#815 to make this change work on MSBuild.exe)
2018-12-20 16:52:15 -08:00
Ryan Nowak 51d19d1745 Code dump of Blazor compiler BindTagHelperDescriptorProvider
This change adds all of the code from the Blazor/Components compiler into
the Razor language assembly. Minimal refactoring or integration work has
been done, that is next :)

All of the code compiles and all unit tests pass, except the one I had
to skip until integration work is done.
\n\nCommit migrated from aa5c82ca5e
2018-12-20 16:04:24 -08:00
Ryan Nowak c37dada0dc Flow FileKind from project items -> code document
This is a bit of a rework of how we initially set this up, but with more
forethought to how this will work in the project system. I have not yet
surfaced this through VS.

My immediate next step is to light up the component integration tests
and something like this is on the critical path to get that work since
we need a way to specify in tests that a document should be treated as
a component.
\n\nCommit migrated from 6b81da3f02
2018-12-18 22:34:14 -08:00
Ajay Bhargav Baaskaran cef4e1aceb Added correct test TFMs 2018-12-18 13:06:20 -08:00
Ajay Bhargav Baaskaran 2a696f6a1c Merge branch 'release/2.2' 2018-12-18 12:50:01 -08:00
Ryan Nowak ceb1189b2e Stop generating page/view attribute in 3.0
\n\nCommit migrated from 4eb93869b9
2018-12-18 11:55:16 -08:00
Ajay Bhargav Baaskaran 647fbbac7b Merge branch 'release/2.1' into ajbaaska/merge-22 2018-12-17 18:40:08 -08:00
Ryan Nowak 2c2ff1f592 Code dump of component tests
This is a dump of the existing component codegen tests from
the Blazor effort.

I'm also adding the minimal Component types as a new shim to get things
to compile. This is similar to how our shims work already for MVC.

The next step will be add port functionality until the tests pass.
\n\nCommit migrated from 49f49dd9f0
2018-12-17 18:21:18 -08:00
Ajay Bhargav Baaskaran b079041488
Convert Razor to use Reference (#4954) 2018-12-17 12:10:40 -08:00
Ajay Bhargav Baaskaran 9fc340553f Minor text tag fix
\n\nCommit migrated from 5787d1e7d4
2018-12-14 16:34:03 -08:00
Nate McMaster 02780bac26
Merge branch 'release/2.2' 2018-12-14 16:03:16 -08:00
N. Taylor Mullen e8a584729f Fix racey directive token auto-complete.
- This happens because a completion session starts when we've rendered a marker directive token without a line pragma and then we return our parse results which provide a C# buffer with a line pragma. This pull request fixes that.
- Updated tests and verified in VS d16.0stg.

aspnet/AspNetCoredotnet/aspnetcore-tooling#4810
\n\nCommit migrated from ca593c80f7
2018-12-14 11:57:17 -08:00
Nate McMaster feb641ddda
Merge branch 'release/2.1' into release/2.2 2018-12-14 09:44:15 -08:00
Nate McMaster 13ae0057fb
Replace .Sources package references with local code (#4801)
Replaces package references the following packages with local code:

Microsoft.AspNetCore.Certificates.Generation.Sources
Microsoft.Extensions.CopyOnWriteDictionary.Sources 
Microsoft.Extensions.ClosedGenericMatcher.Sources
Microsoft.Extensions.ObjectMethodExecutor.Sources
Microsoft.Extensions.PropertyActivator.Sources
Microsoft.Extensions.PropertyHelper.Sources
Microsoft.Extensions.RazorViews.Sources
Microsoft.Extensions.SecurityHelper.Sources
Microsoft.Extensions.StackTrace.Sources
Microsoft.Extensions.WebEncoders.Sources
2018-12-14 08:36:36 -08:00
Ryan Nowak 341636b05d Convert Razor to netcoreapp3.0 2018-12-14 08:17:27 -08:00
Ajay Bhargav Baaskaran ad3835c3e2
Removed unnecessary projects (#4586) (#4612) 2018-12-12 12:59:04 -08:00
Ajay Bhargav Baaskaran 98f2973880
Removed unnecessary projects (#4586) 2018-12-12 10:41:06 -08:00
Ajay Bhargav Baaskaran 9105653629 Completely moved tag grouping logic to the parser (dotnet/aspnetcore-tooling#28)
* Completely moved tag grouping logic to the parser
- Removed MarkupElementRewriter
- Removed legacy Html parser
\n\nCommit migrated from c98b2fe1be
2018-12-11 18:24:39 -08:00
Chris Ross 7fdd930f50
Change IIS projects to target netcoreapp3.0 (#4371)
* Change IIS projects to target netcoreapp3.0 #3754
2018-12-11 13:46:46 -08:00
Nate McMaster 85e2147ff0
Merge branch 'release/2.2' 2018-12-07 11:11:44 -08:00
Nate McMaster 569a14ecb8
Merge branch 'release/2.1' into release/2.2 2018-12-06 17:09:03 -08:00
Ajay Bhargav Baaskaran 9f93a212f0 Partially moved tag grouping logic to the parser (dotnet/aspnetcore-tooling#20)
* Partially moved tag grouping logic to the parser
- Added StackGuard

* Feedback

* More feedback
\n\nCommit migrated from 0a37f5dafa
2018-12-06 16:08:43 -08:00
Ajay Bhargav Baaskaran cf6b1d7135 Correct logic for GetTagName
\n\nCommit migrated from 72a389149a
2018-12-06 16:08:42 -08:00
Ryan Nowak e3773b6383 Remove Razor tooling projects
Removes the Razor compiler/tooling projects from this repo
2018-12-06 07:47:00 -08:00
Justin Kotalik 0588b13f5b Fix 2.1 build issues and remove obsolete build code (#4443)
- Stop producing the 'Universe' lineup package
- Removes all PackageLineup code
- Use full msbuild on Windows
- Fix invalid reference to internal.aspnetcore.sdk in 2.1.x
- Fix shared folder references for PackageArchive task.
2018-12-05 17:01:02 -08:00
Ajay Bhargav Baaskaran 0c71f4f520 Added test for razor comment between code block and markup (dotnet/aspnetcore-tooling#14)
\n\nCommit migrated from 131003d0c3
2018-12-05 11:48:33 -08:00
Nate McMaster be3b66d1d1
Revert "Remove Razor tooling projects"
This reverts commit 3cfa6c0526.
2018-12-05 08:40:49 -08:00
Ryan Nowak 3cfa6c0526 Remove Razor tooling projects
Removes the Razor compiler/tooling projects from this repo
2018-12-04 19:58:37 -08:00
Ajay Bhargav Baaskaran ad0f2a5af4 Group HTML tags (dotnet/aspnetcore-tooling#6)
\n\nCommit migrated from a2d1ac4cea
2018-12-04 16:04:20 -08:00
Ryan Nowak ebd37599b6 PR feedback
\n\nCommit migrated from d38687acf2
2018-12-04 14:08:21 -08:00
N. Taylor Mullen 3c3d699804 Only add DotNetCoreRazorConfiguration capability in SDK for netcoreapp3.0.
- Prior to this we were unconditionally adding the `DotNetCoreRazorConfiguration` capability resulting in 1.0 projects looking like 2.1+ projects.
- Added a project capability test that verifies we're maintaining project capabilities for netcoreapp3.0 projects.
- Added a project capability test that verifies we don't muck with 1.1 project capabilities.

aspnet/Razordotnet/aspnetcore-tooling#2751
\n\nCommit migrated from 8d733ecc04
2018-12-04 13:01:26 -08:00
Ryan Nowak 6b4e03db1b Merge pull request dotnet/aspnetcore-tooling#2 from aspnet/rynowak/workaround-publishing
Attempt to work around dotnet/arcadedotnet/aspnetcore-tooling#1425\n\nCommit migrated from 451f10ab8f
2018-12-03 13:33:46 -08:00
Ryan Nowak c9f0acd5fd Increase timeout
\n\nCommit migrated from 5f1204a960
2018-12-03 12:59:56 -08:00
Ajay Bhargav Baaskaran 19f5798c2a Refactor attribute parsing (dotnet/aspnetcore-tooling#3)
\n\nCommit migrated from b7441d433f
2018-12-03 12:24:12 -08:00
Ryan Nowak 616ec14459 Remove Razor Runtime projects
\n\nCommit migrated from 39472ca0d6
2018-12-02 13:40:01 -08:00
N. Taylor Mullen c8bb6c34bb Use MVC 2.1 at design time for Razor 3.0 projects. (dotnet/aspnetcore-tooling#4324)
- When we detect a design time build we force tooling to use 2.1
- In runtime builds (i.e. rzc) it still uses the 3.0 configuration for 3.0 apps.

(cherry picked from commit dotnet/aspnetcore-tooling@0326abe530)
\n\nCommit migrated from a6dc88e455
2018-12-02 11:01:08 -08:00
Ajay Bhargav Baaskaran 5bb16b1a14 Refactored Html parser - part 1
(cherry picked from commit dotnet/aspnetcore-tooling@31f53d44b5)
\n\nCommit migrated from b154e53f06
2018-12-02 10:59:41 -08:00
Ryan Nowak 6fa46903e2 Fix DevDiv 736427
When a user builds a 2.1 or 2.2 project with a 3.0 they can get an error
due to invalid command line options from rzc. What happens is that the
3.0 tasks (which are a singleton) are talking to the 2.X build tool
(which is NOT a singleton).

Recently some changes were make to the 3.0 tasks which caused this bug
because it did not properly accomodate downlevel versions of rzc. We
have an integration test for this scenario for but the regression was
not detected, so obviously something is wrong with the test setup. I'll
investigate that separately.

(cherry picked from commit dotnet/aspnetcore-tooling@1aace2b6c7)
\n\nCommit migrated from d2654d0847
2018-12-02 10:59:09 -08:00
Ryan Nowak 7df54be754 Merged PR 304: Enable local builds with dotnet/Arcade
[WIP] Enable local builds with dotnet/Arcade
\n\nCommit migrated from 409618521f
2018-12-02 00:25:55 +00:00
Ryan Nowak 1c99d2ed4a Reorganize source code in preparation to move into aspnet/AspNetCore
Prior to reorganization, this source code was found in https://github.com/aspnet/Razor/tree/dotnet/aspnetcore-tooling@582f3f867eeb8fca00e6b328faf7665c9a98476c
\n\nCommit migrated from 33b287d4a4
2018-11-29 15:13:03 -08:00
Ryan Nowak a5ef5133a3 Reorganize source code in preparation to move into aspnet/AspNetCore
Prior to reorganization, this source code was found in https://github.com/aspnet/Razor/tree/dotnet/aspnetcore-tooling@582f3f867eeb8fca00e6b328faf7665c9a98476c
\n\nCommit migrated from 33b287d4a4
2018-11-29 15:13:03 -08:00
N. Taylor Mullen 0326abe530 Use MVC 2.1 at design time for Razor 3.0 projects. (#4324)
- When we detect a design time build we force tooling to use 2.1
- In runtime builds (i.e. rzc) it still uses the 3.0 configuration for 3.0 apps.
2018-11-29 12:41:29 -08:00
Nate McMaster 26dfce1f3c
Disable building src/Components and fix its code signing configuration (#4299) 2018-11-28 15:29:25 -08:00
Ryan Brandenburg 8a37389a9f Fix RepositoryUrl for some repos 2018-11-28 14:54:47 -08:00
Ajay Bhargav Baaskaran 31f53d44b5 Refactored Html parser - part 1 2018-11-28 13:28:14 -08:00
Ajay Bhargav Baaskaran 46242b307c
Added build scripts for Razor (#4298) 2018-11-28 13:27:41 -08:00
Ryan Nowak 1aace2b6c7 Fix DevDiv 736427
When a user builds a 2.1 or 2.2 project with a 3.0 they can get an error
due to invalid command line options from rzc. What happens is that the
3.0 tasks (which are a singleton) are talking to the 2.X build tool
(which is NOT a singleton).

Recently some changes were make to the 3.0 tasks which caused this bug
because it did not properly accomodate downlevel versions of rzc. We
have an integration test for this scenario for but the regression was
not detected, so obviously something is wrong with the test setup. I'll
investigate that separately.
2018-11-28 12:42:54 -08:00
Ryan Brandenburg ba1bb521bc Add korebuild.json back to SignalR and Razor 2018-11-28 09:33:49 -08:00
Ryan Brandenburg 64e97a3604 Reorganize source code in preparation to move into aspnet/AspNetCore
Prior to reorganization, this source code was found in 582f3f867e
2018-11-27 15:43:05 -08:00
Ryan Brandenburg 6f80eeda29 Reorganize source code in preparation to move into aspnet/AspNetCore
Prior to reorganization, this source code was found in 8ba0a89425
2018-11-27 12:16:27 -08:00
Ryan Brandenburg 1b461749cb Reorganize source code in preparation to move into aspnet/AspNetCore
Prior to reorganization, this source code was found in fd4572874e
2018-11-27 10:52:49 -08:00