-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Rename security-csrf TokenStorageInterface
for better DX
#58991
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
Comments
Shouldn't that be feature request with Jetbrains instead, so the IDE remembers and sorts most often used references on top? |
@kevinpapst I don't know if/how this could be implemented on PHPStorm's side. Also this applies to any IDE and having them remembering about the best choice still imply to train them so that wouldn't fix the experience on first time approaching Symfony. @symfony/mergers Any though before someone start working on this? The renaming impact should be pretty low to me. |
In order to work on this, we have first to solve one of the hardest problems in modern computer science: naming things. |
|
What I hoped to say between the lines: that sounds like a unneccessary "BC break for DX reasons" 😁 When I try to import See, actually I don't care at all if you rename it, I just think that you are looking for the wrong solution. You are a core member and this might be accepted (therefor). But the greater good would be to open up a Feature request with (y)our favorite IDE. There are many Reddit posts talking about the same problem. Being able to sort by usage would be so much better than adjusting the Framework around the IDE. |
Your reasoning sounds good to me generally speaking. It's all about finding the right balance though, with cost and impact (positive and negative) in mind. As you pointed out renaming BrowserKit's Request wouldn't help for the For the same reason we should strive not to use the same naming multiple times in newly added code , which I think we do. |
@yceruto Right, you do that once you already know about the confusion though. |
@kevinpapst made a good point. The If we rename a class or interface, we generate quite some busy work downstream and I'm not 100% sold that it's worth it just for the sake of having a more collision-free name. Shall we open an issue with JetBrains? The IDE should be able to figure out which classes would be the most likely to be picked by the developer, based on previous behavior or general usage of classes inside the current codebase. If the IDE is made smarter in that regard, everybody wins. |
I have constantly the same issue with |
Generally I am against this. We have namespace and Jetbrains should "be better". However, let's be pragmatic and help users instead of being "correct". I agree to rename the Csrf token storage. |
I think there are a few important differences between the TokenStorage case and the Request case:
|
I agree with @Nyholm here in this case let's rename and the IDEs should be better in the future 🙋♂️ |
Maybe a silly question, but couldn't we add some code in the Symfony IDEA plugin to force the classes we want to show up first? |
I thought you were more using VSCode lately isn't it? 😄 More seriously I don't know enough about Jetbrains plugin development to say if it's possible or not but I presume it is for PHPStorm and probably others, but maybe not all. |
@Haehnchen do you think this could be possible? |
Description
When typing
TokenStorage
in your IDE and being autocompleted, what you're looking for is theTokenStorageInterface
from security-core, not the one from security-csrf. Yet the csrf one is proposed first which has always been annoying. I propose to prefix that interface byCsrf
for the sake of better DX.Example
Before:
After, one gets the Core TokenStorageInterface proposed first.
The text was updated successfully, but these errors were encountered: