• 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to DRY when building back and front-ends?

#3
Having multiple instances of jquery or jqueryui or bootstrap is a terrible idea if they are indeed the same files. Spreading them around is a bad idea too. Your back end and front end can easily access the same file stored in an assets folder. Even if they are different, they should all be in one place at the very least. At some point in the future you will want to upgrade them to a newer version, far easier to upgrade one file, rather than several copies kept all over the place.

Code:
/assets
    /jquery
         /jquery2.x
         /jqueryui.admin
         /jqueryui.front
         /versions.txt
    /bootstrap
    /fontawesome
    /fonts
    /...
   
In a text file called versions.txt in the jquery folder I like to keep a note of the versions that each filename represents. I usually have a .txt file like this in each folder just to keep a note of the version and date installed. For the UI's I like to keep a note of what I included.

Recently however I decided to go against what I normally do and install jquery and bootstrap and fontawesome using their CDN's and to be honest it is fast, reliable, and not a problem at all. I was very impressed actually. So jquery, bootstrap, google fonts and fontawesome are all provided from a few lines of JS in the footer. If it ever becomes an issue I can always download and change that but for now it is working a treat. I am surprised I never trusted it in the past. Highly recommend you try it.    

Paul.
Reply


Messages In This Thread
RE: How to DRY when building back and front-ends? - by PaulD - 03-31-2017, 11:05 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.