Summer ’22 Enhancement for Lightning Web Components

@SalesforceCodex

Gray Frame Corner

Light DOM allows us to open up our components to the page and avoid the shadow DOM limitations.  This makes it much easier to inherit global styles from our page and integrate with third-party libraries.

0218

Introducing light DOM

White Frame Corner
White Frame Corner

No need to use a template while query selector. We can use this.querySelector() instead of this.template.querySelector() as there is no template and no shadow tree.

0218

Query Selector

White Frame Corner
White Frame Corner

We need to enable rendor mode for each LWC. <template lwc:render-mode='light'>    <my-header>        <p>Hello World</p>    </my-header> </template>

0218

Enable Light DOM Mode

White Frame Corner
White Frame Corner

New base core components for Alert, Popup, and Confirm are added. We can easily use like below. LightningAlert.open({    message: 'this is the alert',    variant: 'headerless', }).then((result) => {    console.log('alert result', result); });

0218

New Base components

White Frame Corner
White Frame Corner

In Developer Preview — we can build components in mixed shadow mode. export default class extends LightningElement {    static shadowSupportMode = 'any'; }

0218

Mixed shadow mode

White Frame Corner
White Frame Corner

Thank You

@SalesforceCodex

Gray Frame Corner