Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Consider moving TagHelperOutput.Generate*() functionality to RazorPage.Write in Mvc. #318

Closed
sornaks opened this issue Mar 4, 2015 · 3 comments

Comments

@sornaks
Copy link

sornaks commented Mar 4, 2015

Quoting @dougbu 's comment:

for future consideration (not this PR) but related to the TagHelperContent / DefaultTagHelperContent split introduced here: suggest we split TagHelperOutput along similar lines and get the Generate*() methods and perhaps ContentSet out of tag helper authors' faces.

This split could go further and move the Generate*() methods completely out of this class (or class hierarchy). if _isTagNameNullOrWhitespace were exposed as a property (like ContentSet), these methods would not require any private information. could move generation many places but I suggest the RazorPage.WriteLiteral[To]([TextWriter,] TagHelperExecutionContext) methods I proposed elsewhere. in any case, this would pull apart the mix of responsibilities TagHelperOutput has today.

@dougbu
Copy link
Member

dougbu commented Mar 4, 2015

the general point is to revisit what we expose in TagHelperContent and how we use that class in the framework. this includes looking closely at the boilerplate code generated for tag helper scenarios.

another comment from the same review:

not necessarily a part of this PR: suggest we create WriteLiteral(TagHelperExecutionContext) and WriteLiteralTo(TextWriter, TagHelperExecutionContext) overloads in RazorPage. no reason to generate the boilerplate code from WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag()); through this line. possible to include the RunAsync() call in the methods but that doesn't fit well into a "WriteSomething()` method.

@danroth27
Copy link
Member

@sornaks Please work with @DamianEdwards @NTaylorMullen @dougbu on this.

@sornaks
Copy link
Author

sornaks commented Mar 17, 2015

7daec14 and aspnet/Mvc@c1338a0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants