Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
"Let's mix all these concerns and when anyone points it out we'll just show them our bootcamp certificate and say 'money printer go brrrr'"
- JSX fans using vue
C0D46239849dSeparation of concerns > spaghetti mess
I don't get the mindset behind JS devs anymore.
2000's: no one gives a shit!!
2010's: don't mix your HTML / css / ha
2020's: mix it all, mix it all into little itty bitty pieces!!!!
2030's: the world ended before we got here anyway!
TestInProd4237849dI mean, this is highly dependent on how complex each component becomes. Probably to start, I would keep everything together and only start separating out once it begins to be harder to maintain, this would allow simple components to not get overkilled by being relocated to abstractville while allowing more complex components to take advantage of that abstraction.
lamka02sk486149dI always use .vue components, but I also always write CSS into separate file. JS + HTML makes a lot of sense to write them into a single file, just try to make every component as small as possible. If you feel like it is growing big and some part of it can be extracted, do it.
Generally I try to keep the css as simple and minimal as possible. If the map link is the only element in the entire app that has an icon for a button I prefer to bundle it into the MapButton or IconButton component.
I'll follow whatever is already used.
CptFox174749dI like the single file approach for html and he because they're so tied together anyway that they belong together imho.
For CSS, I like the scoping feature, since it makes it easy to style things quickly without worrying too much about possible collisions.
But then again, I'm not a web dev, so I can't speak for proper big projects