-
Notifications
You must be signed in to change notification settings - Fork 3.4k
adds tip to methods documentation about underscore and dollar prefixed namespace collisions with methods #1072
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
Conversation
@JustinBeaudry Btw, I'm leaning towards closing this in favor of the runtime error we're discussing in the other issue, possibly combined a recommended rule in Thanks for bringing this up though! The conversation you started will lead to improved communication with users one way or another, even if it's not in the docs. 🙂 |
@chrisvfritz I'm torn on this. Whilst I do agree that preventing cognitive overload with caveats and gotchas is important, this one is particularly nasty and could have many emergent properties and propagations of effect. The API docs feels like it should be the source of truth for this, even if the runtime warns in dev, and even if the eslint plugin helps prevent the issue. I defer to you on this, obviously, as I'm new to Vue. |
@JustinBeaudry I can see where you're coming from and it's possible I'll change my mind later, but at least for now, I think the added cognitive load is probably more likely to prevent people from absorbing the more vital information. We can place enough detail in warnings to help people understand why the rule exists and what they can do as an alternative. One other side note though, referencing a comment in the issue:
I had the same initial feeling coming to Vue from React. But over time, this "limitation" became one of my favorite features, because it leads to much more readable components. For example, I've seen React components passed This kind of conceptually sloppy code isn't possible in Vue. You're forced to use a different name for each prop, datum, computed property, and method - so you have to really think about what each thing actually is. The prop might be called Similarly with conventions around |
🙇
I agree. The issue for me is not that
I think a convention is fine and it makes sense.
With Symbols I think the goal of it should be to scope Vue's internal methods (leaving an open namespace), but not to scope out top-level properties ( |
This PR is in reference to vuejs/vue#6312.
Please note that this PR also add
.idea/
to gitignore.