4

For the past few weeks i've been playing with ember octane which in my opinion is awesome. I've tried a few ember plugins in order to test which plugins are working currently with ember octane, some of them require jQuery to work. So my question is: if it's possible to add jQuery to ember octane to make those plugins work?

Nik Ntaf
  • 43
  • 1
  • 5

2 Answers2

4

Haven't tested it myself but it should be as easy as:

  • Add @ember/jquery package as a dev dependency.
  • Enable optional feature jquery-integration.

An optional feature could be enabled using Ember CLI by running ember feature:enable some-feature or by editing config/optional-features.json manually. You could find more information about optional features in Guides.

jelhan
  • 6,149
  • 1
  • 19
  • 35
  • Hey @jelhan your solution is working also searched for jquery-integration on config folder and set that to true and is working perfectly. Thank you for your answer – Nik Ntaf Jun 13 '19 at 12:50
0

One thing to note from @jelhan's answer is that adding @ember/jquery will only allow you to use JQuery internally. It will not allow Ember addons to use JQuery. For the ember addons to use JQuery, you would need to request that the addon add @ember/jquery to their dependencies.

mattbeiswenger
  • 383
  • 3
  • 11
  • Thank you for your response @mbeiswenger. How do we add jquery as addon dependency? – Nik Ntaf Jun 21 '19 at 07:08
  • To add it to your project, follow @jelhan's instructions. To add it to an ember addon that is causing deprecation errors, you will have to make a pull request for that particular project. – mattbeiswenger Jun 24 '19 at 19:53