I am just getting started with vue.js, and already created most of the very small functionality I need from just the first getting started chapters of the documentation.
Now I want to add some tests to ensure my functionality always works after changes (normally I do TDD but this time I had to learn vue first and decide if i keep using it).
So looking for documentation I basically see that just about every documentation/howto on vue testing is about testing components. I really found none else.
This leads me to the question as stated in the subject:
Is it a necessary practice to use vue components, even for the most simple application, when I have definitely nothing that i want to reuse as a component? Besides the current case of only finding documentation on how to test a componentized vue app, will I run in other problems?
I searched the web and the vue docs(at least there I'd hope for a sentence of explanation if and why I should always use components in the "essentials/Components basics" chapter, but dont find it...), and here, but I couldn't find a clue if and why it might be a generally bad idea not to use components.
Based on the questions I see in comments, it seems necessary to explain why I even ask such a question:
- I don't criticize components in general or say they are a bad idea - I see that basically abstraction and separation of concerns is often helpful, even important in many cases.
- At the same time, for any kind of abstraction, layering, and separation, there is a line below which introducing it brings more overhead in terms of additional files, glue code to put things together, and tools needed to use it (in the case of vue components special editors capable of properly displaying and syntax highlighting .vue files) than advantages.
- The vue documentation itself starts without components, which in my understanding suggests that not all users should use components in any case.
- It seemed to me that I am pretty close to this line, and I was looking for advice and reasons if I should consider my app being above the line so I should introduce components, or I can assume I am below. Answers I thought of would be like "even though you might not benefit a lot from components, and will have to add 3 more files to your 3 files app, doubling the number, it's highly recommend to use them, because nearly all documentation, and most tooling for vue assumes components being used." - or "Just go ahead, introduce components when you think it fits". I got a helpful answer in the meantime that I marked as such.