Is there any documentation yet on how locker service fits in with lightning web components? If yes,
- What are the implications of locker service on lightning web components?
- What are locker service guidelines to work with lightning web components?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
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 lockerservice @ (YourDomain.lightning.force.com/docs/component-library/documentation/lwc/lwc.security_locker_service)
Lets highlight some key points from document
DOM Access Containment
You cannot use document.querySelector() and the syntax to access the shadow DOM will be
Still you will need SecureWindow, SecureDocument , SecureObject (All these were available in aura locker). On top of it you also have new secure elements SecureLightningElement and SecureTemplate.
SecureLightningElement is a base class that every lightning web component extends from .
SecureTemplate is the shadowRoot node .The docs list which APIS are not supported .
Restrict access to Global Variables
Global variables like $Aura,$A, sfdc and sforce are all restricted .
Except for IE11 ,the locker security principles are applied to the lightning web components as well .