Language features and conventions
Language features and conventions#
Babel enables a series of features and syntax that the developer can use in code to develop Volto on. These features are the proposals the TC39 is working on in the different stages of evolution.
babel-razzle-preset which in turns uses
@babel/preset-env which enables
the use of all TC39 proposals currently in TC39's stage 4
Babel preset-env uses
browserlist which gives the ability to micromanage the
transformations needed by the current project depending of the browser support you are
By doing this, enables the bundles to be smaller, as the resultant code does not need to support old browsers (thus, transform your code to ES5 compatible code) as Babel will apply only the required transforms that your target enviroments need. For more information: https://babeljs.io/docs/en/babel-preset-env#browserslist-integration
Volto project generators use this browserlist by default (you can find it in your local
"browserslist": [ ">1%", "last 4 versions", "Firefox ESR", "not ie 11", "not dead" ],
which you can adjust depending on the environments you are targeting in your local
package.json file. You can find more information about how the queries in
works in: https://github.com/browserslist/browserslist#queries
Support to deprecated browsers#
Volto does not support deprecated browsers from its vendor (eg. IE11).
If you still need to support deprecated browsers, you should use
browserslist in your
project to enable the required transforms for the target deprecated environments you
have to support.
However, Volto (or its dependencies) might not be compatible with old browsers anyways, and you might need to provide some other workarounds to make the build work (and the deprecated browser not crash). You can refer to this (outdated) document in order to get some hints on how to do it.