Commit Graph

53 Commits

Author SHA1 Message Date
Nate McMaster 279855d947
Downgrade to stable packages 2017-02-14 16:15:35 -08:00
Ryan Nowak e549270b4a Add RazorDiagnostic type
This is a replacement for RazorError, is conceptually equivalent with
Diagnostic from Roslyn.

The next PR will start exposing this through our public API rather than
the legacy type.
2017-01-31 15:53:22 -08:00
Nate McMaster 79663ef90e Upgrade to RC.3 2017-01-20 09:01:49 -08:00
Nate McMaster 91bc4b3940 Remove redundant references 2017-01-05 18:12:53 -08:00
Pranav K 7657ea41a3 Updating to 4.4 CoreFx packages 2016-12-21 22:43:57 -08:00
Nate McMaster 705a490acb Upgrade to VS 2017 2016-12-16 16:04:22 -08:00
Pranav K c746fd81df Updating versions to 1.2.0-* 2016-11-09 14:19:11 -08:00
jacalvar b9e58a4fe6 Created public API baselines 2016-11-08 11:05:35 -08:00
Pranav K 039e1021a4 Updating partner package versions 2016-09-28 11:51:56 -07:00
Pavel Krymets bdbb854bdb Use TaskCache class from Microsoft.Extensions.TaskCache.Sources (#829)
Instead of Task.FromResult(0)
2016-09-07 14:53:06 -07:00
Pranav K 5944dd6f87 Small perf fixes to improve precompilation times 2016-09-01 09:44:30 -07:00
Crystal Qian d19845730f Added a copy constructor for tag helper descriptors. (#827) 2016-08-31 15:38:35 -07:00
Crystal Qian 489c0d9046 Added view component tag helper updates. (#823)
Added view component tag helper updates.

aspnet/mvc#1051
2016-08-24 16:01:59 -07:00
Doug Bunting 05a52f445f One build to rule them all
- well, at least VS and command-line builds will share output
- part of aspnet/Coherence-Signed#277
2016-07-07 12:26:20 -07:00
Pranav K eb2b58188a Updating to dev versions
# Conflicts:
#	test/Microsoft.AspNetCore.Razor.Test/project.json
2016-06-16 10:41:31 -07:00
N. Taylor Mullen ccba161447 Move `FileSystem` dependency from Razor to Razor.Runtime. 2016-06-09 15:58:55 -07:00
mnltejaswini 3b9539960b [Perf] Preallocate TagHelperAttributes for simple bound string valued attributes Fixes #704 2016-06-01 11:24:32 -07:00
Doug Bunting 44f0aa63c6 Do not HTML encode while checking for whitespace
- #760
- using a `NullHtmlEncoder` improves `TagHelperContent.IsEmptyOrWhiteSpace` semantics
 - e.g. a tab is still a tab after encoding
 - also avoids `NotImplementedException`
- implement `Write(char)` for char-by-char `IHtmlContent` corner case
2016-05-31 22:09:19 -07:00
N. Taylor Mullen e14f4b095d Track `TagHelperAttribute` quotes.
- Removed `Minimized` from `TagHelperAttribute` and replaced it with `HtmlAttributeValueStyle`.
- Removed `AddMinimizedTagHelperAttribute` method from `TagHelperExecutionContext` since we always provide a `HtmlAttributeValueStyle` now.
- Stopped manually escaping double quotes because we now know how an attribute was originally written.
- Updated tests to account for new attribute format (from kvp).

#705
2016-05-27 12:28:33 -07:00
John Luo ccd0d52d8e React to updated CoreCLR packages
https://github.com/aspnet/Coherence/issues/97
2016-05-26 18:32:23 -07:00
Ben Adams cacd16fa85 Remove pragma warning disable 1998
Function doesn't need async
2016-05-20 15:03:38 -07:00
Pranav K 852642de84 Revert "React to updated CoreCLR packages."
This reverts commit 46f7a8575e.
2016-05-18 09:37:25 -07:00
N. Taylor Mullen d27ab1ce3d React to `HtmlEncodedString` rename to `HtmlString`.
- Updated test output to reflect new `HtmlString` naming.

aspnet/HtmlAbstractions.25
2016-05-17 12:13:26 -07:00
N. Taylor Mullen 46f7a8575e React to updated CoreCLR packages.
https://github.com/aspnet/Coherence/issues/97
2016-05-17 12:11:54 -07:00
Pranav K 2c4b0e8a7f Fix build warnings 2016-05-02 14:39:19 -07:00
Pranav K eeed1036e3 Stop compiling for dnx451
Fixes #734
2016-04-15 13:12:14 -07:00
Pranav K 78c742c6ee Removing imports from src projects 2016-04-08 06:48:49 -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
jacalvar abaf3bba50 Make dependencies injectable in TagHelperDescriptorResolver.
* Added an interface for ITagHelperTypeResolver and made TagHelperTypeResolver implement it.
* Added an interface for ITagHelperTypeDescriptorFactory and made TagHelperDescriptorFactory implement it.
* Added a constructor on TagHelperDescriptorResolver that takes in an ITagHelperTypeResolver and ITagHelperDescriptorFactory.
2016-04-01 11:25:47 -07:00
N. Taylor Mullen f5c79b62de Prevent method => delegate conversion happening multiple times.
- The conversion now only occurs on the construction of the `TagHelperScopeManager` which only occurs once.
- Updated tests.

#720
2016-03-29 10:18:10 -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
Pranav K 1e3d675993 Reacting to CoreCLR package changes 2016-03-22 15:09:58 -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
Eilon Lipton 0f6fb8277c Fix package metadata 2016-03-15 15:48:34 -07:00
Pranav K 0858d430ea Fix CI build break + add dnx451 2016-03-11 15:51:45 -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
Ajay Bhargav Baaskaran 5b7dc0d1bc Added Company, Copyright and Product attributes to AssemblyInfo 2016-03-03 17:32:27 -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
N. Taylor Mullen 9f675abbca Pre-allocate unbound `TagHelper` attributes.
- Hoist `TagHelperAttribute` creation into `private static readonly` fields to avoid allocations on every request. With the recent `TagHelperAttribute` change that made them immutable we can now pre-allocate them without worry of them being modified.
- Added two extra class configuration pieces to enable pre-allocation.
- Updated test files to showcase new pre-allocations.

#600
2016-03-01 11:23:49 -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
Ajay Bhargav Baaskaran 54fea50483 Enabled xml doc generation 2016-02-17 10:21:17 -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
Pranav K 5e72b580d9 Reacting to CoreCLR package version changes 2016-02-08 09:33:48 -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 f78c52a216 Expose `IsTagHelper` as an extensibility point.
- This is required for the Razor tooling that determines `TagHelperDescriptor`s.

https://github.com/aspnet/RazorTooling/issues/43
2016-01-28 11:41: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