The Lightning Component modern framework is a User Interface framework to develop dynamic web apps for mobile and desktop devices. As is the case with each release, the latest Winter’21 release is packed with rich features including, the newly added Lightning Component features!
Currently, Winter’21 release is under the pre-release program. On the 11th & 12th of September, Sandboxes will be upgraded, as a result, your organization will get the look and feel of the Winter’21 release.
In case you have not read the entire 531 pages of Salesforce Winter’21 release notes, check out Winter’21 release quick summary written by me.
I combed through the release notes and highlighted the added capabilities to the Lightning Component features. Believe me, it was hard to stop at just five! To kick things off, here is my take on the coolest Lightning Component features from the Winter’21 release.
- Add Custom Buttons to the lightning-input-rich-text Base Component (Beta):- You can now add buttons to perform actions that you define, such as inserting an email template, applying formats, or adding a link to your FAQ. You can even open a popup from a custom button. Define a custom button using two new components together, nested in the lightning-input-rich-text component. Read more about it here.
- Scan a Barcode in a Lightning Web Component (Beta):- Use the BarcodeScanner API to add barcode scanning to your Lightning web components. Scan UPC, QR, and other standard barcode types from Lightning components running on a mobile device. Look up product details, record inventory scans, save contact details from a conference badge—your code, your way!
Using BarcodeScanner in your Lightning web component is straightforward.
- Import BarcodeScanner into your component definition.
- Test to make sure BarcodeScanner is available before you call scanning lifecycle functions.
- Use the scanning lifecycle functions to start and stop scanning.
- Increased Timeout for Client-Side Caching:- When a component is generated on the server from metadata, the page loads from a client-side cache of the indexed database. The client-side cache timeout has increased from 15 minutes to 8 hours, with a refresh interval of 15 minutes. This increased timeout can result in faster page loads for users who bootstrap the application frequently or click links from outside the application to open a new browser window or tab to Lightning Experience.
- Second-Generation Packages Support Lightning Message Channels:- Lightning components use message channels to communicate via the Lightning Message Service. You can now include message channels in second-generation packages.
- Develop Flow Screen Components That Work for Multiple Objects (Generally Available):- Now you can create reusable flow screen components that use the generic sObject and sObject data types. Build one component that works for multiple objects, rather than one for each individual object. For example, you can build a data table component that works with any collection of records, from accounts and contacts to custom objects.
Additional enhancements worth noting!
- Restrict Access to @AuraEnabled Apex Methods for Guest and Portal Users Based on User Profile (Update, Enforced): – This update gives you more control over which guest, portal, or community users can access Apex classes containing @AuraEnabled methods. Add guest user profile access to any @AuraEnabled Apex class used by a community or portal. When this update is activated, a guest, portal, or community user can access an @AuraEnabled Apex method only when the user’s profile allows access to the Apex class. This update is enforced in Winter ’21.
- Enable Secure Static Resources for Lightning Components (Update): – To improve security, this update serves all static resources from the visualforce domain instead of the lightning domain. This change prevents a script included in a static resource from accessing the document in the lightning domain due to the same-origin security policy.
What are your favorite Winter’21 Lightning Components gems? Care to share?
Let me know by Tweeting me at @automationchamp, or find me on LinkedIn.