Migrate JavaScript

Move JavaScript code from your client-side controller, helper, and renderer to the single JavaScript file in a Lightning web component.

A client-side controller in an Aura component is a JavaScript object in object-literal notation containing a map of name-value pairs. A JavaScript file in Lightning web components is an ES6 module so you’re using standard JavaScript rather than the proprietary format used in Aura components.

This is not a line-by-line conversion, and it’s a good opportunity to revisit your component’s design.

To share JavaScript code between Lightning web components and Aura components, put the code in an ES6 module. For more information, see Share JavaScript Code Between LWC and Aura.

See Also

Release Preview

This release is in preview. Features described here don't become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can't guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.