ANDI
ANDI copied to clipboard
It would be nice if andi.js was smaller
I think it would be better for the code if one were able to split up the different modules in the code of andi.js (Like AndiOverlay, Utility, ...) so that it would be easier to understand the code and try to fix it.
100% true, and definitely something I've wanted. I couldn't find an easy way to make the js compile together at runtime. Do you have a suggestion on how to do this?
One suggestion I found was that you could include each of the files you want to use as script tags.
That's a lot of trips to the server. Concerned it would reduce load speed.
Here is an example repository about JavaScript modules: https://github.com/mdn/js-examples/tree/master/module-examples
I have mostly finished the work that is needed for my branch of code that is about putting the andi objects code into different files and exporting them to where they are needed to run the program.
I only have 1 error that keeps coming up when I use the branch. It says for the modules (fandi.js, gandi.js, ...) that "import declarations may only appear at the top level of a module". NOTE: This error does not cause the code to fail, or cause any issues. It just shows up in the console.
One thing that I had to do was to change the init_module functions so that they started with the first letter of the modules (cinit_module for candi.js, finit_module for fandi.js, ...) because I had to export init_module to andi.js and eventually andiModule.js for it to work because importing something with the same name multiple times from different files does not work with JavaScript.
@JohnCotterSSA, I used the code in this repository: https://github.com/mdn/js-examples as a way to learn about exporting code into other files using JavaScript.
If you are worried about load speed, you could check out some things to improve the speed of the JavaScript code