Commit Graph

30 Commits

Author SHA1 Message Date
Pranav K 2c4b0e8a7f Fix build warnings 2016-05-02 14:39:19 -07:00
Pranav K 1101ff55ae Use latest build of dotnet-test-xunit 2016-04-19 14:54:09 -07:00
Pavel Krymets 603d181241 Bring Microsoft.NETCore.Platforms dependency back 2016-04-18 16:56:44 -07:00
Pavel Krymets dfe83b6bac Migrate tests, tools and samples to portable 2016-04-14 15:07:34 -07:00
N. Taylor Mullen c400289de5 Change `DefaultTagHelperContent` to be smart about single content entries.
- Today `TagHelperContent`s always allocate their underlying buffer even though they typically only ever have a single entry. Added a field to enable us to only allocate the backing buffer when we absolutely need to.
- Removed `IsEmpty` from `TagHelperContent` since it was not used in any of our `TagHelper`s for simplification. Changed `IsWhiteSpace` naming to be `IsEmptyOrWhiteSpace` since it can be used to indicate either state.
- Updated tests.

#621
2016-04-05 16:09:06 -07:00
N. Taylor Mullen 4212b7e713 Add `SetOutputContentAsync` to `TagHelperExecutionContext` to prevent allocation of `Task<T>`.
- Previously we'd do `executionContext.Output.Content = await executionContext.Output.GetChildContentAsync()`. The problem with this approach is that it returned a `Task<TagHelperContent>` which could not be optimized when building in release.
- Added test to validate `SetOutputContentAsync` does the appropriate thing.

#721
2016-04-02 22:58:37 -07:00
N. Taylor Mullen 714dd5fa9e Update test files to react to new `TagHelperScopeManager` contract.
#720
2016-03-29 22:05:37 -07:00
N. Taylor Mullen 3c73ae9cfe Change `TagHelperOutput` and `TagHelperContext` lifetimes.
- `TagHelperOutput` and `TagHelperContext` lifetimes now mach `TagHelperExecutionContext`s. This means once a set of `TagHelper`s have run on a tag the `TagHelperOutput`/`TagHelperContext` will be re-used.
- Added tests to validate the various `Reset`/`Reinitialize` methods behaved correctly.
- Updated codegen to no longer set `TagHelperExecutionContext.Output`.

#719
2016-03-28 11:54:48 -07:00
ryanbrandenburg 21be7973ea SetContent to SetHtmlContent 2016-03-25 12:05:43 -07:00
David Fowler f5fbae6776 Fixed build 2016-03-25 02:36:27 -07:00
N. Taylor Mullen 3d0bf621f3 Update `TagHelperDesignTimeDescriptorFactory` to work in CoreCLR.
- After discussion offline to maintain consistency we decided to also remove `CodeBase` fallback in the net451 scenario. This will keep CoreCLR and net451 scenarios more consistent.
- Removed `CodeBase` validation tests.
- Added `GetAssemblyLocation` extensibility point to enable proper testing of the `TagHelperDesignTimeDescriptorFactory`.

#709
2016-03-21 16:17:37 -07:00
Victor Hurdugaci 37dde59569 Fix the test projects that can't build without src because the framework assemblies are not transitively referenced when referencing packages 2016-03-17 09:15:15 -07:00
John Luo a6dab00f37 Reacting to KoreBuild changes 2016-03-08 15:03:57 -08:00
N. Taylor Mullen e5927ddd01 Add CSS attribute selectors for `TagHelper` attributes.
- Added the ability for users to opt into CSS `TagHelper` selectors in their required attributes by surrounding the value with `[` and `]`. Added operators `^`, `$` and `=`.
- Added tests to cover code paths used when determining CSS selectors.

#684
2016-03-08 12:15:06 -08:00
Ryan Nowak 9bd06a5dfc React to changes in HTML abstractions
This change implements the new API for flattening content in Razor.

Also, some optimizations to avoid allocations on paths where we need
to encode HTML attribute values.
2016-03-04 07:56:53 -08:00
Doug Bunting 38183b5887 Remove project name from output path
- aspnet/Coherence-Signed#187
- remove `<RootNamespace>` settings but maintain other unique aspects e.g. `<DnxInvisibleContent ... />`
- in a few cases, standardize on VS version `14.0` and not something more specific
2016-03-02 20:58:45 -08:00
N. Taylor Mullen b00c1c1dc7 Transition to netstandard.
- dotnet5.X => netstandard1.y (where y = x-1).
- DNXCore50 => netstandardapp1.5.
- Applied the same changes to ifdefs.
2016-03-01 13:32:43 -08:00
John Luo 5ca09d0b10 Updating test TFMs for custom test discovery 2016-02-19 11:46:09 -08:00
N. Taylor Mullen 78451efa7f Pool `TagHelperExecutionContext`s within `TagHelperScopeManager`.
- Currently the `TagHelperScopeManager` creates a new `TagHelperExecutionContext` per `TagHelper` on a given page. With this change the max number of `TagHelperExecutionContext`s per page is the number of nested levels that exist.
- Added two tests validating that specific pieces of `TagHelperExecutionContext` are updated as expected.

#674
2016-02-19 10:37:01 -08:00
Caleb Nelton b03d3aa56f Code Cleanup
Use var
Conditional can be simplified
Redundant array creation expression
Parameter name differs in base declaration
Empty statement is redundant
2016-02-18 12:04:32 -08:00
N. Taylor Mullen b7b3273fa4 Lazily initialize `TagHelperAttributeList`s.
- Not all `TagHelper`s have unbound HTML attributes or any attributes at all. A great example of this is MVC's input `TagHelper` which usually takes the format of `<input asp-for="..." />`. By lazily initializing we don't build extra attribute lists where not needed.
- Moved `TagHelperContext` and `TagHelperOutput` creation to CreateX methods on `TagHelperExecutionContext`.

#604
2016-02-10 11:15:54 -08:00
Kiran Challa 84ac19571c Enable tests to run using dotnet xunit runner 2016-02-10 00:20:35 -08:00
N. Taylor Mullen fc99082ea8 Make `TagHelperAttribute` immutable.
- Remove a lot of the ugly generic work done in `TagHelperAttributeList`/`ReadOnlyTagHelperAttributeList`.
- Removed error cases where we'd check on addition of `TagHelperAttribute`s that their `name` was not `null`. This was due to the pre-existing `string` indexer for `TagHelperAttributeList`. It no longer sets `TagHelperAttribute`s directly, instead it's `[key] = value` (instead of `[key] = new TagHelperAttribute(...))`.
- Updated tests to account for new immutability/string indexer format.
- Removed copy ctor from `TagHelperAttribute` since its immutability kills the value.
- Changed `ReadOnlyTagHelperAttributeList` to inherit from `ReadOnlyCollection`

#604
2016-02-04 16:38:30 -08:00
N. Taylor Mullen 4418a5527d Up imports to net451. 2016-02-01 15:50:28 -08:00
N. Taylor Mullen ffa63cb71f Fix test projects. 2016-02-01 15:41:02 -08:00
N. Taylor Mullen 662e6e6dbe Fix build break 2016-01-28 13:50:21 -08:00
Ryan Nowak 18909506e1 Flatten TagHelperOutput when writing
This change 'flattens' a TagHelperOutput when writing it out to an
HtmlTextWriter. This is a beneficial perf change because more often than
not the thing being written to is a ViewBuffer in Razor, which uses pooled
memory. This allows us to 'join' islands of pooled ViewBuffer memory back
into the main buffer instead of keeping them wrapped up in a
TagHelperOutput or TagHelperContent.
2016-01-25 17:32:18 -08:00
N. Taylor Mullen 173886bf6c Update ASP.NET 5 versions for ASP.NET Core.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:28:16 -08:00
N. Taylor Mullen 3968eded19 Rename AspNet 5 file contents.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:21:25 -08:00
N. Taylor Mullen 3542ec3167 Rename AspNet 5 folders and files.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:21:05 -08:00