Commit Graph

553 Commits

Author SHA1 Message Date
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 2ab54e73c5 Fix build dependencies. 2016-02-17 16:18:08 -08:00
Ajay Bhargav Baaskaran 54fea50483 Enabled xml doc generation 2016-02-17 10:21:17 -08:00
hexelium a0164b005d (#346) Fixed case when razor fails to recognize escape shortcut when the first character in a text is `:`. For example @::sometext. 2016-02-15 20:51:43 +02:00
N. Taylor Mullen 6bad1bba5b Enable Razor templates inside of sections.
- Changed the variable used to render templates (`HelperResult`s) so they can be used inside of sections.
- Updated section test file to showcase nested scenario. Also Regenerated existing test files.

#572
2016-02-11 12:01:34 -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
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
Ajay Bhargav Baaskaran 49c553ec7b Updated Json.Net version 2016-02-04 16:13:22 -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 c01d90900e Don't transitively depend on `Newtonsoft.Json`. 2016-01-29 10:23:15 -08:00
N. Taylor Mullen 662e6e6dbe Fix build break 2016-01-28 13:50:21 -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
N. Taylor Mullen 2e7e1f9c85 Fix design time line mapping test. 2016-01-25 17:30:21 -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
Doug Bunting 37850b5d85 Add `TagHelperOutput.GetChildContentAsync()` overloads including an `HtmlEncoder`
- #643 part 1
- change is viral and requires an update to `RazorPage.StartTagHelperWritingScope()`
  - memoize `GetChildContentAsync()` per-encoder
  - update generation tests to match and to test new behaviour
- note `HtmlEncoder`s used elsewhere e.g. in other `RazorPage` instances are unaffected

Add `NullHtmlEncoder`

Nits:
- generally clean up affected doc comments and make them more consistent
- remove unused `using`s in files I had open
2016-01-17 22:34:19 -08:00
Ryan Nowak e68c55ab41 Rewrite of tokenizers 2016-01-15 15:58:27 -08:00
N. Taylor Mullen 1ce9180a3e Prevent unneeded allocations of `Block` children enumerators.
#635
2016-01-15 15:47:35 -08:00
Ryan Nowak 315d79ff2b Make the CodeWriter more efficient 2016-01-15 11:04:32 -08:00
Ryan Nowak 08fef95969 Remove a String.Split 2016-01-15 10:38:08 -08:00
Ryan Nowak 95ea4cc06f Optimize allocations of List<ISymbol> and related 2016-01-14 17:19:25 -08:00
Ryan Nowak ffdf5d2827 Remove allocations from lookahead
This makes lookahead allocation-free, saving about 15MB in our current
benchmark.
2016-01-14 17:19:13 -08:00
N. Taylor Mullen 7a0a9c6caa Remove boxing of symbol types.
- The Equals operators were boxing the symbol types like crazy, added an abstract `SymbolTypeEquals` to avoid this.

#635
2016-01-14 17:18:07 -08:00
Nate McMaster b760156e66 Updating build script 2016-01-14 16:41:14 -08:00
Ryan Nowak 6a4a9544a1 Eliminate extra List<RazorError> copies
Changing to IReadOnlyList since we always want to support indexing.
Replacing ToArray() with non-linq when needed, and with a static
EmptyArray when not needed.

Eliminates 50mb of list copies.
2016-01-14 14:54:47 -08:00
Pranav K 9c6e5f714a Updating to use Dotnet-Cli build 2016-01-12 14:53:10 -08:00
Pranav K 1da673e0e2 Updating NuGetPackageVerifier.json 2016-01-12 11:03:59 -08:00
Pranav K b4d631e2f6 Removing ITypeInfo and related types 2016-01-11 17:45:18 -08:00
Pranav K c05551e167 Removing Microsoft.AspNet.Razor.Runtime.Precompilation 2016-01-11 16:33:22 -08:00
N. Taylor Mullen 605dceea02 Change string rendering to be chunked.
- Roslyn currently has an issue where too large of strings result in out of memory exceptions at compile time. To combat this I broke down literal strings into 1024 length pieces each resulting in their own `WriteLiteral`/`WriteLiteralTo` calls. The 1024 number corresponds directly with MVCs response string buffer.
- Added tests to validate large string rendering.

#614
2016-01-06 16:21:32 -08:00
N. Taylor Mullen 33d32cecd9 Remove unused parameter from `TagHelperDesignTimeDescriptorFactory`.
#629
2016-01-05 12:05:41 -08:00
Doug Bunting fe5e1b8c71 Make Razor codegen use invariant culture
- #557
- use `int.ToString(CultureInfo.InvariantCulture)` consistently in `CSharpCodeWriter` / `CSharpCodeVisitor`
- correct `string` operations to use explicit `StringComparison.Ordinal`
- improve `RazorEditorParser` doc comments

nits:
- remove one-off use of `CurrentUICulture` in `LineMapping` debug code (`ToString()` implementation)
- clean a bit of #YOLO wrapping and long lines
2016-01-05 11:52:02 -08:00
Pranav K 37eca627dd Rename TagHelperContent.Append(IHtmlContent` overload to be `TagHelperContent.AppendHtml(IHtmlContent)`
Fixes #634
2015-12-31 11:26:21 -08:00
Pranav K e1aa888165 Allow optional quotes around tag helper directives
Fixes #636
2015-12-29 12:32:23 -08:00
Pranav K 77b74b0c96 Modify TryGetAttributes to return a IReadOnlyList 2015-12-28 13:12:39 -08:00
N. Taylor Mullen dbe4ce06f2 Cache XML file information when creating design time based `TagHelperDescriptor`s.
- Prior to this change we'd hit the disk every time we'd create a `TagHelperDesignTimeDescriptor` to locate an assemblies XML files.
- Did not want to tie the XML cache to a static member in-case a user updates their XML information between parses. Therefore, changed `TagHelperDescriptorFactory` and `TagHelperDesignTimeDescriptorFactory` to no longer be static.
- Put the same `TagHeleprDescriptorFactory` extensibility point as we had for its counterpart `TagHelperTypeResolver` to stay consistent. This involved making `CreateDescriptors` virtual and allowing it to be provided in the `TagHelperDescriptorResolver` constructor.

#630
2015-12-17 11:12:19 -08:00
N. Taylor Mullen 392871beb6 Change missing section end brace error to work at EOF.
- Updated existing tests and added a new case to understand `@section {....` scenarios.
- Instead of trying to guess 1 character prior to EOF decided to log error on opening brace since we know its position. Updated error to account for change in location.

#625
2015-12-11 15:10:53 -08:00
Pranav K 5fecd5bd1e Merge branch 'release' into dev 2015-12-11 12:22:59 -08:00
Pranav K 51920a0af2 Updating to release NuGet.config. 2015-12-11 12:22:57 -08:00
Doug Bunting b95cf5fb7c Add dependency to fix build break
- Common sources needs more
2015-12-11 08:46:44 -08:00
Pranav K c7a6c099ed Removing more unused usings 2015-12-08 09:54:32 -08:00
Pranav K 1e997fec7e * Cleaning up usage of CodeAnalysis.
* Fixing System.Reflection version.
2015-12-07 19:50:10 -08:00
Pranav K 66c9a21848 Reacting to Microsoft.AspNet.Html namespace renames 2015-12-02 10:17:04 -08:00
Pranav K 65e63c893b Enable CoreCLR tests on Travis 2015-12-01 10:34:49 -08:00
Pranav K 2a301691db Updating tests to use moq.netcore 2015-11-23 12:15:26 -08:00