Comments (8)
I see ๐
To me this is the kind of cases most people won't hit and when they do, they should be able to find a forum post or issue with the reasoning.
Putting it on the docs as a tip adds mental overhead that will be useless to most users and it's something we are avoiding and, instead, trying to integrate the explanation with the guide, to make the learning experience smoother
Side note: talking about laziness, using one letters for debugging purposes is even shorter and about as bad in readability as using the spread operator ๐ :
export default {
setup(p, c) {
console.log(c)
}
}
from core.
It saves creating two proxy instances if the argument isn't used.
from core.
@KaelWD I know. But this is a trap, is it worth it? Maybe document it will help.
from core.
I don't think you are supposed to destructure the 2 arguments of setup like that.
Being able to avoid creating the Context object altogether for components not using it (all components that only rely on props) is a big perf boost. The only possible reason to use the spread like that is to pass the args again to a different function using the spread operator, so I think this is perfectly fine given the perf benefit
from core.
@posva I agree. And I think there needs to be some way to let people know about this, before they run into it, document maybe (in the future)?
from core.
How did you personally run into it and do you have any idea of other ways people will run into it? This will helps us to find the place it fits in the docs. Since most people won't use that syntax naturally nor by following the guide, it needs to be in the right place to be effective
from core.
I'm doing a small experiment, want to log both props and context, but I'm to lazy to write two parameters๐ . Maybe people will write code like this when they debugging.
from core.
I got your point, nice discussion.
from core.
Related Issues (20)
- `defineModel` loses two way binding flow when parent adds event listeneres HOT 2
- CSS nesting inserts attribute selector at every level HOT 1
- can not resolve global component in h function when pass a render function HOT 7
- Unhandled error during execution of render function HOT 1
- Regression of multiselect integer form values (>=3.4.15) HOT 2
- v-modelไฟฎ้ฅฐ็ฌฆๅจๅๅงๅ็ๆถๅไธ็ๆ๏ผๅชๆๅฝv-model็ปๅฎ็ๅผๅ็ๅๅๆถๆ็ๆใ HOT 5
- Issues Regarding TransitionGroup HOT 4
- Vue 3 render function no class reactivity HOT 1
- withDefaults merge object union HOT 1
- Inconsistent production and runtime environments. HOT 3
- Not possible to use Symbol value for checkbox true-value HOT 6
- Not possible to use Symbol values for checkbox v-model values HOT 3
- Change in computed property behavior with Reactive objects in 3.4 HOT 3
- `app.provide` is not type safe
- UModal error when opened HOT 1
- Invalid bidirectional binding of subcomponent ref HOT 2
- Cannot read properties of null (reading 'insertBefore') HOT 2
- Vue compat with Jest: "TypeError: decode_js.EntityDecoder is not a constructor" HOT 2
- MutationObserver in defineCustomElement is disconnected if we move the custom element to another place, then lose attribute observation
- Input with type="number" does not update value after removing leading zeros from v-model binding HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.