Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To actually answer your three questions, here are some things I've done or at least recommend:</p> <p><strong>Best practices for a smooth upgrade rollout</strong></p> <ul> <li>Have tests. These can be unit tests for your JS and/or browser tests. These should cover at least the most typical and the most complex functionality used within your projects. If you don't have tests, write them. If you don't want to write tests, reconsider. If you <em>reeeeally</em> don't want to write tests, at least have a list of use cases that someone will be able to execute manually.</li> <li>Make sure all your tests pass before the upgrade.</li> <li>Read the release notes for <strong>every</strong> (major) version between the version you use now and the most current release. See also the <a href="http://api.jquery.com/category/removed/" rel="nofollow" title="Removed jQuery functions">Removed</a> and <a href="http://api.jquery.com/category/deprecated/" rel="nofollow" title="Deprecated jQuery functions">Deprecated</a> categories in the API docs. If any of your code uses jQuery UI, also look at those release notes and <a href="http://jqueryui.com/upgrade-guide/" rel="nofollow" title="jQuery UI Upgrade Guides">upgrade guides</a> for the interstitial versions. As you do this, make note of the things you would likely have to change in your codebase (possibly making heavy use of <code>grep</code>).</li> <li>If your project's current jQuery version is >= 1.6.4, also consider using the <a href="https://github.com/jquery/jquery-migrate/#readme" rel="nofollow" title="jQuery Migration plugin">jQuery Migrate plugin</a> to further assess the work required.</li> <li>Decide on which version you want to be your upgrade target, based on the work required to get there, whether your project is using any third-party libraries that require a certain version of jQuery, other factors only you can consider, etc.</li> <li>Meet with your team to go over the list of changes to be done to your codebase, and divide/assign the work accordingly. Maybe write some scripts or other tools to help out. If you have one, your team's coding style guide / best practices document may also need to be updated. Decide on one-shot (recommended) or rolling update releases, if that's possible+desirable. Come up with a suitable release strategy. (I recommend against releasing the upgrade as part of another unrelated large change to your codebase, so it's easy to roll back if you need to.)</li> <li>Throughout the upgrade process, continually run your tests. When testing manually, always monitor the browser console for new errors. Write new tests that cover unexpected errors.</li> <li>When all tests pass, decide on how you want to roll out--if it's a site, all users at once or a percentage at a time, etc. For a library or other project, maybe you'd release a beta/bleeding edge version that you can let your more ambitious users test out for you in the wild.</li> <li>Document everything you just did so it will be easier for the next time.</li> <li>[Profit.]</li> </ul> <p><strong>How to integrate upgrades into normal workflow</strong></p> <ul> <li>Again, tests. Make sure you have them. Make sure they're good, maintained, and cover a large portion of your codebase and use cases. A continuous integration setup to automate the running of these tests is highly recommended.</li> <li>Consider getting your team to create and agree to follow a coding style guide or standard. This will make it easier in the future to search for deprecated function calls or constructs, since everyone would be following similar coding patterns. Tools such as scripts, commit hooks, static analysis utils, etc. to enforce good or sniff out bad coding style might be useful (depending on the team).</li> <li>Investigate and maybe decide to use a package manager like <a href="https://github.com/twitter/bower" rel="nofollow" title="NPM">NPM</a> or <a href="https://github.com/twitter/bower" rel="nofollow" title="Twitter&#39;s bower">bower</a> to manage jQuery versions and other third party libraries you might use that depend on it. (You'll still need to maintain your own JS code and go through pretty much the same process as above.)</li> <li>Again, once you're past version 1.6.4, make sure the Migrate plugin is part of your upgrade workflow.</li> <li>Assess what worked from the initial big upgrade process, what didn't work, and extract a general process from this that works best with your current workflow. Whether or not you plan to upgrade every time there's a new version, there will be ongoing maintenance tasks and habits that you'd probably want to keep as general development best practices.</li> </ul> <p><strong>Reasonable upgrade schedule</strong></p> <p>That's essentially a CBA/risk management question. You'll have to weigh some things:</p> <ul> <li>There <em>should</em> be no breaking API changes within the same major version, so you should generally be able to upgrade to the most recent minor version with minimal effort, no refactoring required. This assumes you have and maintain good tests, which you can run on your projects before you decide that all is well enough for a rollout.</li> <li>Major version upgrades require more research, more refactoring, and more testing. After the research step, you should do a cost-benefit analysis of upgrading.</li> <li>This might not matter much, but if any of your projects is a website that has many users, what would be the cost of making all of your users have to download essentially all of the changed JS files on your site the next time they visit it (instead of sticking with the older versions that are probably still cached in their browsers)?</li> <li>The decision to upgrade should always be a subjective one. Minor or major, you'll still have to justify each time whether any upgrade would be worth it. <em>Always read the release notes.</em> Does it fix a <a href="https://www.cvedetails.com/vulnerability-list/vendor_id-6538/Jquery.html" rel="nofollow" title="Public jQuery Security Vulnerabilities">security vulnerability</a> or a bug related to issues that you or your users are currently experiencing? Would it significantly improve the performance of your project (be sure to have benchmarks to verify it later)? Does it greatly simplify a coding pattern you've been using, allowing your code to be written more cleanly and easily? Is there a third-party library you want to use that is dependent on this newer version? Are there third-party libraries you already use which are dependent upon the <em>older</em> version? (If so, are these libraries likely to be upgraded anytime soon to work with the newer version?) Are you that confident in your tests and QA process that an upgrade will take a reasonable amount of development resources and cause no major regressions? Were you thinking of eventually switching out jQuery with something else anyway? Etc.</li> </ul> <p>Of course this is just my advice. There are a few recurring themes in it, and I hope they are clear. In any case, I hope someone finds this helpful!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload