Managing third party resources using deps is a good practice in Symfony 2? -


I am using the Charting Library and jQuery Editor for my project. I want to keep them up to date in minimal effort. I've put it in my deps file:

  [highcharts] git = https: //github.com/highslide-software/highcharts.com.git target = Import using highchich [markItUp] git = https: //github.com/markitup/1.x.git target = markItUp   

and then using: < Pre> {% javascripts filter = 'yui_js' output = 'js / app.js' '../app/Resources/public/js/jquery-*.js''//vendor/highcharts/js/ Highcharts Src.js' '../vendor/markItUp/markitup/js/jquery.markitup.src.js'%} & lt; Script src = "{{asset_url}}" & gt; & Lt; / Script & gt; {% Endjavacripts%}

All the work required is OK Is this a good practice? Is there any defect in managing javascript libraries in this way?

Yes, using a deputy to add a library is best practice. However, two things should be done:

  1. If you have source control (GIT, SVN), make sure that it is ignoring library folders. The best practice is not to include external libraries in your source control, and instead run vendors: install when you deploy the libraries to load.
  2. In many cases, you should add a hash or version number to lock the library for a specific version, it can not be applied to your case (because you have said that you always want to be on the latest version ), But Symphony is important for things such as bundles. Otherwise, when you run vendors: If you install, you risk the updating of all unsupported versions (e.g., say When updating a bundle to version of SF2.1, when you are on 2.0).

Comments