App using Ember 1.6 and Ember Data 1.0.0-beta needs to be updated to use jQuery 3.X

There is a legacy application at my company built on Ember.js 1.6 Ember Data 1.0.0-beta.8.2a68c63a Handlebars 1.3.0 jQuery 2.1.1

Obviously this application should have been updated with newer versions of Ember.js, Ember Data, Handlebars, and jQuery over time. At this point our InfoSec team is requiring that we update jQuery from 2.1.1 to 3.X due to security issues in jQuery 2.X. I updated the application to use jQuery 3.5.1 and received the following error Assertion Failed: Ember Views require jQuery between 1.7 and 2.1

I know that in Ember 3.X the inner dependency on jQuery was removed.

I have reviewed the deprecations in Ember from 1.6 until the latest version 3.16.6 At this point my company won’t allow us to rewrite this application so I am trying to prepare the tasks required to migrate to Ember 3.X.

Does anyone have any background in upgrading from 1.X to 3.X and gotchas to consider? Any information you are willing to share is appreciated.

Thanks Nathan

A thing you can try for short-term mitigation: you can tell Ember to ignore that version check and then just test to see if your app works OK with jQuery 3. If you do this before the app boots, I think it will disable the version check:

window.ENV = { 'FORCE_JQUERY':  true }

I have no idea if this will work, but Ember doesn’t directly use that much of jQuery’s API surface area, so it might.

As for upgrading, here’s how I would do it:

  1. Upgrade to 1.13 (the final 1.0-series release). It adds a lot of deprecation messages. You can add the ember-cli-deprecation-workflow addon to manage the volume.
  2. Work to eliminate the deprecation messages. This is the hardest step in the whole plan, because after 2.0 the release process got a lot stronger and we didn’t repeat the mistake of a deprecation tsunami.
  3. Once your app can run without deprecation warnings in 1.13, it should run in 2.0. And it should probably work the same in 2.4. That was the first LTS release.
  4. Upgrade from LTS release to LTS release. They are all listed at the bottom of this page, clearing deprecations as you go. The rationale here is that even though there aren’t supposed to be any breaking changes until you get to 3.0, when there are changes to private APIs that are known to be used by popular addons, we try to ensure there’s a warning message in at least one LTS release before removing the private API.

General tips for each upgrade:

  • use ember-cli-update to help keep the blueprint-generated code up to date.
  • it’s often easier to upgrade addons before upgrading ember itself, because addons are pretty good at backward compatibility, and that lets you avoid doing all the upgrades simultaneously (which makes it harder to figure out what is really causing breakage).
2 Likes