Commit Graph

39740 Commits

Author SHA1 Message Date
N. Taylor Mullen c87de5a0fc Add TagHelper functional test.
- Added an end-to-end test that verifies all content behaviors, interactions and functionalities of tag helpers.
- Added some common user scenarios to verify that the system works how we expect.

#1116
2014-10-09 13:37:29 -07:00
NTaylorMullen 74974d371c Add error mechanism for TagHelperParseTreeRewriter.
- Replaced customer facing Debug.Assert with a new error mechanism to surface errors to GenerateCode callers.
- The new mechanism is a general purpose way for ISyntaxTreeRewriters to add errors to the parsing phase.

#174
2014-10-09 12:58:14 -07:00
NTaylorMullen 72c449bf86 Add TagName attribute for tag helpers.
- Made it so the TagHelperDescriptorFactory could pull tag name targets from TagNameAttributes on types.
- Tested the behavior between TagNameAttribute and TagHelperDescriptorFactory (the only consumer of the attribute).
- Made sure to test duplicate and inherited class scenarios.

#120
2014-10-09 12:58:12 -07:00
N. Taylor Mullen ec638b147a Add ContentBehaviorAttribute for TagHelpers.
- Added detection of custom ContentBehaviors via the ContentBehaviorAttribute in the TagHelperDescriptorFactory.
- Updated some comments in the ContentBehavior enum.
- Add tests to validate custom content behavior resolution.

#122
2014-10-09 12:58:09 -07:00
NTaylorMullen d080dc8f71 Test TagHelperScopeManager functionality.
#155
2014-10-09 12:58:06 -07:00
NTaylorMullen 66aea52542 Add TagHelperScopeManager for runtime.
- Also added an interface ITagHelperScopeManager so we can activate the type via DI.

#155
2014-10-09 12:58:03 -07:00
NTaylorMullen b1a3c8c1d4 Test TagHelperRunner, TagHelperOutput and TagHelperExecutionContext.
#154
2014-10-09 12:58:00 -07:00
NTaylorMullen 4378f9613e Add TagHelperRunner for TagHelper runtime.
- This involved adding the following core classes: TagHelper, TagHelperExecutionContext, TagHelperOutput, TagHelperContext.  All of which aid in running TagHelpers.

#154
2014-10-09 12:57:57 -07:00
NTaylorMullen dfe41eced8 Updated versions for runtime project. 2014-10-09 12:57:54 -07:00
NTaylorMullen b37b11d4b6 Add tests to validate TagHelperDescriptorResolver.
- Tested the descriptor resolver and its underlying dependencies (TagHelperTypeResolver and TagHelperDescriptorFactory).

#99
#158
2014-10-09 12:57:52 -07:00
NTaylorMullen f9c70a0644 Add TagHelperDescriptorResolver.
- This involved also adding a TagHelperTypeResolver and TagHelperDescriptorFactory.
- The TagHelperTypeResolver is responsible for determining the format of lookup text's used throughout the tag helper system.  By default it handles the following formats:
"assemblyName"
"specificType, assemblyName"
- It also restricts what types are considered TagHelpers.  In this implementation we only accept public, non-nested, non-abstract, non-generic TagHelpers.
- The TagHelperDescriptorFactory is responsible for converting a Type to a TagHelperDescriptor.
- Added tests to validate TagHelperDescriptorResolver, TagHelperTypeResolver and TagHelperDescriptorFactory.

#99
#158
2014-10-09 12:57:49 -07:00
N. Taylor Mullen 7db4ed7f7e Add tests to validate @addtaghelper directive.
- Fixed existing tests to work with new RazorParser.
- Validated directive syntax tree creation, errors and code generation.

#111
2014-10-09 12:57:46 -07:00
N. Taylor Mullen b67b8dae3d Add @addtaghelper directive.
- Also added some infrastructure pieces for it such as the ITagHelperDescriptorResolver and the default implementation TagHelperDescriptorResolver which will be filled out in a later commit.
- Reworked some extensibility points to allow accessibility of the descriptor resolvers per offline discussions.

#111
2014-10-09 12:57:43 -07:00
NTaylorMullen 05d8193775 Add test for TagHelperAttributeValueCodeRenderer extensibility.
- Tested that we can successfully plugin our own TagHelperAttributeValueCodeRenderer.
- Moved some existing TagHelper test logic into its own base type to enhance code reusability.

#119
2014-10-09 12:57:40 -07:00
NTaylorMullen 2b6b437952 Add extensibility point for TH attribute code gen.
- Enabled the CSharpCodeBuilder to create the CSharpCodeVisitor which exposes a CSharpTagHelperCodeRenderer which is indirectly used to render attribute values.
- Fixed up some existing classes that just new'd up the CSharpCodeVisitor class to instead take in the decorated version.

#119
2014-10-09 12:57:37 -07:00
N. Taylor Mullen c3b51cbbdf Add code generation tests for tag helpers.
#72
2014-10-09 12:57:34 -07:00
N. Taylor Mullen 50fa3ee3e3 Create TagHelper specific C# code Generation.
- Added TagHelperChunk generation.
- Added CSharp visitors to understand TagHelperChunks and render corresponding C# code.
- Refactored some code in the CSharpCodeVisitor so it could be utilized in other classes.
- Added a CSharpFieldDeclarationVisitor to render declaration pieces for TagHelper's
- Added metadata to represent specific TagHelper code generation constructs.

#72
2014-10-09 12:57:31 -07:00
N. Taylor Mullen 0b5f0cd565 Rebased onto latest dev.
- Fixed tag helper parse tree visitor rebase error.
2014-10-09 12:50:56 -07:00
N. Taylor Mullen b1b1da0781 Add Microsoft.AspNet.Razor.Runtime src and test project.
#136
2014-10-09 12:50:52 -07:00
N. Taylor Mullen 950828cbab Refactored CodeGeneratorContext to CodeBuilderContext.
- Needed to separate the context's of "generation" and "building" to enable the communication of the TagHelperProvider.
2014-10-09 12:50:49 -07:00
N. Taylor Mullen 20824f37e0 Add tests to verify TagHelperParseTreeVisitor.
- Added tests to validate TagHelperParseTreeVisitor when dealing with valid HTML elements.

#71
2014-10-09 12:50:45 -07:00
N. Taylor Mullen bb3ad0ede4 Fix test to work with TH rewriters.
- Added understanding to the ParserTestBase for TagHelperBlock's
- Added a helper class MarkupTagHelperBlock to make building test TagHelpers easier.
- Fixed some existing tests that "new"d up the RazorParser and didn't obide by the new contract (to provide optimizers).

#71
2014-10-09 12:50:42 -07:00
N. Taylor Mullen 3cba84104d Add TagHelper parse tree visitor.
- The visitor looks for TagBlock's that match registered TagHelpers and rebuilds them into TagHelperBlock's.
- Added the code generator and corresponding chunk for a TagHelperBlock.
- Added syntax tree specific objects & helper methods to create accurate tag helper structures.

#71
2014-10-09 12:50:39 -07:00
N. Taylor Mullen b68fae9b8c Removed the TypeActivator from TagHelper creation.
- We now new up TagHelper's, requiring them to have parameterless constructors.
- Added test to validate throwing.
- Removed existing tests that expected the constructor injection behavior.

#1303
2014-10-09 12:48:20 -07:00
NTaylorMullen 3dff1ca410 Add ITagHelperActivator.
- The TagHelperActivator enables dependency injection via properties and allows access to the ViewContext.
- This replaces the ICanHasViewContext mechanism that we had in place before.
- Added tests and fixed up existing to work with new format for providing ViewContext.

#1258
2014-10-09 12:39:57 -07:00
Doug Bunting 05c35dd3ba Add missing access modifier 2014-10-09 12:39:45 -07:00
Doug Bunting 3492be3c6c Add copyright notices to new files 2014-10-09 12:39:32 -07:00
Doug Bunting 639a788ed8 Tag Helpers: add `ModelExpression` class to support `Expression<Func<TModel, TValue>>` attributes
- includes new `RazorPage<TModel>.CreateModelExpression<TValue>()` method
- #1240

nit:
- regenerating the resources reordered Microsoft.AspNet.Mvc.Core's Resources.designer.cs
2014-10-09 12:39:19 -07:00
Doug Bunting 3290791c5f Use nameof when initializing `GeneratedTagHelperContext`
nits:
- missing blank line before a comment
- cleanup line breaks in `RazorPage.CreateTagHelper`
2014-10-09 12:39:04 -07:00
Doug Bunting 9899cb336a Cleanup tabs in project.json files 2014-10-09 12:38:52 -07:00
NTaylorMullen e44e59fd29 Updated to work with latest Razor changes. 2014-10-09 12:38:42 -07:00
NTaylorMullen d041249b27 Add CreateTagHelper to RazorPage.
- The CreateTagHelper method is responsible for creating and activating TagHelpers.
- Added the support for requesting the ViewContext.
- Added tests to validate the tag helper creation mechanism.

#1104
2014-10-09 12:38:31 -07:00
N. Taylor Mullen 082512f63c Add writing scopes to RazorPage.
- RazorPage now has the ability to use writing scopes to control where things are written.
- This enables RazorPages to use these writing scopes with TagHelpers.  TagHelpers use them to buffer attributes that have C# contained within them and to also buffer content of TagHelpers whos ContentBehavior is Modify.
- Added RazorPage tests to validate their functionality.

#1102
2014-10-09 12:38:19 -07:00
NTaylorMullen e995e7a3e2 Configure host to utilize tag helper types.
- Set the appropriate GeneratedTagHelperContext properties to ensure code is generated correctly.
- Set the TagHelperDescriptorResolver.

#1165
2014-10-09 12:38:04 -07:00
N. Taylor Mullen 757441777e Use Microsoft.AspNet.Razor.Runtime project. 2014-10-09 12:37:54 -07:00
N. Taylor Mullen 24a12ba103 Use CodeBuilderContext instead of CodeGeneratorContext. 2014-10-09 12:37:38 -07:00
NTaylorMullen be4a6c8d98 Split FunctionalTests from Mvc solution.
- Created a solution that had everything the Mvc.sln had EXCEPT functional tests.
- Added Mvc.NoFun.sln.

#1227
2014-10-09 12:18:30 -07:00
Chris Ross 4853554147 #39 - Port the OAuth Bearer middleware from Katana. 2014-10-09 09:04:24 -07:00
Pranav K 95852c38c4 Reacting to DI changes 2014-10-08 20:08:59 -07:00
Pranav K da102032b5 Reacting to Dependency Injection changes 2014-10-08 19:28:37 -07:00
Hao Kung dd58aeedb1 React to UsePerRequestServices rename 2014-10-08 15:51:35 -07:00
Praburaj ece6fc6c47 SignInAsAuthenticationType value changed with identity changes 2014-10-08 14:47:55 -07:00
Praburaj b2a20bf4f5 GetExternalAuthenticationTypes moved to SignInManager now
Fixing a sample break.
2014-10-08 14:26:03 -07:00
Chris Ross f5577c589e #130 - Remove semi-colon support from query parsing. 2014-10-08 14:25:59 -07:00
Hao Kung 95c7a659c2 React to identity/options/security changes 2014-10-08 14:02:04 -07:00
Hao Kung a4ce31c30d Rename Identity.SqlServer back to EntityFramework 2014-10-08 13:36:38 -07:00
Hao Kung ffa226dfa9 React to options / DI / startup changes 2014-10-08 13:11:49 -07:00
Hao Kung 3426034bcb Use DI activated options for auth middlewares
UseXXX() now use DI activated options
Use ExternalAuthenticationOptions instead of DefaultSignInAs
2014-10-08 13:02:08 -07:00
Hao Kung 6dfcfaa7eb React to options changes 2014-10-08 12:56:53 -07:00
Hao Kung 3e4a412b21 React to options change 2014-10-08 12:56:01 -07:00