Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename dynamic cache tag helper #6737

Merged
merged 1 commit into from
Aug 28, 2020
Merged

Conversation

deanmarcussen
Copy link
Member

Fixes #6548

@hishamco
Copy link
Member

Still I see a value of using oc as TagHelper prefix that can be configured into _ViewImports.cshtml not as a part of TagHelper name, this will avoid the name conflict from Microsoft and other 3rd parties TagHelpers. But I will leave this open to the community to decide

@jtkech
Copy link
Member

jtkech commented Jul 27, 2020

@deanmarcussen

Here the singularity is that the mvc cache tag helper can be selected only by its tag name without any attribute.

So i suggest distributed-cache because the mvc one needs a name attribute, and our one a cache-id attribute.

And also because our tag helper uses IDistributedCache.

Update: E.g. for script and style tag helpers we use a bridge between razor and liquid, it's good for maintainability as they use the same code. So just to say that this is not the case for caching tags, but at least here nothing to do on liquid side ;)

@deanmarcussen
Copy link
Member Author

So i suggest distributed-cache because the mvc one needs a name attribute, and our one a cache-id attribute.

And also because our tag helper uses IDistributedCache.

It's kinda wordy? But so is <dynamic-cache> But I'm not hearing any better offers from anyone...

@hishamco The idea is to not have to configure anything special in _ViewImports (because how will people know they have to - it's been three years of having this tag before we realised it conflicted). So I don't see how having to use a prefix fixes anything.

@hishamco
Copy link
Member

Three years!! that's too long ;) the tag prefix will not change the name, we can keep the tag name as it was, so no breaking changes. It just a token that can differentiate our tag helpers from other 3rd-party once and avoid us from thinking about new names whenever create a tag helper and AspNetCore has similar one. It is something like old WebForms controls: asp:Button, asp:Label, IMHO the prefix will add a value nothing else

@deanmarcussen
Copy link
Member Author

Maybe I am misunderstanding the prefix suggestion.

It is something the user has to add to their _ViewImports file? so that taghelpers from a particular assembly are prefixed?

So doesn't prevent the collision, just provides another way of managing them.

If I have misunderstood, show an example?

@hishamco
Copy link
Member

It is something the user has to add to their _ViewImports file?

Exactly!!

So doesn't prevent the collision

Why?!! if we prefix our tag helpers in all assemblies, no collision will happen, because we should write oc: first, then the VS intellisense will recognize them

@agriffard agriffard requested a review from jtkech August 27, 2020 12:35
@agriffard agriffard merged commit b2b6781 into dev Aug 28, 2020
@delete-merged-branch delete-merged-branch bot deleted the deanmarcussen/break-dynamic-cache branch August 28, 2020 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic Cache Tag Helper conflicts with ASP.NET Core cache tag helper
4 participants