Skip to content

Latest commit

 

History

History
15 lines (9 loc) · 2.4 KB

File metadata and controls

15 lines (9 loc) · 2.4 KB

JavaScript

Language features

We have three major language environments in use across our projects:

Babel features

Our goal in using Babel is to allow developers to write "modern JS" without having to dwell on platform specific limitations. Our main constraint is that we expect the transpiled code to work on all environments defined in the Liferay DXP Compatibility Matrix, which in practice means "modern browsers plus IE 11".

In order to avoid churn, we don't make use of experimental transforms, but rather wait until proposals have reached "stage 4" of the TC39 process before enabling them. In rare cases, we may include stage 3 proposals that are exceptionally useful (eg. we enabled babel-plugin-proposal-class-properties in liferay-npm-scripts because it is so broadly relied upon within the React ecosystem). As seen in this TypeScript issue, in practice, stage 3 proposals are unlikely to change but sometimes they do, so caution is warranted.