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 Link component #2875

Closed
stsrki opened this issue Sep 7, 2021 · 3 comments · Fixed by #2908
Closed

Rename Link component #2875

stsrki opened this issue Sep 7, 2021 · 3 comments · Fixed by #2908

Comments

@stsrki
Copy link
Collaborator

stsrki commented Sep 7, 2021

At the moment Link is a Razor reserved word and because of that, we cannot write it in a razor file without an Intellisense complaint. See dotnet/aspnetcore#2424

So instead of <Link To="#"></Link> we always have to write it as <Blazorise.Link To="#"></Blazorise.Link>, which is tedious.


The alternative is to rename the Link to something else and proposals are

  • <Anchor To="/">Home</Anchor>
  • <Hyperlink To="/">Home</Hyperlink>


Something else? Write in the comment.

@stsrki stsrki changed the title Rename Link component Poll: Rename Link component Sep 7, 2021
@stsrki stsrki pinned this issue Sep 7, 2021
@CaiusJard
Copy link

CaiusJard commented Sep 8, 2021

My feelings on it are "neither". Instead we should be lobbying Microsoft to allow aliasing of types (@using BLink = Blazorise.Link ... <BLink ..) so we can decide our own short format rather than every single library out there having to rename and rename again its members to avoid conflict with other libraries and our own custom controls..

I'll probably carry on using Blazorise.Link until MS can make a change. I can also make my own subclass BLink that does nothing other than inherit Blazorise.Link if I want to use BLink in markup

I don't like anchor so much because it's hard to find; if you're used to Link, typing Link and getting intellisense does at least bring up Hyperlink.. MS also engage in inventing new names for (NavLink) and I wish they wouldn't.. This "learn another new set of names for a new lib that does the same old thing" is exhausting.. Feels like we need to look at causes, not symptoms

@stsrki
Copy link
Collaborator Author

stsrki commented Sep 8, 2021

@CaiusJard I agree, but unfortunately, they're not very fast delivering a fix. See an open ticket https://github.com/dotnet/aspnetcore/issues/18685 from last year.

I like Link and I would like it to stay but I have no idea how soon the fix will come, or ever. Maybe the workaround is to leave it but only introduce the Anchor component that directly inherits from the Link?

@CaiusJard
Copy link

CaiusJard commented Sep 8, 2021

That, my mind, would be the least impact; i can imagine that a lot of people have used Blazorise.Link. Anchor could be introduced, and if ms ever allow @using X=Y and also fix the link/Link conflation, it can be deprecated in favor of an advice to either replace with <Link or add an alias to the global imports if they didnt want to change code

Personally i'd like to see case sensitivity mean something in rzr intellisense; <Link != <link as far as the syntax highlighter is concerned, so why not intellisense/have a "lowercase is html, PascalCase is componentry" distinction.. but this ain't the place to bang that drum..)

@stsrki stsrki added this to the 0.9.5 milestone Sep 10, 2021
@stsrki stsrki self-assigned this Sep 10, 2021
@stsrki stsrki unpinned this issue Sep 11, 2021
@stsrki stsrki changed the title Poll: Rename Link component Rename Link component Sep 11, 2021
This was referenced Sep 11, 2021
@stsrki stsrki moved this to ✔ Done in Development Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants