Commit Graph

86 Commits

Author SHA1 Message Date
N. Taylor Mullen 0b5f0cd565 Rebased onto latest dev.
- Fixed tag helper parse tree visitor rebase error.
2014-10-09 12:50:56 -07:00
N. Taylor Mullen b1b1da0781 Add Microsoft.AspNet.Razor.Runtime src and test project.
#136
2014-10-09 12:50:52 -07:00
N. Taylor Mullen 950828cbab Refactored CodeGeneratorContext to CodeBuilderContext.
- Needed to separate the context's of "generation" and "building" to enable the communication of the TagHelperProvider.
2014-10-09 12:50:49 -07:00
N. Taylor Mullen 3cba84104d Add TagHelper parse tree visitor.
- The visitor looks for TagBlock's that match registered TagHelpers and rebuilds them into TagHelperBlock's.
- Added the code generator and corresponding chunk for a TagHelperBlock.
- Added syntax tree specific objects & helper methods to create accurate tag helper structures.

#71
2014-10-09 12:50:39 -07:00
Pranav K 83da8e257d Generate code for expressions in design time to enable intellisense
Fixes #80
2014-10-08 09:53:27 -07:00
David Fowler 9bb460d5ab Fixup references 2014-10-05 12:04:53 -07:00
David Fowler 01605cd695 Fixed project.json casing 2014-10-04 02:52:07 -07:00
Pranav K f913d8929f Updating CSharpCodeVisitor to generate implicit expressions on a single
line

Fixing 151
2014-10-01 17:20:00 -07:00
Pranav K e5f157565c Removing out var usage 2014-10-01 14:33:14 -07:00
Pranav K d58a6c8c1b Don't calculate checksum in design time mode 2014-09-29 15:33:33 -07:00
Pranav K 5369842384 Ensure pragma checksum is prepended to generated file
Fixes #160
2014-09-29 14:45:26 -07:00
Pranav K 11ee402eec Reviving support for instrumentation in CSharpCodeVisitor
Fixes #42
2014-09-22 17:59:29 -07:00
Ryan Nowak 131c973853 Fix for #90 - removing Enum.HasFlags
This is a perf improvement of about 500ms for our razor code generation
benchmark on my dev box. That's about .8% of the overall execution time of
this benchmark.

This change will remove a bunch of unnessary allocations from the
parsing/code-generation path, and should improve responsiveness.

For reference Enum.HasFlags performs boxing of the enum value, and then
does a type comparison to see if the types are the same. This is
significantly more costly than a normal bitwise and comparison, and it
results in allocations.
2014-09-22 12:45:52 -07:00
Ryan Nowak 2d9b3dd4fb Fix for #91 - Turn some commonly allocated types into structs
These types are allocated for every state transition in the parser (State)
or every character that's read (character reference) and are fairly
compact. Turning them into structs will remove a significant number of unnecessary
allocations in the parser.

For our razor code generation benchmark, making these changes yields about
500-750ms of speedup (out of 40000ms) or about 1%.
2014-09-22 11:28:54 -07:00
Pranav K a5668bdbab Make CompleteBlock accessible to derived parser 2014-09-17 12:46:00 -07:00
Pranav K 658eed4c0f Removing Activator.CreateInstance call from CodeTreeBuilder 2014-09-11 11:55:01 -07:00
N. Taylor Mullen 555615f60e Add TagHelper registration system.
- This registration system accepts tag descriptors that it then uses to feed requests for tag helpers.
- Added some infrastructure pieces that are used to build up valid tag helper descriptors.

#70
2014-09-08 17:14:22 -07:00
N. Taylor Mullen 82b45387a1 Fix nested tags in script tag.
#115
2014-09-08 17:08:36 -07:00
David Fowler 947ec326e0 Updated to use the new target framework in project.json 2014-08-28 23:43:51 -07:00
N. Taylor Mullen 6114d5d269 Modify parser to group html begin/end elements.
- Added a "Tag" block type.
- Wrapped all begin/end elements in a "Tag" Markup block.

#75
2014-08-26 14:53:09 -07:00
Ryan Nowak ff944e5948 Fix for Razor #84 - Optimize GetSourceLocation
GetSourceLocation is frequently called to determine the location mappings
between the original document and the generated code.

The old implementation did a number of ToString and replace operations to
simplify the math on tracking the position - which put it front and center
in our performance measurements - about 25% of all execution time in a
sampling profile of our perf test.

The new code tracks position as code is written, and avoids allocations.
After these changes GetSourceLocation doesn't show up in the profile.
2014-08-20 13:22:23 -07:00
Pranav K 896cce5b51 Reacting to System.IO package version change 2014-08-20 06:56:35 -07:00
Pranav K 1a8278b7c2 Reacting to System.IO.FileSystem package version change 2014-08-18 15:10:12 -07:00
David Fowler 430105e713 Removed source files from the project 2014-08-15 09:24:16 -07:00
Pranav K 8aef9ff651 Reacting to System.Collections version change 2014-07-14 15:20:49 -07:00
David Fowler 0d1f308753 Renamed configurations to frameworks in project.json 2014-07-13 22:00:23 -07:00
N. Taylor Mullen c7545a0354 Add a virtual BuildClassDeclaration method to CSharpCodeBuilder.
This extensibility point needs to be an override and not a pure visitor due to how the class declaration is created (only 1 right way to write the class).

#76
2014-06-27 10:26:52 -07:00
Brice Lambson c0fe1428b2 Bump version to 4.0.0-* 2014-06-19 16:44:54 -07:00
N. Taylor Mullen 8099dcda63 Remove error for "@" in nested codeblocks.
Also removed the corresponding test and resource for this change.

#64
2014-06-18 14:51:31 -07:00
N. Taylor Mullen 9a6a3af450 Transition Microsoft.AspNet.Razor from csproj to kproj.
Needed to modify some source to use new resx format.

#32
2014-06-04 14:58:01 -07:00
N. Taylor Mullen dd90767036 Fix build warnings in razor repo.
This involved indicating that we really wanted to hide certain methods.

#43
2014-06-04 14:25:13 -07:00
Pranav K 4f255f8583 Changes for @inject support
Fixes #35
2014-06-03 14:20:11 -07:00
N. Taylor Mullen d0541ad5b2 Modify await keyword to accept dots.
When doing Html.Foo we used to not accept the "." and then group the rest of the line together at the end.

#45
2014-05-15 10:51:59 -07:00
Yishai Galatzer bd7045b258 Cleanup assemblyinfo.cs + .gitignore 2014-05-11 08:54:40 -07:00
N. Taylor Mullen 662dc087bd Addressed code review comments.
#28
2014-05-09 14:49:02 -07:00
N. Taylor Mullen 2800c4938a Disable async await warnings in empty Execute method.
Also removed a confusing CSharpCodeWriting method.

#28
2014-05-09 11:09:41 -07:00
N. Taylor Mullen 9b267dadbd Modify line pragma formatting supporters.
Modified the dummy line pragmas arround expression chunk blocks to be accurate to avoid bad error messages.

#30
2014-05-09 11:06:28 -07:00
Andrew Peters 477141564f Updating copyright headers 2014-05-08 23:01:26 -07:00
anpete 6c9899b586 Merge branch 'dev' of github.com:aspnet/Razor into dev 2014-05-01 17:41:03 -07:00
anpete 6c2130239f Update file headers 2014-05-01 17:40:52 -07:00
N. Taylor Mullen c4f034e8ad Re-updated version to System.IO.FileSystem. 2014-05-01 17:10:57 -07:00
N. Taylor Mullen 039c304d25 Upgrade FileSystem dependency. 2014-05-01 17:01:58 -07:00
N. Taylor Mullen 9abd67da4b Cleaned up some code writer code.
Modified the ToString override to be GenerateCode and fixed how it cached.
2014-04-22 15:21:09 -07:00
Pranav K 9c4a6e901d Modifying DefineSection to generate HelperResult types 2014-04-01 18:32:37 -07:00
Pranav K 3ce198249d Updating CoreCLR package versions 2014-03-27 18:42:51 -07:00
N. Taylor Mullen 50314ca7e5 Add the ability for users to await expressions.
This enabled things like @await Foo().  We special case the await keyword and allow another snippet of code to follow it.
2014-03-18 12:37:07 -07:00
N. Taylor Mullen 5912475a24 Change Execute rendering to be async.
Added the using statement required for async rendering.
2014-03-17 11:28:43 -07:00
N. Taylor Mullen b1c49a2535 Remove CodeDOM from net45 Razor.
Removed all System.CodeDOM related code from net45.  This involved modifying some existing code paths and most of all reducing the complexity of all of the CodeGenerators.  Added some factory creation methods to build CodeBuilders.  Ran code analysis and made adjustments to pass analysis.
2014-03-14 16:05:23 -07:00
David Fowler 10c10ab2e7 Added required packages for K 2014-03-07 02:46:45 -08:00
N. Taylor Mullen 6ea8d7721b Re-applied code review changes for formatting fix.
The previous fix was accidentally overridden.  Also changed how we
render chunk block's children.  New way avoids casts and removes logic
from base.
2014-03-05 11:24:06 -08:00