- Today MVC has specific rules about resolving Razor attribute values. Ex: `true` => attribute name being used as attribute value. This change ensures that unbound complex `TagHelper` attribute use that same logic.
- Added configuration to `GeneratedTagHelperContext` for `AddHtmlAttributeValues`.
- Had to be careful with code generating `AddHtmlAttributeValues`. In the case of `data-`; they can appear as complex attributes but may not contain any pieces that are `DynamicAttributeBlockChunk`s. Had to protect against this scenario.
- Updated existing test files.
- Added a new code gen test case to showcase the various use-cases of unbound dynamic `TagHelper` attributes.
#247
- Removed parsing, chunk generation and code generation.
- Removed related tests.
- Did not modify existing unrelated tests with ~/ since it's just plain text and may be valid for end-users.
#427
- Added a boolean overload that specifies whether the user wants to retrieve cached content.
- Added tests to validate `TagHelperExecutionContext` `GetChildContentAsync` and that `TagHelperContext` passes the appropriate values through.
#459
- Updated `LocationTagged<TValue>` to handle `null` implicit values.
- Removed `InternalsVisibleTo` declaration on `Microsoft.AspNet.Razor` to the runtime test project.
- Updated `TagHelperDescriptor` tests to utilize helper methods to construct `TagHelperDescriptor`s. This was needed since the `InternalsVisibleTo` declaration was removed.
#449
- Prior to this change we'd return early and not generate any found descriptors if ANY property on a `TagHelper` had editor browsable never.
- This issue was hidden from tests due to us using the wrong comparer. Updated the comparer and failures occurred without the `TagHelperDescriptorFactory` change (yay).
#454
- Changed `TagHelperDescriptorFactory` to not create individual descriptors when `EditorBrowsableAttribute` is present and set to `EditorBrowsableState.Never`.
- Added tests to validate the `TagHelperDescriptorFactory` creates the attribute correctly.
- Did not look down the inheritance chain for `EditorBrowsableAttribute` because `TargetElement` is not inherited.
#447
- #399
- move invalid `HtmlAttributeNameAttribute.Name` checking to `TagHelperDescriptorFactory`
- add a few new error cases
- but does not cover all the new error cases e.g. `[HtmlAttributeName(...)]` on a get-only `int` property
nit:
- `resx` target removed some older resources from `RazorResources.Designer.cs`
- Decided to not have the attribute inheritable since TargetElement is not inheritable.
- Added tests to validate serialization, deserialization and construction of TagHelperDescriptors with OutputElementHints.
- Changed TagHelperUsageDescriptor to TagHelperDesignTimeDescriptor and TagHelperAttributeDesignTImeDescriptor.
#382
- Could not add tests to validate the full TagHelperDescriptorFactory.CreateDescriptors => TagHelperUsageDescriptors due to how the runtime loads assemblies (does it in memory without XML).
- Added serialization tests to include TagHelperUsageDescriptors.
- Updated existing tests to use new TagHelperDescriptor/TagHelperAttributeDescriptor constructors.
#352
- Duplicate TagHelper bound attributes used to be ignored entirely; they now flow to the output as if they were unbound.
- Added code generation test to verify duplicate attributes. Added runtime and design time versions.
- Updated existing tests that happened to have duplicate bound attributes.
#418
- TagHelper attributes that have expressions intermingled within them (resulting in Block elements) resulted in Spans in the attribute being falsely marked as SpanKind.Markup.
- Updated tests to account for new SpanKind.Code behavior.
- Added complex scenario to validate SpanKind.Code is flowed through to surround attributes.
#387
- Removed old code that disabled instrumentation for TagHelper bodies. Instrumentation will throw out sections for begin/end context that don't make it to the final output.
- Added instrumentation around WriteTagHelperAsync. Any content inside of the TagHelper will get sub-mapped via begin/end context.
- Hand verified BasicTagHelpers.cs begin/end context tests to ensure correctness.
#172
- Added new handling of the C# try catch statement to allow exception filters after catch statements.
- Added tests to validate valid and invalid scenarios.
#402
- Split the tests into their corresponding impact areas. We were testing a lot of bits that were not specific to the TagHelperParseTreeRewriter in its corresponding tests.
#370
- This was accomplished by changing when/how TagHelper attributes are rendered. Previously they were rendered: Bound => Unbound. Now they're rendered in the order that they exist on the TagHelperChunk.
- Regenerated test files to account for new re-ordering of TagHelper attributes.
- Added duplicate, unbound HTML attribute, unminimized same name test to ComplexTagHelpers.
- Did not add additional tests (other than the one noted above) since the current tests seem to be heavily impacted by the re-organization of code rendering; effectively showcasing the fix.
#225
- ignore missing expected output resources in this mode
- update `BaselineWriter` to avoid `IOException`s (file access issues)
- serialize file operations
- one file handle per file
- repeatedly `rm TestFiles/CodeGenerator/Output/*; `dnx . test`; no errors
also
- add generation of design-time line mappings
- fix ChunkGenerator -> CodeGenerator typo in path names
- update files only if they have changed
- new `TestFiles.Exists()` method to support this check
- do not check results in `CSharpCodeBuilderTests` if `GENERATE_BASELINES` set
nits:
- update BOM in CodeBlockWithTextElement.cs to avoid future `git diff`s
- use more `var` and improve variable names in `TestFile`
- wrap long lines
- Requesting a '*' tagName from the TagHelperDescriptorProvider could only happen if a user was directly calling into it (extremely unlikely). Therefore I've removed the special casing to make the logic more simple.
- Removed tests that expected this behavior.
#324
- Now that what used to be CodeGenerators are now ChunkGenerators we can rename the CodeBuilder into its correct structure: a CodeGenerator.
- Moved the TagHelperAttributeValueCodeRenderer from the TagHelpers namespace into the CodeGeneration namespace.
- Went through several classes and remove and sorted usings.
- Updated test files to abide by the new naming convention of Builders => CodeGenerators.
#140
- Renamed CodeGenerators to ChunkGenerators.
- Updated location of TestFiles from TestFiles/CodeGenerator/CS/{Output|Source} => TestFiles/CodeGenerator/{Output|Source}.
- Removed ChunkTree test; it was a legacy test used to experiment with Razor rendering (not a real test).
- Removed CSharpRazorCodeGenerator; it's now replaced with RazorCodeGenerator. It was an empty class that did nothing.
- Updated ChunkBlock => ParentChunk. Also updated several patterns throughout the code base that referenced these blocks as blocks and not parents.
- Moved Chunks and ChunkGenerators into the Chunks/Chunks.Generators namespace/folder structure. Updated test project to reflect the same.
- Moved CodeBuilders and CodeVisitors to the CodeGeneration/CodeGeneration.Visitors namespace/folder structure. Updated test project to reflect the same.
- Moved several TagHelper assets outside of their own namespaces and into Razors more general structures; such as CodeGeneration and Chunks/Chunks.Generators.
#140
- [TargetElement(Attributes ="prefix-*")] is now supported.
- Added '*' to the list of invalid non whitespace characters in TagHelperDescriptorFactory.
- Modified TagHelperDescriptorProvider to respect suffixed wildcards in TagHelperAttributeDescriptor.Attributes.
- Added tests to validate wildcard required attributes
#361
- #89 remainder
- support adding attributes (that aren't otherwise bound) to a tag helper dictionary
- use two `TagHelperAttributeDescriptor`s for dictionary and indexer
- most exising descriptor properties have two meanings depending on new `IsIndexer`
- add `TagHelperAttributeDescriptor.IsNameMatch()`
- create no `TagHelperAttributeDescriptor`s if property name or `HtmlAttributeNameAttribute`
is invalid
- avoid corner case misfeatures where invalidity removes just one descriptor
- extend handling of invalid attribute names to include `[HtmlAttributeName]`
- handle prefix matches in `TagHelperBlockRewriter`
- add parse error when resolved dictionary key is `string.Empty`
- generate code for indexer property assignments
- add code generation for runtime error if using indexer when property is `null`
- use new `GeneratedTagHelperContext.FormatInvalidIndexerAssignmentMethodName` for message
- code generation now handles attributes in source order; thus above errors occur only when
expected if dictionary is also initialized in the Razor source
- surprisingly generation order change did not break existing tests!
nits:
- improve `TagHelperDescriptorFactory_InvalidBoundAttributeName` wording
- rename resource to `TagHelperDescriptorFactory_InvalidAttributeNameOrPrefixStart`
- correct order of arguments to `FormatTagHelperDescriptorFactory_InvalidBoundAttributeName`
- correct `TagHelperBlockRewriter_TagHelperAttributeListMustBeWellFormed` resource
- correct `TagHelperDescriptorFactoryTest` test names
- remove a few unnecessary `ToArray()` calls
- update `TagHelperAttributeDescriptorComparer` comments
- Added special cases to the using statement parser to understand `@using static Foo`.
- Added several unit tests to validate the static using structure.
- Modified existing import code generation tests to validate several static usings.
#44
- Added case in ImplicitExpression handling to understand question marks.
- text?. is special compared to text. because with text. we currently validate content after text. to determine if it's an expression or if it's a period. Now with ?. we always treat it as an expression because ?. is not a useful sentance of any kind.
- Added unit tests to validate new implicit expression handling
- Added runtime and design time code generation tests to validate null conditional operators.
#44
- Involved updating the HtmlMarkupParser to properly separate data- attributes. Prior to this change `data-foo="abc @DateTime.Now def"` would involve 1 Span for `data-foo="abc` 1 Span for `@DateTime.Now` and 1 Span for `def"`. This was very unique behavior from an attribute standpoint (as far as Razor is concerned) and made it difficult for the TagHelper rewriting system to rewrite attributes. With this change it gets broken out as follows: `|data-foo="|abc| @DateTime.Now| def|"|`.
- Added unit tests to validate the various ways you can write unbound data- attributes.
- Updated the BasicTagHelpers codegeneration test to intermix some unbound data- attributes.
#342
- relates to #89 because that changes `string` property checks and needs this refactor
- determine `string`-ness when creating `TagHelperAttributeDescriptor`s
- add `TagHelperAttributeDescriptor.IsStringProperty` (set in constructor)
- avoid repeated `string` comparisons and be more explicit
- change `TagHelperBlockRewriter` to centralize more of the `string`-ness determination
- also add `TryParseResult` DTO, avoiding multiple `out` parameters
- refactor `CSharpTagHelperCodeRenderer` to allow reuse of core attribute value rendering
- test all of it
- add `TagHelperDescriptorTest` to confirm serialization / deserialization
minor:
- fix `TagHelperBlockRewriter.TryParseBlock()` end quote removal when tag is malformed
nits:
- remove dangling mention of fixed bug #220
- make recently-added `TagHelperBlockRewriterTest` tests realistic
- multiple `TagHelperDescriptor`s for same tag helper have identical `Attributes`
- Added parse level rewriting tests to validate new TagHelper rewritten structures for minimized attributes.
- Updated existing parser tests to understand minimized attributes.
- Added codegen test to validate understanding of minimized attributes.
- Added TagHelperExecutionContext tests to validate maintaining of runtime TagHelperOutput tests.
- Refactored part of the TagHelperParseTreeRewriterTest file into a base class file so we can make better rewriting tests.
#220
- tests failing
- root cause is likely similar to reason MVC Core has same dependency
- something must have changed in the framework packages without manifest fixes