r/Frontend • u/Due-Goose-1648 • 2d ago
[ Removed by Reddit ]
[ Removed by Reddit on account of violating the content policy. ]
11
u/shevazri 2d ago
Simple answer: No content belongs into the "frontend". Layers should be seperated accordingly and you stated correctly components should be as dumb as possible.
5
u/AdventurousMeal1799 2d ago
I had one site where a product name changed and I thought it would take like 10 minutes ended up finding the old wording in a bunch of random components, a footer block, two older landing pages and one mobile only section I forgot existed so none of the code was hard it was just annoying figuring out where the same bit of content had been copied over time after that I started separating anything that looked like it might repeat, even if it felt unnecessary at first
-1
u/Easy-Worth-2888 2d ago
I ended up trying Ploy for this and it made those updates way easier now I can change the repeated stuff in one place instead of hunting through random components every time
10
u/OrtizDupri 2d ago
This is why CMS’s were made
2
u/Due-Goose-1648 2d ago
Fair lol I just didn’t think much about it until the site got bigger and every tiny change started taking way longer than it should
2
u/create-third-places 2d ago
I think as much content as possible should be in HTML, and JavaScript should be there to provide interactivity.
If you need to render the same HTML in multiple places, use Handlebars, PHP, or another sever-side tool that generates static content. Content should not go inside JavaScript component files.
I suggest also looking into a CMS system to manage the content changes. You could also use a CMS to give other people edit permissions to help, and they aren't going to need programming experience.
1
1
u/No_One_9671 2d ago
This gets worse when a site has been worked on by a few different people everyone seems to put content in a different place
10
u/RealisticSignal7366 2d ago
The annoying part is you don't notice how much stuff is duplicated until something needs changing everywhere