Closed shadow-light closed 2 years ago
Do the names make debugging easier via console etc?
Not via console but with DevTools. Giving component a name allows you to clearly distinguish it in components tree.
Please also notice, that in order to achieve this you would need not only name a class, but also pass "name" property with class name string to Component's (or Options's for Vue 3) params list.
Thanks, yea I noticed that a bit later. I ended up making a Vite plugin that automatically sets the class name based on the file name which is working well and shows up in dev tools too.
Thanks for clarifying
For a long while I've been exporting my classes without names, e.g.
But Vite plugins currently don't take this into account and it causes build failure as they are expecting classes to have a name.
Just wanted to check if there is any value in giving classes a name and whether I should update them all to do so, or whether the plugins should be corrected to support this. Do the names make debugging easier via console etc? Is there any other value to them?