Navigation Menu

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

Support a directive to set a prefix that opts elements into Tag Helper processing (parse time) #309

Closed
DamianEdwards opened this issue Feb 20, 2015 · 3 comments
Assignees
Labels
Milestone

Comments

@DamianEdwards
Copy link
Member

We should support a new directive that allows the app to set a prefix that is used to opt elements into Tag Helper processing at parse time. It should default to nothing (no prefix). This is the functional opposite of the ! prefix for opting elements out of Tag Helper processing.

The directive should be hierarchical so that it can be set globally (in _GlobalImport.cshtml) or at any folder level.

It can be set to any string literal that the razor parser considers valid as part of an HTML element name.

.e.g. in _GlobalImport.cshtml

@tagHelperPrefix "th:"

in Views/Home/Index.cshtml

<input class="not-processed-for-tag-helpers" />
<th:input class="processed-for-tag-helpers" />
<cache>Not processed for tag helpers</cache>
<th:cache>Processed for tag helpers</th:cache>
@yishaigalatzer yishaigalatzer added this to the 4.0.0-rc1 milestone Feb 20, 2015
@NTaylorMullen
Copy link
Member

@DamianEdwards what do you think should happen in the case that a user has two of these on a single page? Error right?

@DamianEdwards
Copy link
Member Author

@NTaylorMullen yep, error.

NTaylorMullen added a commit that referenced this issue Feb 24, 2015
- Updated TagHelperDescriptor to have a Prefix property. This enables new tooling scenarios such as refactoring prefixes or even giving them their own classification.
- Added invalid prefix cases '@', '!' and whitespace.
- Added TagHelperPrefix chunks, codegenerator, parsing logic to flow the directive through the Razor pipeline.

#309
NTaylorMullen added a commit that referenced this issue Feb 25, 2015
- Updated TagHelperDescriptor to have a Prefix property. This enables new tooling scenarios such as refactoring prefixes or even giving them their own classification.
- Added invalid prefix cases '@', '!' and whitespace.
- Added TagHelperPrefix chunks, codegenerator, parsing logic to flow the directive through the Razor pipeline.

#309
NTaylorMullen added a commit that referenced this issue Feb 25, 2015
- Added parsing, sub-rewriting, rewriting and code generation tests for runtime/designtime.
- Fixed existing tests to utilize new class structures.
- Expanded block types to enable easy testing of prefixed TagHelpers.

#309
NTaylorMullen added a commit that referenced this issue Feb 25, 2015
- Updated TagHelperDescriptor to have a Prefix property. This enables new tooling scenarios such as refactoring prefixes or even giving them their own classification.
- Added invalid prefix cases '@', '!' and whitespace.
- Added TagHelperPrefix chunks, codegenerator, parsing logic to flow the directive through the Razor pipeline.

#309
NTaylorMullen added a commit that referenced this issue Feb 25, 2015
- Added parsing, sub-rewriting, rewriting and code generation tests for runtime/designtime.
- Fixed existing tests to utilize new class structures.
- Expanded block types to enable easy testing of prefixed TagHelpers.

#309
NTaylorMullen added a commit that referenced this issue Mar 3, 2015
- Updated TagHelperDescriptor to have a Prefix property. This enables new tooling scenarios such as refactoring prefixes or even giving them their own classification.
- Added invalid prefix cases.
- Added TagHelperPrefix chunks, codegenerator, parsing logic to flow the directive through the Razor pipeline.

#309
NTaylorMullen added a commit that referenced this issue Mar 3, 2015
- Added parsing, sub-rewriting, rewriting and code generation tests for runtime/designtime.
- Fixed existing tests to utilize new class structures.

#309
NTaylorMullen added a commit to aspnet/Mvc that referenced this issue Mar 3, 2015
- Type and property names changed for a core type that we override, AddOrRemoveTagHelperSpanVisitor => TagHelperDirectiveSpanVisitor.
@NTaylorMullen
Copy link
Member

4d97a54
4bd02ba

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

No branches or pull requests

3 participants