Newer Version Available

This content describes an older version of this product. View Latest

Locker Service in Communities

Locker Service is a powerful security architecture for Lightning components that enhances security by isolating Lightning components in their own namespace. Locker Service promotes best practices to improve the supportability of your code by allowing access only to supported APIs and eliminating access to non-published framework internals.

Locker Service is enabled for all Lightning components set to API version 40.0 and later. API version 40.0 corresponds to Summer ’17, when Locker Service was enabled for all orgs. Locker Service isn’t enabled for components with API version 39.0 and earlier.

You can disable Locker Service for a component by setting the component’s API version 39.0 or earlier. However, for consistency and ease of debugging, we recommend that you set the same API version for all components in your app, when possible.

For information about working with Locker Service when developing Lightning components, see “What is Locker Service?” in the Lightning Component Developer Guide.

For information on preparing your Lightning components code for Locker Service enablement, see “Salesforce Lightning CLI (Deprecated).”