Question : if writing a simple web page (some prints and color settings) to be sent by a server to navigators, what will be the size of data sent to a navigator to display the page, including the aoz js libs ?
Haaa! Welcome Jean Mimi! :) very happy to see you here...
the compiled code can be seen in the 'html' directory of the application after compilation. So, all that will have to be downloaded when the application starts. For the moment it seems like a lot, this is quite big, yet still reasonable compared to other engines, and loads quite fast...
In the plan:
- make a kind of 'Javascript linker': only the necessary basis code always like screens, context, basic sound etc, and for each instruction, only the necessary code. It will reduce the size a lot
- an 'obfuscate' option, that will put ALL Javascript into a single file, with code compressed and unreadable. I even think it is possible to have an option that will put EVERYTHING into ONE gigantic index.html file. Actually that would be quite cool and simplify a lot.
So basically, when done, if you just do a PRINT in your app, the result will be under 50K of code. So loading will be instant.
Le principe, c’est de ne pas coller tes imports en début de fichier, mais dans des fonctions qui permettent de récupérer les imports uniquement lorsque tu en as besoin. La conséquence est que les fichiers js sont téléchargés à la demande.
Comme c’est un truc assez récent, il faut utiliser Babel et WebPack et ça se mixe avec des Promise (await et autre).
Je te prépare un petit exemple dans le WE si ça t ’intéresse. Je m’en suis servis sur des projets de plusieurs Mo pour faire du téléchargemenr progressif avec ReactJS.
Haaa! Welcome Jean Mimi! :) very happy to see you here... the compiled code can be seen in the 'html' directory of the application after compilation. So, all that will have to be downloaded when the application starts. For the moment it seems like a lot, this is quite big, yet still reasonable compared to other engines, and loads quite fast... In the plan: - make a kind of 'Javascript linker': only the necessary basis code always like screens, context, basic sound etc, and for each instruction, only the necessary code. It will reduce the size a lot - an 'obfuscate' option, that will put ALL Javascript into a single file, with code compressed and unreadable. I even think it is possible to have an option that will put EVERYTHING into ONE gigantic index.html file. Actually that would be quite cool and simplify a lot. So basically, when done, if you just do a PRINT in your app, the result will be under 50K of code. So loading will be instant.
Thanks François. 50k is ok, first load will be fast enough :) very nice
You should have a look to dynamic import in ES 2020…this works very good for large JS projects.
Chalu Dada :)
Bonjour David! Super de te voir ici! :) C'est quoi le "dynamic import", j'ai jete un coup d'oeil, et je ne comprends pas trop...
Le principe, c’est de ne pas coller tes imports en début de fichier, mais dans des fonctions qui permettent de récupérer les imports uniquement lorsque tu en as besoin. La conséquence est que les fichiers js sont téléchargés à la demande.
Comme c’est un truc assez récent, il faut utiliser Babel et WebPack et ça se mixe avec des Promise (await et autre).
Je te prépare un petit exemple dans le WE si ça t ’intéresse. Je m’en suis servis sur des projets de plusieurs Mo pour faire du téléchargemenr progressif avec ReactJS.