CatalaLang / catala-dsfr

Web prototype for automated generation of individual explanations from Catala programs
https://code.gouv.fr/demos/catala
Apache License 2.0
1 stars 0 forks source link

feat: add versioned assets + fix HMR #16

Closed EmileRolley closed 8 months ago

EmileRolley commented 9 months ago

Before: Screenshot from 2023-11-15 15-12-58

Now: image

Tasks

denismerigoux commented 9 months ago

Am I correct to understand that now the main landing page is only 700kb and that you only load the 6 MB source code of the housing benefits when needed?

denismerigoux commented 9 months ago

As of now you hardcoded in this git repo the contents of each version of the dependent packages we use. Is there a way with npm/other JS packaging tools to use multiple versions of a single package so that we don't have to hardcode the contents of the versions of the packages?

EmileRolley commented 9 months ago

Am I correct to understand that now the main landing page is only 700kb and that you only load the 6 MB source code of the housing benefits when needed?

Yep :+1:

EmileRolley commented 9 months ago

As of now you hardcoded in this git repo the contents of each version of the dependent packages we use. Is there a way with npm/other JS packaging tools to use multiple versions of a single package so that we don't have to hardcode the contents of the versions of the packages?

I copied past to quickly test the dynamic import but I can look to see if it's possible yes!

EmileRolley commented 9 months ago

It seems possible with aliases but I wonder how far it can be automated :thinking:

bzg commented 9 months ago

Mh.. this looks like an issue where @garronej expertise could be of some help 🤞🏻