Considerations and Limitations

It’s important to remember that the purpose of template expressions is to help you write maintainable code. Keeping presentation-only expressions in the component template is a good way to do this, but not if your expressions are so complex you can’t read them. Use your best judgement for what works for you and your development team, both today, and six weeks after the last time you looked at your markup.

Additionally, while template expressions offer enhanced capabilities, certain limitations exist to maintain performance and security.

Complex template expressions is a pilot or beta service that is subject to the Beta Services Terms at Agreements - Salesforce.com or a written Unified Pilot Agreement if executed by Customer, and applicable terms in the Product Terms Directory. Use of this pilot or beta service is at the Customer's sole discretion.

Do not use complex template expressions in production. Use complex template expressions only for:

  • Development and testing
  • Proof of concept implementations
  • Internal tools and prototypes
  • Learning and experimentation

If you need similar functionality in production, use traditional approaches like getters, computed properties, or component methods until the feature is generally available.

Complex template expressions are supported for components with API version 66.0 and later. Components with API versions before 66.0 in their js-meta.xml file don’t support complex expressions. Expression evaluation falls back to basic property binding. Attempting to use a complex expression on a component with a lower API version will result in compiler errors.

The this keyword isn’t allowed in template expressions.

Only arrow functions are supported, not function declarations.

Arrow functions with block bodies aren’t supported.

Async arrow functions aren’t supported.

Asynchronous operations aren’t supported in template expressions.

Assignment operators aren’t allowed outside of arrow functions.

Update operators (++, --) aren’t allowed outside of arrow functions.

The new operator isn’t supported for creating instances.

The delete operator isn’t supported.

Throw statements aren’t supported in template expressions.

Yield expressions aren’t supported.

The super keyword isn’t supported.

Import statements aren’t supported in template expressions.

The import.meta object isn’t supported.

Class expressions aren’t supported.

Regular expression literals aren’t supported.

BigInt literals aren’t supported.

Comments aren’t allowed inside template expressions.

The comma operator isn’t supported.

Template expressions in attributes must be quoted. Using unquoted template expressions will result in compilation or runtime errors.