[Dreamforce 2022] Build your apps everywhere with LWC Open Source
With open source, you can benefit from new features being part of LWC but not yet available on the Platform. See how open source can help make powerful, reusable components.
as a public package • What can be done • Let’s build something with Lightning Web Runtime • Demo • Differences between OSS & Platform Dreamforce 2022 - Build your apps everywhere with LWC Open Source - @FabienTaillon - https://texei.com/blog
Some OSS Projects: • Lightning Web Components • Salesforce Extensions for VS Code • Salesforce Lightning Design System • oclif • TransmogrifAI (automated machine learning) • … Not something new, Aura was already open source. Dreamforce 2022 - Build your apps everywhere with LWC Open Source - @FabienTaillon - https://texei.com/blog What’s Open Sourced at Salesforce
packages (npm) for us to use: • Lightning Web Runtime • Lightning Base Components • … What’s available as a public package Dreamforce 2022 - Build your apps everywhere with LWC Open Source - @FabienTaillon - https://texei.com/blog
application locally, hosted wherever you want: • Lightning Web Runtime • Lightning Web Components • Salesforce Lightning Design System • Lightning Base Components What can be done Dreamforce 2022 - Build your apps everywhere with LWC Open Source - @FabienTaillon - https://texei.com/blog
application locally, hosted wherever you want: • Lightning Web Runtime • Lightning Web Components • Salesforce Lightning Design System • Lightning Base Components • Custom @wire api What can be done Dreamforce 2022 - Build your apps everywhere with LWC Open Source - @FabienTaillon - https://texei.com/blog
application locally, hosted wherever you want: • Lightning Web Runtime • Lightning Web Components • Salesforce Lightning Design System • Lightning Base Components • Custom @wire api • Use Lightning Navigation Service, Custom Labels… What can be done Dreamforce 2022 - Build your apps everywhere with LWC Open Source - @FabienTaillon - https://texei.com/blog
application locally, hosted wherever you want: • Lightning Web Runtime • Lightning Web Components • Salesforce Lightning Design System • Lightning Base Components • Custom @wire api • Use Lightning Navigation Service, Custom Labels… • Use OSS first/only features (Light DOM, dynamic component creation) What can be done Dreamforce 2022 - Build your apps everywhere with LWC Open Source - @FabienTaillon - https://texei.com/blog
application locally, hosted wherever you want: • Lightning Web Runtime • Lightning Web Components • Salesforce Lightning Design System • Lightning Base Components • Custom @wire api • Use Lightning Navigation Service, Custom Labels… • Use OSS first/only features (Light DOM, dynamic component creation) • Any tool of your choice (Rollup, webpack, TypeScript…) What can be done Dreamforce 2022 - Build your apps everywhere with LWC Open Source - @FabienTaillon - https://texei.com/blog
• Loads modules/services, like routing • Used by the latest Experience Cloud templates • Configurable via lwr.config.json Easy to start with: npm init lwr https://developer.salesforce.com/docs/platform/lwr/overview Let’s build something with Lightning Web Runtime Dreamforce 2022 - Build your apps everywhere with LWC Open Source - @FabienTaillon - https://texei.com/blog
stylesheet link https://developer.salesforce.com/docs/platform/lwr/guide/lwr-slds.html Add SLDS Dreamforce 2022 - Build your apps everywhere with LWC Open Source - @FabienTaillon - https://texei.com/blog
2022 - Build your apps everywhere with LWC Open Source - @FabienTaillon - https://texei.com/blog Use same import as on the Platform! https://salesforce.stackexchange.com/questions/385223/whats-the-expected-label-file-forma t-for-lightning-web-runtime-oss In lwr.config.json:
just add files to src/assets folder ◦ Platform: import myResource from '@salesforce/resourceUrl/resourceReference'; • Custom @wire → not allowed on Platform, replaced by Apex Class ◦ OSS: import { getUser } from 'c/usersWireApi'; ◦ Platform: import getUser from '@salesforce/apex/Namespace.UsersWireApi.getUser'; Differences between OSS & Platform Dreamforce 2022 - Build your apps everywhere with LWC Open Source - @FabienTaillon - https://texei.com/blog
like (eg. “namedPage”) ◦ Platform: page names expected by Salesforce (ex: comm__namedPage) • Metadata file (myComponent.js-meta.xml) ◦ OSS: No need, but won’t complain if the file is there ◦ Platform: expected by Salesforce Differences between OSS & Platform Dreamforce 2022 - Build your apps everywhere with LWC Open Source - @FabienTaillon - https://texei.com/blog
is OK • Was designed to work everywhere from the start ◦ Use Salesforce expected page names • Won’t fit for all components Components suited to use everywhere Dreamforce 2022 - Build your apps everywhere with LWC Open Source - @FabienTaillon - https://texei.com/blog