Commit Graph

461 Commits

Author SHA1 Message Date
Pranav K c5b6efd6bf Move buffer types to ViewFeatures
Use buffer pooling in more places
2015-12-17 21:05:18 -08:00
N. Taylor Mullen 2b77744f96 React to aspnet/Razor#630.
- `TagHelperDescriptorFactory` is no longer static.
2015-12-17 12:13:52 -08:00
Pranav K a036ff4738 Reacting to DI changes 2015-12-17 12:03:29 -08:00
Doug Bunting 3d8225502f Change `HtmlString` to inherit from `HtmlEncodedString`
- part of aspnet/HtmlAbstractions#5 fix
- also extend existing special cases to more general `HtmlEncodedString`
2015-12-16 12:42:13 -08:00
Ajay Bhargav Baaskaran 232b27ad5d [Fixes #3430] Removed RouteKeyHandling.CatchAll 2015-12-16 11:57:22 -08:00
Doug Bunting 1b7e67211f Do not override default `Layout` value
- #3745
2015-12-14 19:09:57 -08:00
Sebastien Ros 774ee05508 Clean up ViewStartPages usage in RazorView
Fixes #3682
2015-12-09 10:55:59 -08:00
Pranav K 8c4b5c6c9a Fixing build break 2015-12-08 15:57:19 -08:00
Pranav K be46c7602e Add IAssemblyLoadContextAccessor to the service collection 2015-12-08 15:42:09 -08:00
Pranav K 218613bc0a Reacting to Diagnostics changes 2015-12-08 15:10:59 -08:00
David Fowler 99f501152b Remove dependency on ICompilationOptionsProvider
- Removed Configuration from RazorViewEngineOptions
- Added ParseOptions and CompilationOptions to RazorViewEngineOptions
2015-12-07 12:29:52 -08:00
Pranav K ff34c5404a Implement a backing-buffer for Razor using pooled memory
Fixes #3532
2015-12-03 17:42:20 -08:00
Doug Bunting 1f76b3c7b7 Clean up remaining `HtmlString` usage
- #3122 and #3123 (5 of 5)
- avoid concatenating values and wrapping them in an `HtmlString`
  - switch from `string.Format()` to `AppendHtml()` in `LinkTagHelper`
  - simplify `RazorPage` and `TagHelperContentExtensions` e.g. don't use a `TagHelperContentWrapperTextWriter`
  - add some special cases in `UrlResolutionTagHelper`
- add `TagBuilder` and `StringHtmlContent` special cases to avoid `StringWriter` use when value is an `HtmlString`
- move `HtmlTextWriter` optimizations a bit lower and add missing checks for that type

nits:
- correct comments that incorrectly mention `HtmlString`s
- update comments in `JavaScriptStringArrayEncoder`
2015-12-03 15:37:44 -08:00
Pavel Krymets 046dcefd14 Add extensibility point to Razor compilation 2015-12-03 12:04:07 -08:00
Ryan Nowak 9fc3a80056 Remove IActionContextAccessor from UrlHelper
This change removes the IActionContextAccessor as a dependency of
UrlHelper, and shifts UrlHelper to use a factory pattern. Consumers of
IUrlHelper should create an instance using the factory when needed.

This is the last part of MVC that has a dependency on IActionContext
accessor. As part of this change we no longer register it by default, and
treat it as an optional component.
2015-12-02 17:09:43 -08:00
Brennan 3062eea7d0 Dispose FileWatcher, MvcRazorHost, and ChunkTree 2015-12-02 13:07:45 -08:00
Pranav K 7e2eb16960 React to Microsoft.AspNet.Html namespace rename 2015-12-02 11:15:54 -08:00
Pranav K 70bdb6eb3e Removing CopyTo from RazorTextWriter 2015-12-01 12:37:11 -08:00
Pranav K ba1d064b99 Cleaning up RazorPage 2015-11-25 09:20:55 -08:00
Pranav K 79d517483b Removing PageInstrumentation
Fixes #3497
2015-11-25 08:41:21 -08:00
Pavel Krymets 5ef14e95b7 React to dnx confguration change 2015-11-24 11:54:10 -08:00
Pranav K b622a5b0d3 Bump Razor to dotnet5.5 2015-11-23 15:31:59 -08:00
Doug Bunting eb70b1c28c Remove `WebUtility` use and handle `IHtmlContent` return values from view components
- #3571 and part of #3123
- split `ContentViewComponentResult` in two
- add `HtmlEncoder` to `ViewComponentContext`
- remove use of `WebUtility.HtmlEncode()` and `HtmlDecode()`

nits: remove unused `using`s in files I had open
2015-11-23 11:12:44 -08:00
N. Taylor Mullen 2dc13b523d React to aspnet/Razor#358.
- Removed `WriteTagHelperAsync` methods from `RazorPage`.
- Moved `WriteTagHelperAsync` tests into Razor since `TagHelperOutput` is now an `IHtmlContent`.
- Updated code generation test files.

aspnet/Razor#358
2015-11-20 10:05:48 -08:00
Ryan Nowak d6bda0ec11 CompilerCache should not compile multiple assemblies for the same page.
Fixes #3469
2015-11-19 15:12:15 -08:00
Pranav K 155bde0fcf Pass in the area name instead of the view name to a parameter that
requires an area name.

Fixes #3556
2015-11-18 17:50:14 -08:00
Doug Bunting 95b3d2c1dd Address PR comments
- removed `isMainPage` parameter to `GetPage()` and `FindPage()`
2015-11-18 15:59:46 -08:00
Doug Bunting 3be6167aa0 Switch concepts from misnamed `isPartial` to `isMainPage`
- `true` has the opposite meaning now but most changes are due to new parameters names in `IViewEngine`
  - use name names in `Microsoft.AspNet.Mvc.ViewFound` and not found events
- remove `IRazorPage.IsPartial` and `RazorView.IsPartial`
  - remove `IsPartial` properties from `Microsoft.AspNet.Mvc.Razor.BeginInstrumentationContext` and end events
- add parameter checks to `RazorView` constructor; instances are not retrieved from DI

nits:
- remove unused `cacheKey` parameter from `RazorViewEngine.CreateCacheResult()`
- correct duplicate test names in `RazorPageTest`
  - also `...OnPageExecutionListenerContext` -> `...OnPageExecutionContext`
2015-11-18 15:59:37 -08:00
Doug Bunting cf30bb730f PR comments and some smallish cleanup
- `IRazorViewEngine.MakePathAbsolute()` -> `GetAbsolutePath()`
- set `IsPartial` on all `IRazorPage` instances
- improve consistency of methods in `HtmlHelperPartialExtensions`
  - a couple unnecessarily passed `htmlHelper.ViewData`
  - add missing tests of these extension methods
- restore parameter checks in `CompositeViewEngine`
- reduce `List<string>` and remove enumerator allocations in `CompositeViewEngine`

nits:
- correct a few comments
- use `<seealso/>`
2015-11-18 15:59:28 -08:00
Doug Bunting d1fe824b5d Improve `SearchLocations` handling
- do not blindly use `FindPage()` / `FindView()` result in `Exception.Message` or returned results
  - failure scenarios involve new `Any()` calls but rarely additional `List<string>()` allocations
- change `ViewEngine_ViewNotFound` resource to be consistent with similar errors
  - remove trailing period at end of searched locations list

nit: remove remaining `null` checks of `SearchedLocations` in not found cases; never `null` then
2015-11-18 15:59:20 -08:00
Doug Bunting 08dd77d8c7 Add relative view path support
- #3307
- relative paths are now supported in `View()` calls from components and view components,
  `Html.PartialAsync()` and similar calls, and `RazorPage.Layout` settings.
  - support absolute paths, relative paths, and view location lookups consistently / everywhere
  - support view paths in `TemplateRenderer` e.g. passing an absolute path to `Html.EditorFor()`
- take a big swing at the `IRazorViewEngine` and `IViewEngine` interfaces
  - split lookups (view names) from navigation (view paths)
  - remove `Partial` separation; use parameters to set `IsPartial` properties
- correct `ViewContext` copy constructor and add unit test
- extend unit tests to cover relative paths
  - fix existing tests to handle newly-required extension in an absolute path
- add functional test that chains relative paths

nits:
- remove some YOLO line wrapping
- `""` -> `string.Empty`
2015-11-18 15:59:11 -08:00
Pranav K 292207d17d Reacting to DependencyInjection changes 2015-11-13 10:47:34 -08:00
N. Taylor Mullen a1af85beb7 Remove System beta tag in project.json for coreclr packages. 2015-11-12 12:24:39 -08:00
Ryan Nowak 5810154826 Avoid creating intermediate strings with THCWTW
This textwriter needs to inherit HtmlTextWriter and the
StringCollectionTextWriter needs to have the right conditional test.

This allows us to 'pass-through' any IHtmlContent instances without
writing out intermediate strings.
2015-11-11 16:59:46 -08:00
Cesar Blum Silveira 4a68550e50 Merge branch 'release' into dev 2015-11-11 10:59:32 -08:00
Pranav K 380a93d370 Redesign RazorViewEngine caching
Fixes #3337
2015-11-10 10:18:25 -08:00
Pranav K d17db92e19 Log messages to DiagnosticListener in addition to page instrumentation
Fixes #3281
2015-11-09 10:24:49 -08:00
Pavel Krymets 737a8f3b1d Make Compilation Abstractions naming consistent with Platform Abstractions 2015-11-06 15:53:08 -08:00
Cesar Blum Silveira 9dba871108 Strong name everything. 2015-11-03 21:16:49 -08:00
Pavel Krymets b4b29e71d6 Rename Microsoft.Dnx.Compilation.Abstractions to Microsoft.Extensions.Compilation.Abstractions 2015-11-03 12:42:28 -08:00
Chris R 52f4a83139 React to WebEncoders changes. 2015-10-30 17:59:19 -07:00
Pavel Krymets f1412c21ac Fix the build 2015-10-26 16:47:11 -07:00
Pavel Krymets 4e8c543489 Rename Microsoft.Runtime.Abstractions to Microsoft.Extensions.PlatformAbstractions 2015-10-22 19:48:55 -07:00
Doug Bunting c267ef3904 Rename `AppendEncoded()` to `AppendHtml()` and `SetContentEncoded()` to `SetHtmlContent()`
- #3225, 3 of 3
2015-10-22 16:57:47 -07:00
N. Taylor Mullen faa78a3d91 Transition from `IAssemblyLoadContext` to `AssemblyLoadContext`.
- `IAssemblyLoadContext` is a DNX defined type that will eventually go away.

#3365
2015-10-22 16:15:10 -07:00
N. Taylor Mullen 9b9d72f3f7 Remove unneeded namespaces.
aspnet/Razor#578
2015-10-22 15:34:40 -07:00
N. Taylor Mullen 0e25470660 React to aspnet/Razor#578. 2015-10-22 14:41:40 -07:00
N. Taylor Mullen 8623946784 Add compilation services when adding Razor.
#3383
2015-10-22 11:49:02 -07:00
Pranav K 91aeec95e9 Switching to generations TFMs 2015-10-22 01:20:00 -07:00
Eilon Lipton 55b72c04bf Add high-pri doc comments for views, controllers, HTML helpers, Startup 2015-10-20 18:24:56 -07:00