Commit Graph

43 Commits

Author SHA1 Message Date
Ryan Nowak 2992f8e38a Separate PageContext and ViewContext
This change decouples PageContext and ViewContext completely.
2017-05-24 16:01:52 -07:00
Jass Bagga 51c142ae91 Modify GetProperties overload (#6276)
Addresses https://github.com/aspnet/Common/issues/219
2017-05-16 13:34:14 -07:00
Ryan Brandenburg 59a3aade9b Fix [TempData] for PageModel's 2017-04-11 16:45:44 -07:00
Ryan Brandenburg 9e8d4db7d8 Move TempDataPropertyProvider into filter 2017-04-05 12:04:02 -07:00
Doug Bunting 2cabd589ac Add more `ExpressionHelper` tests
- #5792
2017-03-31 15:22:29 -07:00
Jass Bagga 1197657e5b TempData property attribute
Addresses #5600
2017-03-16 16:34:35 -07:00
Ajay Bhargav Baaskaran 2ffaa88830 Using NullLogger types from Logging.Abstractions 2017-03-14 12:24:18 -07:00
Doug Bunting a5c7a7e491 Bring tests from fa710e6 (rel/1.0.3) into dev
- relates to #5595 which was a 1.0.x-only problem
2017-02-11 13:48:21 -08:00
Doug Bunting fc40985412 Merge branch 'rel/1.1.2' into dev 2017-02-10 14:55:32 -08:00
Doug Bunting 8ee3d45ef1 Do not cache expressions containing method calls
- #5655
- also make `ExpressionTextCache` more robust for defence-in-depth

nits:
- two `null` expression nodes are equal
- declare data properties as `TheoryData<T>`
2017-02-10 14:50:09 -08:00
Ryan Brandenburg dc0be8d747 SaveTempDataFilter handle write to body
(cherry picked from commit 03cdd15e5c)
2017-02-03 10:41:36 -08:00
Ryan Brandenburg 03cdd15e5c SaveTempDataFilter handle write to body 2017-01-27 10:54:00 -08:00
Jass Bagga f95d49c870 Change datetime to datetime-local
Addresses #4871
2017-01-13 15:40:30 -08:00
Pranav K 5b2a4aecb6 Make Microsoft.AspNetCore.Mvc.TestCommon a regular project
* This allows specifying all it's dependencies rather than for consuming projects to do this
* Remove unused APIs
* Fix weird downgrade warnings that show up due to P2P references
2016-11-23 16:23:56 -08:00
Yves57 ed3b750ad2 Less allocations in ViewBuffer when there is only one ViewBufferPage 2016-10-07 11:25:30 -07:00
Doug Bunting 4e6fd823cf Fix bounds checking in `PagedCharBuffer` and related code
- #5347
- inconsistent bounds checking caused problems after `ArrayPool<char>` fell back to `new char[2048]`
 - would fail a `Debug` assertion in Debug builds and loop endlessly in Release builds
- change to `CacheTagHelper+CharBufferHtmlContent` is for correctness only
 - always uses a `CharArrayBufferSource` and that returns arrays of the exact size requested
2016-10-04 10:19:44 -07:00
Kiran Challa 89bd6dc1cd [Fixes #5212] Added a cookie based ITempDataProvider 2016-10-03 14:04:57 -07:00
Doug Bunting 4cca6b09f0 Reduce allocations during HTML generation
- #3918
- precompute size of `StringBuilder` in `ExpressionHelper`
- reduce `string` allocations in `ViewDataEvaluator`
 - also get rid of `Enumeration` state machines
- reduce the size of a few objects; use more expression-valued properties
 - e.g. don't store `_modelType` in `ModelExplorer`
- add `EmptyArray<TElement>`; make empty arrays consistently `static`
- avoid `string.Split()` in HTML and tag helpers

nits:
- make `ExpressionHelperTest` tests more stringent
- correct `Message` for an `ArgumentNullException`
- remove excess `using`s in classes I touched (but often ended up leaving otherwise unchanged)
- improve doc comments
- remove `ToString()` call on a `string`
- avoid encoding `string.Empty`
- fix test file name
- remove useless variables
- correct spelling
- improve whitespace
2016-10-03 12:17:47 -07:00
Doug Bunting f222fa4349 Correct examination of `IHtmlHelper.Label()` return value
- #5317
- previously worked only because `TagBuilder` cannot be empty and `HtmlString` overrides `ToString()`
 - `TagBuilder.ToString()` (now the type's `FullName`) is also never empty
- copy `NullHtmlEncoder` from Razor and give it a better name (`PassThroughHtmlEncoder`)
 - not available in this project and (from its namespace) not intended for general use
2016-09-27 10:00:29 -07:00
Pranav K 760c8f3867 Ensure Append writes to the right page after Clear 2016-09-14 18:57:21 -07:00
Pranav K d9ff1d81d6 PagedBufferedTextWriter does not flush synchronous data prior to writing data asynchronously
Fixes #5241
2016-09-14 14:52:06 -07:00
Pranav K 43071319aa Buffer rendered CacheTagHelper content strings to a custom TextWriter
Fixes #4893
2016-09-14 14:47:37 -07:00
Ryan Brandenburg 310ab25347 Make tests resilient to Localization (#5011) 2016-07-14 09:28:01 -07:00
Medeni Baykal 4fe758240f Added `ViewResultTest`s. (#4939)
* Added `ViewResultTest`s.
* Fixed the namespace and folder of `PartialViewResultTest `; and some minor fixes.
2016-07-05 15:25:20 -07:00
Crystal Qian e51a118a9d Added consistent model property to view result variants (#4901)
* Added consistent model property/tests to ViewResult, PartialViewResult, ViewComponentResult. This resolves #4813.

* Removed unnecessary model asserts

* Removed redundant model checking
2016-06-28 09:38:37 -07:00
jacalvar 4b5df98bc3 [Fixes #4224] Remove use of service locator on ViewExecutor 2016-05-31 23:39:22 -07:00
jacalvar 6a6d2e0d9f [Fixes #4506] Move and rename ActionDescriptor.Name to ControllerActionDescriptor.ActionName 2016-05-31 23:13:20 -07:00
N. Taylor Mullen 55922d68d4 React to `HtmlEncodedString` rename to `HtmlString`.
- Removed the Mvc instance of `HtmlString` since it now exists in `HtmlAbstractions`.

#4558
aspnet/HtmlAbstractions#25
2016-05-17 11:02:10 -07:00
Doug Bunting 7a1ac034f9 Special-case use of `razorPage.Model` property in `ExpressionMetadataProvider`
- #3978
- better-aligns `ExpressionMetadataProvider` with `ExpressionHelper`

nit: mock less in `RazorPageCreateModelExpressionTest`
2016-04-15 17:15:33 -07:00
ryanbrandenburg 906ac728c7 Null-check PagedBufferedStringWriter 2016-04-01 11:50:46 -07:00
mnltejaswini 7fbd407ad5 [Perf] Rewrite ExpressionHelper.GetExpressionText using StringBuilder 2016-03-31 11:26:37 -07:00
Doug Bunting 6bf25cecec React to HttpAbstractions namespace changes
- aspnet/HttpAbstractions#549 and aspnet/HttpAbstractions#592
- clean up `using`s
2016-03-30 16:19:42 -07:00
mnltejaswini 66ff9939c3 Cache Member Access Expression Text to avoid ExpressionHelper.GetExpressionText
Part 1 Fix for  #3921
2016-03-25 09:12:02 -07:00
jacalvar 6b369ef291 [Fixes #4102] DefaultHtmlGenerator should attempt to properly format values for `<input type="date">` and `<input type="time">` 2016-03-09 17:22:02 -08:00
Pranav K 3aa3799494 Rename ICanHasViewContext to IViewContextAware
Fixes #4073
2016-03-04 10:33:49 -08:00
Ryan Nowak 0b7035ddcf Implement MoveTo semantics in Mvc
- Simplify things that used to rely on HtmlTextWriter. This behavior is
  now the default.

- Simplify a whole mess of Razor TextWriter code.

- Integration test for merging of TagHelper buffers back into the 'main'
  buffer.
2016-03-04 07:54:31 -08:00
Kiran Challa bf93c7d7a4 Removed JavaScriptEncoder property from HtmlHelper 2016-02-02 16:52:13 -08:00
Ryan Nowak 1a70f12bf8 Undesign client validation
This change removes a layer of abstraction. These validators now just do
what they do now without creating a bunch of intermediate objects.

ModelClientValidationRule has been removed, and client validations
manipulate the attributes collection of a tag directly.
2016-01-27 09:55:18 -08:00
jacalvar 71a815be50 [Fixes #3979] AuthorizationContext conflicts with type in Microsoft.AspNet.Authorization 2016-01-26 16:27:40 -08:00
Ryan Nowak 434da683fc Improve buffering of Razor output in MVC
These changes are aimed at significantly improving the performance of
MVC/Razor when a large amount of content is in play or a large number of
TagHelpers are used.

A few issues addressed:

- Buffer sync writes after a flush has occurred so that we can write them
  asyncronously. The issue is that an IHtmlContent can only do sync
  writes. This is very bad for Kestrel in general. Doing these writes
  async is better for our overall perf, and the buffer that we use for it
  is from the pool.

- 'Flatten' ViewBuffers when possible. A page with lots of TagHelpers can
  end up renting a ViewBuffer and only write 2-3 things into it. When a
  ViewBuffer sees another ViewBuffer we can either steal its pages, or
  copy data out and 'return' its pages. This lets us use 3-4 buffers for a
  large Razor page instead of hundreds.
2016-01-25 12:40:52 -08:00
Ryan Nowak 8b1bd343ba Internal cleanup in ViewFeatures 2016-01-24 22:13:29 -08:00
N. Taylor Mullen 3be7fbdf9f Rename AspNet 5 file contents.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:18:33 -08:00
N. Taylor Mullen 6a6c8ca544 Rename AspNet 5 folders and files.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:17:07 -08:00