Skip to main content
added 8 characters in body
Source Link
sfdcfox
  • 501.7k
  • 21
  • 473
  • 828

The compiler does a lot of "magic" to ensure compatibility and Locker API consistency across all browsers. For example, decorators are experimental, so to provide a consistent experience, it applies a patch to make them work. As a side effect of that example quirk, the only decorators allowed are @api and, @track, and @wire. You cannot write a custom decorator at this point.

At some point, all of this will be supported in native code, thus reducing the footprint of Aura/LWC runtime. However, LWC isn't there yet, as it has to be compatible with existing browsers. I don't know of any documentation that goes out of the way to explain limitations that are this specific. However, there's a pretty easy solution. If you don't find a particular syntax in the documentation, it is probably not allowed, or at least caution is advised.

Here's the documentation describing compatibility. Note that it doesn't have limitations such as the one you've noticed. This is not a permanent situation, but for now, you should presume that the Salesforce documentation perfectly describes what the platform supports, while ES6 describes what the future browser support should look like. After IE 11 Extended Support sunsets at the end of the year 2020, there should be a lot more ES6 compatibility, since they will no longer need to depend on patches/transpiling.

The compiler does a lot of "magic" to ensure compatibility and Locker API consistency across all browsers. For example, decorators are experimental, so to provide a consistent experience, it applies a patch to make them work. As a side effect of that example quirk, the only decorators allowed are @api and @track. You cannot write a custom decorator at this point.

At some point, all of this will be supported in native code, thus reducing the footprint of Aura/LWC runtime. However, LWC isn't there yet, as it has to be compatible with existing browsers. I don't know of any documentation that goes out of the way to explain limitations that are this specific. However, there's a pretty easy solution. If you don't find a particular syntax in the documentation, it is probably not allowed, or at least caution is advised.

Here's the documentation describing compatibility. Note that it doesn't have limitations such as the one you've noticed. This is not a permanent situation, but for now, you should presume that the Salesforce documentation perfectly describes what the platform supports, while ES6 describes what the future browser support should look like. After IE 11 Extended Support sunsets at the end of the year 2020, there should be a lot more ES6 compatibility, since they will no longer need to depend on patches/transpiling.

The compiler does a lot of "magic" to ensure compatibility and Locker API consistency across all browsers. For example, decorators are experimental, so to provide a consistent experience, it applies a patch to make them work. As a side effect of that example quirk, the only decorators allowed are @api, @track, and @wire. You cannot write a custom decorator at this point.

At some point, all of this will be supported in native code, thus reducing the footprint of Aura/LWC runtime. However, LWC isn't there yet, as it has to be compatible with existing browsers. I don't know of any documentation that goes out of the way to explain limitations that are this specific. However, there's a pretty easy solution. If you don't find a particular syntax in the documentation, it is probably not allowed, or at least caution is advised.

Here's the documentation describing compatibility. Note that it doesn't have limitations such as the one you've noticed. This is not a permanent situation, but for now, you should presume that the Salesforce documentation perfectly describes what the platform supports, while ES6 describes what the future browser support should look like. After IE 11 Extended Support sunsets at the end of the year 2020, there should be a lot more ES6 compatibility, since they will no longer need to depend on patches/transpiling.

Source Link
sfdcfox
  • 501.7k
  • 21
  • 473
  • 828

The compiler does a lot of "magic" to ensure compatibility and Locker API consistency across all browsers. For example, decorators are experimental, so to provide a consistent experience, it applies a patch to make them work. As a side effect of that example quirk, the only decorators allowed are @api and @track. You cannot write a custom decorator at this point.

At some point, all of this will be supported in native code, thus reducing the footprint of Aura/LWC runtime. However, LWC isn't there yet, as it has to be compatible with existing browsers. I don't know of any documentation that goes out of the way to explain limitations that are this specific. However, there's a pretty easy solution. If you don't find a particular syntax in the documentation, it is probably not allowed, or at least caution is advised.

Here's the documentation describing compatibility. Note that it doesn't have limitations such as the one you've noticed. This is not a permanent situation, but for now, you should presume that the Salesforce documentation perfectly describes what the platform supports, while ES6 describes what the future browser support should look like. After IE 11 Extended Support sunsets at the end of the year 2020, there should be a lot more ES6 compatibility, since they will no longer need to depend on patches/transpiling.