I have tested minified a server action API. For Wappler UI its the same, nothing changes, all options works correctly without issues, but of course only the readability in the .json file will be affected if someone manipulate the file directly.
The minified proccess can save between 50-60% of the API size, thats from 100kb to 40-50kb final size in a real scenario with large API structure.
I don’t know if maybe someone edit manually the .json API file, but maybe an options for users that need to manipulate directly the file can be solve it by change the way in how Wappler read the API files, instead of "/app/api"
change it to .wappler
folder just like do with “config
” and “module
” folders for each target, and provide an engine that on every save it generate a minified version in "/app/api"
folder.
So, my suggestions are:
- In Wappler UI the API’s should be readed from
".wappler/targets/myTarget/app/api"
this are unminified versions. - On every save it generate a minified version in the root folder of project just like now works
"/app/api"
.
At the end the total folder of API could be reduce in size in about a 50%, if your API folder has 5mb, with the minified versions can be reduced to 2.5mb, I think thats a lot. And for slow network connections like mobile could be good with this.
Please, correct me if I’m wrong if the size of the API matter or not?
Thanks.