Components often seem to work with external libraries until the Locker Service is enabled. What libraries work with locker service enabled and where can I go to find out?
1 Answer
Important: Libraries that do not support strict mode will not work with LockerService enabled.
Salesforce is testing libraries to determine which ones currently will work with Locker Service. The ones they know of have been published in a Salesforce Developer Blog Post titled LockerService and Lightning Container Component: Securely Using Third-Party Libraries in Lightning Components.
Here's a summary of the ones listed at present:
|-- Libraries Known to work ---|
|----- with Locker Service ------|
-------------------------------------------
| Library |--------------| Library |
| Name |---------------| Version |
-------------------------------------------
| React |-----------------| 0.14.8 |
| ChartJS |----------------| 2.1.4 |
| D3 |---------------------| 4.4.0 |
| RxJS |-| Latest as of 12/5/16 |
| Leaflet |-----| 0.7.7 and 1.0.2 |
| Numeral.js |-----------| 2.1.4 |
| Underscore.js |--------| 1.8.3 |
| FullCalendar |---------| 3.1.0 |
| Gauge.js |--------------| 1.2.1 |
| jQuery |-----| 2.2.2 and 2.2.4 |
| jQuery UI |-----------| 1.11.4 |
| DataTables |--------| 1.10.12 |
| Select2 |---------------| 4.0.3 |
-----------------------------------
Important: Do not try to mix different versions of libraries in your page code. Do not use libraries to do things that can be done natively using the LDS. This is especially true for jQuery. See examples in the referenced document. Learn to use the LDS instead.
-
2
-
@SE_User If you're certain it uses strict mode, I'll edit and add it a 2nd list of user verified libraries that members can refer to. Commented Feb 28, 2017 at 14:09
-
I'm using jQuery 3.0.0, DataTables 1.10.12, and Highcharts 5.0.7. I've only used Highcharts in a test chart and haven't done a production chart in it yet, but I've noticed no errors thus far in my testing. Regarding DataTables, everything seems to work fine (including using it's AJAX feature), except one thing - I cannot get the "Show xxx items" dropdown to populate with values (default or custom list of values). The dropdown itself appears but the values are all blank. It's not a critical requirement so I just left it off the DOM definition, but it is a quirk I noticed. Commented Feb 28, 2017 at 17:48
-
@Florissant53 Can't help but wonder if that issue isn't related to the version of jQuery you used not being supported by LockerService. Commented Feb 28, 2017 at 18:55
-
1@kresho It originally came from the blog post. Others have updated or added to the list since then. Commented Jul 23, 2018 at 14:12