22 votes
Accepted

Which external Javascript libraries work with Lightning Locker Service?

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 ...
user avatar
  • 40.5k
21 votes
Accepted

Is there a version of moment.js that works with the current Locker Service?

Just played around with the latest version of Moment.js , 2.18.1 and seems to play nicely with locker . Summer 17 whitelisted InstanceOf operator in locker API and that seems to have made Moment.js ...
user avatar
18 votes
Accepted

Avoid Proxy objects in debug statements for a Lightning component

This will get it out of proxy and back into nice, readable format. console.log(JSON.parse(JSON.stringify(myObject))); Used it so much I made a snippet of it (vscode, sublime, maybe others) "xlog": {...
user avatar
16 votes

Avoid Proxy objects in debug statements for a Lightning component

Here is how I generally work in chrome when i see a proxy object, Use the chrome "store as global variable" on the proxy object as shown in the below screenshot Then I just use the Javascript object....
user avatar
15 votes
Accepted

component.get(v.body) not working as expected

@Praveen, yes, this is totally normal. Here is what is happening: When we say that the body attribute is defined on all components we mean that it's defined on the base <aura:component/> from ...
user avatar
  • 2,440
15 votes
Accepted

Lightning component scripts loading issues since Spring 17 update

There is an issue with static resources in Spring'17 that is activelit being worked on. The issue is being tracked in R&D by W-3615844 if you want to reference this in any communication with ...
user avatar
  • 9,984
15 votes
Accepted

Scheduler Javascript Library / Component that works in Salesforce Lightning with LockerService

Standard Agenda View Using FullCalendar javascript component. You need to add these static resources: jQuery 3.3.1 Moment JS 2.22.0 FullCalendar 3.9.0 FullCalendar Scheduler 1.9.4 Lightning ...
user avatar
  • 8,380
13 votes

Locker Service document.cookie support

Support for document.cookie being writable (scoped to your own namespace, similar to how localStorage and sessionStorage work in Locker) is at the top of our queue and (Safe Harbor :p) is planned to ...
user avatar
  • 3,813
11 votes

event.target.value not working after enabling lockerservice

You guys must know that if you are using lightning component for eg. <lightning:button label="Submit" value="xyz" onclick="{! c.handleClick }" /> You can't access it's value attribute using ...
user avatar
  • 898
11 votes

API v40 slows down Apex generated data in Lightning Components

Ok, this was interesting. I was able to optimize a little... then a lot. First optimization: I used a forEach loop. This took the time from about 700ms to 7-14ms. Eg onButtonClick: function(...
user avatar
11 votes
Accepted

$A.util.isEmpty() returns true on non-empty proxies

The root cause of this issue is $A.util.isEmpty() not being able to handle the Proxy wrapping the DOMElement. We might fix it at the LockerService layer by unwrapping the proxy around the DOMElement ...
user avatar
9 votes
Accepted

<ltng:require /> not firing afterScriptsLoaded with Locker Service enabled

The cases where we have seen this have all tracked back to the code being loaded failing to compile or execute because it either violates Locker (actually this has been rare) or it encounters classes, ...
user avatar
  • 9,984
9 votes
Accepted

Moment JS format returns function string in Lightning Spring 17

We are already working on this one - its a bit tricky to explain the cause but it has to do with one of the remaining changes required in Lightning to fully support the Content Security Policy ...
user avatar
  • 9,984
9 votes
Accepted

LockerService and WebSocket

WebSocket will be exposed in Summer '17 and you can instantiate a WebSocket instance like in your example.
user avatar
  • 3,813
9 votes

Does LockerService in Lightning allow to use ES6 Proxy?

@wesaw Your question touches various subjects, an I will try to answer best: Lightning components were not designed for ES6, but we don't prevent the use of ES6 features or post ES6 features. As of ...
user avatar
  • 2,440
9 votes
Accepted

Locker service and lightning web components

If you have access to the spring19 pre release org you can explore the documents on the "lightning web components security via locker service" in developer guide. The docs are available for ...
user avatar
9 votes

Modern JavaScript Frameworks (Angular Js, React JS ) within LWC

The short answer is Yes, you can use React and probably most other javascript frameworks inside of LWC. A very simply example of this would look something like this: import { LightningElement } from '...
user avatar
  • 9,607
8 votes
Accepted

DOM manipulation using External libraries in lightning component

Those restrictions were never correctly stated and I have been working with the App Exchange review team and our technical writers to get this corrected. That "requirement" was only meant for DOM ...
user avatar
  • 9,984
8 votes
Accepted

Window access on secure DOM (LockerService)

We've identified the issue within LockerService and it's in our queue to fix. Please open a case with support and tell them to link to our internal work item W-3198557.
user avatar
  • 3,813
8 votes
Accepted

Security Review: Illegal DOM Access in Lightning Component

You are calling a loop with setInterval. This loop will continue to run because it is attached to the window, but the lifecycle of your component is not the life cycle of the window. E.g. if your ...
user avatar
8 votes

Locker Service: How to get the event target?

I believe the issue here is at the intersection of aura:iteration and Locker resulting in a sort of custody battle over ownership of the resulting DOM. Opened bug W-3458193 to track this.
user avatar
  • 9,984
8 votes
Accepted

Locker-Service: Is documentation about the white-listed subset of supported Javascript-features available?

You can view it here:- Locker Service API Viewer Secure Document Secure Element Secure Window
user avatar
  • 2,235
8 votes

Lightning components and locker service

Aura (Lightning's underlying engine) runs in two modes: system-mode and user-mode (or, "trusted" and "untrusted"). Trusted code is written by salesforce.com and boots up before any components are ...
user avatar
  • 440k
8 votes
Accepted

jQueryUi input[inputIndex].hasOwnProperty is not a function

I can confirm this is reproducible. The root cause of the error is jQueryUI executing window.hasOwnProperty("document"). You can see this by opening up chrome debugger and breaking on all exceptions. ...
user avatar
8 votes
Accepted

Is it possible to mass-save many lightning:recordEditForms with only ONE button?

You can submit a lightning:recordEditForm programmatically. You can do so by retrieving the component via it's aura:id and calling the submit method. e.g. component.find('editForm').submit() Here ...
user avatar
7 votes
Accepted

Chart.js works no more with Locker Service Enabled Org

Please open a case on this to get things tracked and post the case ID here so I can follow up on it. We have not tested Chart.js yet and this is most likely an issue in Locker's secure virtual DOM ...
user avatar
  • 9,984
7 votes

event.target.value not working after enabling lockerservice

Remember that locker service uses a component capability model, and unless you "own" the component where the event was triggered, you will not be able to access its internal, including its value ...
user avatar
7 votes
Accepted

Issue with lightning locker service and jQuery static resource

Please see my answer/comments here Unable to use SVG in Lightning Components with LockerService activated for related info. During the prerelease phase of Summer'16 we are actively dialing in what is ...
user avatar
  • 9,984
7 votes
Accepted

Unable to get textarea value with LockerService

The value property of textarea has just been whitelisted and should be available next week.
user avatar
  • 2,440
7 votes

How can i access the div property scrollTop with locker-service Active?

The security review process for AppExchange should not be stopping you from manipulating DOM elements that you own in a controller method - that was a misunderstanding that we have supposedly ...
user avatar
  • 9,984

Only top scored, non community-wiki answers of a minimum length are eligible