Commit Graph

136 Commits

Author SHA1 Message Date
N. Taylor Mullen 0e25470660 React to aspnet/Razor#578. 2015-10-22 14:41:40 -07:00
Pranav K f4a6d634b5 Modify ViewStartUtility to generate always view paths with forward slashes
Fixes #3294
2015-10-19 10:33:05 -07:00
N. Taylor Mullen e943cdb57a React to aspnet/Razor#569 2015-10-16 15:09:31 -07:00
Pranav K 91cb6281e4 Using @inherits and @model together gives intellisense errors
Fixes #3243
2015-10-08 11:02:20 -07:00
Pranav K f57e180971 Renaming Microsoft.Framework.* -> Microsoft.Extensions.* 2015-10-03 15:44:53 -07:00
Pranav K 2028351bb8 React to WriteAttribute \ AddHtmlAttribute API changes 2015-10-01 10:19:14 -07:00
Pranav K 1833e06984 TModel substitution in Razor pages has broken intellisense
Fixes #3185
2015-09-23 17:47:52 -07:00
Pranav K ff4100e292 Generate an expression to create line mappings for ModelChunk directives 2015-09-23 16:14:29 -07:00
Pranav K 89f58aa49f Allow @model specified in a page work with @inherits directive in
_ViewImports

Fixes #3144
2015-09-23 12:10:10 -07:00
Pranav K 9eb2c5b810 Reacting to IExpirationTrigger -> IChangeToken rename 2015-09-22 08:14:34 -07:00
Pranav K f045c6792b Allow _ViewImports to remove default inherited tag helpers.
Additionally simplifying the contract for
ChunkInheritaceUtility\IChunkMerger so we don't have to understand the
order in which CodeTrees appear.
2015-09-21 14:53:24 -07:00
Pranav K 7b433820b1 Changes per PR comments
Reformatting parameter identation
2015-09-17 15:42:58 -07:00
Pranav K a68d9e4cb1 Replace NotNullAttribute with thrown exceptions 2015-09-17 11:56:44 -07:00
Ryan Nowak ef730790d4 Fix tests broken by renames 2015-09-17 07:40:15 -07:00
Ryan Nowak 538cd9c191 Move less-commonly used types out of .Rendering 2015-09-16 23:52:29 -07:00
N. Taylor Mullen 9169a156e2 Update additional tests to account for new error lengths. 2015-09-03 15:21:00 -07:00
N. Taylor Mullen b871172dd0 Expose locations of `_ViewImports.cshtml` that affect a given Razor file.
- Added `ChunkTreeResult` to associate inherited chunks with a specific source file.
- Updated existing tests to validate file path.

#2256
2015-08-19 12:12:52 -07:00
David Fowler 91c0081939 Added reference to Microsoft.AspNet.Mvc.Razor so that it's loadable. 2015-08-19 10:24:29 -07:00
Ajay Bhargav Baaskaran dac75fa56d React to aspnet/Razor#441 change 2015-08-16 18:22:22 -07:00
sornaks 27f7f3d437 Issue #2779 - Normalize newlines to "\r\n" instead of "\n". 2015-08-14 17:13:29 -07:00
Ajay Bhargav Baaskaran 6fe5045c55 React to aspnet/Razor#488 2015-08-14 13:00:39 -07:00
N. Taylor Mullen 1b51f6bca6 Enable input, image and url resolution `TagHelper`s to be written as void elements.
- Razor rendering now understands `TagMode` which allows void elements to be rendered.
- Added a `TagStructure.WithoutEnd` bit to `InputTagHelper`, `ImageTagHelper` and `UrlResolutionTagHelper`. This will allow users to write the various elements in the void format. Used the HTML5 spec to determine the elements appropriate.
- Added tests to ensure `TagMode.StartTagOnly` is rendered properly.
- Updated a few functional tests to showcase the void element formats.

aspnet/Razor#450
2015-08-13 16:19:28 -07:00
sornaks b6a109e2a3 Making DefaultDisplayTemplates and DefaultEditorTemplates use IHtmlContent.
- Making TagBuilder's InnerHtml an IHtmlContent.
- Delay encoding until the content is written.
- Moving BufferedHtmlContent to Common cos it is used in aspnet/Razor also.
- Changing GenerateOption to take in a string and create StringHtmlContent.
- This reduces the space used by around 13%.
2015-08-10 14:55:34 -07:00
sornaks 1aef84b50d Issue #2745 - ViewHierarchyUtility.GetHierarchicalPath does not handle root paths *nix file systems.
Fix: It is not necessary to check for root paths in this place because ViewHierarchyUtility.GetHierarchicalPath is always called with a relative path. Hence removing the check.
2015-08-06 10:31:11 -07:00
Tugberk Ugurlu 81f8b3edfb removed packExclude from unnecessary places, replaced it with
publishExclude and removed kproj and xproj excludes
2015-07-20 16:49:59 -07:00
Ryan Nowak e985fa5d42 Split up MVC.Extensions into smaller packages
Startup.cs API experience to follow in a separate change. This change just
gets the bulk of the code churn out of the way.
2015-07-06 23:41:22 -07:00
sornaks 68523a3550 Fixing tests in Mono.
- Disabling tests which have corresponding bugs in mono.
- Fixing a few tests which do not handle *nix file system.
- Updating Travis configuration to use mono's alpha bits.
- Introducing PlatformNormalizer to normalize content across multiple platforms.
2015-07-02 17:24:14 -07:00
N. Taylor Mullen 15cb2ce709 React to aspnet/Razor#382 2015-06-30 12:49:48 -07:00
N. Taylor Mullen 02a3ca8abb React to aspnet/Razor#352.
- Moved initialization of TagHelperDescriptorResolver to be Lazy so DesignTimeMode can be set.
2015-06-25 15:50:19 -07:00
Doug Bunting 9c63d1d842 Get tests working with `core.autocrlf=false`
- #1514
- refactor `RazorCompilationService` to allow a test subclass that normalizes Razor file line endings
 - add `TestRazorCompilationService` to `RazorPageExecutionInstrumentationWebSite`
 - adjust line endings to match in `RazorPageExecutionInstrumentationTest`
- add `ignoreLineEndingDifferences: true` to `Assert.Equal()` calls
 - responses on Windows can have a mix of line endings
  - `git config` setting affects line endings in .cshtml (and baseline) files
  - however MVC and Razor mix `Environment.NewLine`s into HTTP responses
- update `PrecompilationTest` to split response regardless of line endings
- update `ResourceFile` to normalize all source file streams to LF only
 - ensures consistent checksums and line mappings
 - change `MvcRazorHostTest` to expect new line mappings
 - recreate baseline files to expect new checksums and literal line endings
- use verbatim strings in affected tests
 - careful use of `Environment.NewLine` in expectations is now just noise

nits:
- add doc comments in `RazorCompilationService`
- correct `TagHelpersTest` name to match containing file
- avoid incorrect `using` removal when `GENERATE_BASELINES` is not defined
- remove unnecessary `ResourceFile` normalization of output files
2015-06-24 14:53:07 -07:00
N. Taylor Mullen 31aa51ba49 React to aspnet/Razor#172. 2015-06-10 14:43:08 -07:00
Ryan Nowak a679e87a9b Split Mvc.Core
This is the first step is some more refactorings to come in the future
with the goal of making MVC less monolythic. This makes the core of MVC
more reusable and more in line with the design of other vNext platform
components.

With this change, Mvc.Core contains just the minimal guts needed to build
a working app.
- Action Discovery
- Action Invoker
- Filters
- ObjectResult
- Model Metadata
- Model Binding
- Formatters
- Validation System

And yes, we are aware of the irony of 'minimal MVC' not including the view
system. The idea is that this is the kernel of an MVC app, and anything
real is layered on top.

The most noticable impact of this change is that MvcOptions has been blown
apart into more managable chunks. See the various ConfigureMvc*** methods.

The new Mvc.Extensions package is a placeholder while we evaluate and tune
the new definitions. Expect more changes as features are move to their own
packages, and in some case their own repositories.

For now there is no experience to bootstrap an Mvc.Core app. That's coming
next.
2015-06-09 02:12:13 -07:00
Doug Bunting ffd1dc1fb0 Add support for generating baseline output files while testing
- baselines include both expected output and design-time line mappings
- controlled by GENERATE_BASELINES
 - assertions related to file content are not checked in this mode
- add design-time test of Basic.cshtml to `MvcRazorHostTest`
- regenerate all files to avoid BOM and blank line noise in future PRs
 - update out-of-date design-time Basic.cs file

nits:
- make a few variable names more consistent
- make `Assembly` fields `static`
- remove unused `_resourcesAssembly` field from `ErrorPageTests`
- remove `ResourceHelpers` which was specific to functional tests
2015-06-01 13:13:39 -07:00
N. Taylor Mullen e0b8532735 Update names and spacing of some missed ChunkTree renames. 2015-05-29 23:07:55 -07:00
N. Taylor Mullen 94553703a2 React to aspnet/Razor#140
- ICodeTreeCache => IChunkTreeCache
- ModelCodeGenerator => ModelChunkGenerator
- MvcCSharpCodeBuilder => MvcCSharpCodeGenerator
- Updated files that used Razor resources that are now in different namespaces.
- Updated variable names to account for Razor renames.

aspnet/Razor#140
2015-05-29 14:21:35 -07:00
Ryan Nowak 92dbd8923b Fix #2582 - Remove @inject dependency on [Activate]
Removes usage of [Activate] in razor code generation. Razor will now use
it's own special attribute recognized by the Razor activator.
2015-05-21 22:57:39 -07:00
Kiran Challa 2a321fd622 React to Caching api review changes 2015-05-21 14:44:27 -07:00
Doug Bunting 8a701726b3 Rename _GlobalImport.cshtml files to _ViewImports.cshtml
- also rename files and directories with "GlobalImport" in name
 - nearly blind but avoid "ViewImportss" in new names
- public API change: `ViewHierarchyUtility.GetGlobalImportLocations()` -> `GetViewImportsLocations()`
 - primary source updates were comments, tests, and implementation details

nit:
- rename NestedGlobalImports.cs file to NestedViewImportsController.cs, matching class
2015-05-21 12:27:08 -07:00
Kirthi Krishnamraju 78033fda1f fix build break 2015-05-21 11:25:03 -07:00
Doug Bunting 517c013882 React to aspnet/Razor#89 fix
- use `IDictionary<string, TValue>` support in `<a/>` and `<form/>` tag helpers
 - make `RouteValues` dictionaries `IDictionary<string, string>` for ease of use
- remove `TagHelperOutputExtensions.FindPrefixedAttributes()`
- set all `GeneratedTagHelperContext` properties
- add error for tag helper dictionary properties where `TValue` is `ModelExpression`
- add new `RazorPage.InvalidTagHelperIndexerAssignment()` method and resource

tests
- use new `isIndexer` argument when creating `TagHelperAttributeDescriptor`
- arrange `AnchorTagHelper` and `FormTagHelper` correctly
 - also expect `routeValues != null` in calls to `IHtmlGenerator`

nits:
- get rid of some `foo` and `bar` gunk in tests
- remove unused variable to cleanup a test compilation warning
2015-05-20 22:07:19 -07:00
Ajay Bhargav Baaskaran 47bfba11b9 React to aspnet/Razor#217 fix 2015-05-15 12:28:43 -07:00
James Newton-King ab4cd5c4c4 Add JsonHelper for serializing JSON in views
- remove NotNull from JsonHelper Serialize
2015-05-11 16:01:08 -07:00
Pranav K 131096ff61 Adding relevant unit tests for MvcRazorCodeParser property name trimming 2015-05-11 12:20:49 -07:00
Pranav K 320507604a Removing superfluous types and methods from Common. 2015-05-09 08:04:28 -07:00
Doug Bunting 584015c79b A few quick cleanups
- in .kproj files, let VS mark a couple more test projects as such
- remove duplicate `ModelExpression` class
 - not necessary now that test project references MVC Core project
 - follow up to 9fded74
- avoid `resources` warning in project.json files
2015-05-04 11:55:24 -07:00
N. Taylor Mullen 64e726d2b2 Update LICENSE.txt and license header on files. 2015-05-01 13:55:25 -07:00
Ryan Nowak 9fded74b15 Merging ModelBinding into Mvc.Core 2015-04-27 02:10:37 -07:00
Henk Mollema 955b45f995 Utilized `nameof()` for `ArgumentNullException`s
Utilized the use of nameof() operator for ArgumentNullExceptions.
2015-04-24 14:00:34 -07:00
Pranav K fb451b51e5 Added SourceLocation to inherited chunks \ tag helpers
Updated CompilationResult to support compilation failures from multiple
files.

Fixes #2321
2015-04-17 11:23:38 -07:00
N. Taylor Mullen eaa58bc913 Change inject directive to format correctly after newline during design time.
- Also modified existing tests to account for aspnet/Razor#332 which fixed models formatting after newline.
- Updated tests for inject to understand new formatting parsing.

aspnet/Razor#332
2015-04-15 12:18:45 -07:00