PotLock/bos-app-alem

[ENHANCE] Além - `Local Modules`: Try to automate this functionality

Closed this issue · 1 comments

Currently, for a file to be considered a module it is necessary to move it into the modules folder. This happens because depending on the files, the final package may be larger instead of smaller.

Some options to be tested again:

  1. Check if the file is stateless or a simple .ts or .js file;
  2. Check if these files support Widgets within them;
  3. If items 1 and 2 are compatible, the compiler should interpret such files as local modules automatically.

Some points from previous tests:

  1. When similar logic to the above was tested, the final package was much larger. Most likely because there are small separate files that were created like this because of the limitation of Além in its first alpha versions;
  2. When retaking the tests, you must gather as many files as possible.

Done.

Result: It was possible to implement an auto-set module type but, in the end, the app performance was negatively affected. This is happening because the modules need to get access to the props from where they are being used and this is a slow VM process.

This has proven (at least for now) that the best way to use modules is to pick up specific files like simple .ts / .js files and stateless components.