REMINDER
[Feature Request] -> Babel, Transpiling, Minification of Javascript Source Code
-
Hello team!
I have a 'wish list' for PageBuilder and the implementation of JavaScript:
Settings for Babel transpiling. Similar to https://babeljs.io/repl, you could select:
- Your target output JS version
- JS minification / uglification / obfuscation and other file size reduction measures
PageBuilder would then transpile your code (defined in the Javascript Source Code Elements), based on the settings, when saving/publishing.
There is currently no good workflow for using Babel (you have to copy / paste the code which is tedious and time consuming... and you have to keep a local / working copy of the source code... bref it's awful), and there are NO good options for minification.
You don't have to reinvent the wheel... just implementing the existing Babel project with some options for configuring the settings and 'using' it on the PageBuilder Source Code containers on save/publish would be enough.
One option for implementation would be to imitate the /dev/ -> /preprod/ -> /prod/ model you have on the CloudBackend.
/dev/ would be the PageBuilder files, and you could choose which version of the page to publish similarly to CloudBackend's API publishing feature. This would bring consistency to the 'feature architecture' of the site on front and back.
Another option would be that you keep the existing /preview/ and / file structure, but:
PageBuilder would rely on a 'master copy' of the .html file. (Stored in a different folder... similar to /dev/ of option 1. When saving, the file is 'published' to /preview/, using the settings for transpilation/minification/etc. Existing Publishing logic stays the same.