|AVAILABLE API VERSIONS|
|Available in API v59.0 and later|
Beginning in Winter '24, LWC supports versioning for custom components. When a component specifies a version, the component then depends on the version of a Salesforce release. Every HTML, CSS, and JS file of a component corresponds to one API version. The API version tells the LWC framework to behave as it did for the Salesforce release corresponding to the API version for that component.
As of Winter '24, all API versions of 58.0 and earlier correspond to 58.0 (Summer '23). If you set the API version to a value lower than 58.0, LWC uses version 58.0 by default.
To apply bug fixes and new functionality that are tied to a later API version, upgrade your component's API version.
A warning in an API version can become an error in the next API version. We recommend that you test each version and upgrade one version at a time.
To upgrade your component API version:
- Publish your component. Fix any warnings in the SFDX console.
- Run your component in a sandbox. Fix any warnings in the browser DevTools console.
- Increment the
*.js-meta.xmlfile for your component to the next version.
- Publish your component again and verify that you no longer see any warnings.
For example, if you specify an
apiVersion value of 58.0, your component continues to behave as it did in API version 58.0 (Summer '23).
Component-level breaking changes apply to custom components for Lightning Experience and Experience Builder sites. To implement these changes in your components, upgrade the
In Winter '24, there aren't any new LWC features that correspond to an
apiVersion value. To see what's changed in LWC in the latest Salesforce release that apply to all
apiVersion values, see the release notes.
Here's how Salesforce releases map to LWC API versions.
|Salesforce Release||LWC API Version|
Consider these guidelines when working with LWC API versioning.
- If you use an
apiVersionthat's earlier than the earliest known LWC API version, LWC uses the earliest known version. For example, if the earliest known version is 58.0 and you provide 57.0, LWC uses 58.0.
- If the latest LWC version is 60.0 and you provide 61.0, then LWC uses 60.0.
- LWC API versioning isn't available for Aura components and LWR.
- LWC API versioning is available only for custom components in Lightning Experience that include the
- Custom components in LWR use the latest LWC API version when not running in Lightning Experience or Experience Cloud.
- Components on the same page or within the same managed package can have different API versions.