Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusting import map #1722

Merged
merged 14 commits into from Nov 10, 2021
Merged

Adjusting import map #1722

merged 14 commits into from Nov 10, 2021

Conversation

Angamanga
Copy link
Collaborator

This pull request makes the following changes:

  • Hashing the names of the js-files in production-builds.
  • Using keys from import-map to lazy-load modules in legacy-app
  • Generating importmap for production-file-names when building the app

Testing checklist:

  • [ ]

  • I certify that I ran my checklist

Fixes ushahidi/platform# .

Ping @ushahidi/platform

@Angamanga
Copy link
Collaborator Author

@tuxpiper Ready for review!

@Angamanga
Copy link
Collaborator Author

@tuxpiper I somehow messed up something when building it looks like, I'll let you know when I have figured it out...

tuxpiper
tuxpiper previously approved these changes Oct 25, 2021
Copy link
Member

@tuxpiper tuxpiper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Note to self: need to work on the routine that copies the files to the CDN, so that it assigns /importmap.json non-caching HTTP headers.

tuxpiper
tuxpiper previously approved these changes Oct 25, 2021
Copy link
Member

@tuxpiper tuxpiper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking even better now :) thinking to apply these headers to the different files:

  - include: [ index.html, config.js, config.json, manifest.json, importmap.json ]
    cache_control: "public, max-age=0, s-maxage=0, must-revalidate"
  - include: [ locales/* ]
    cache_control: "public, max-age=60, s-maxage=60, stale-while-revalidate=86400"
  - exclude: [ index.html, config.js, config.json, manifest.json, importmap.json, locales/* ]
    cache_control: "public, max-age=31536000, s-maxage=31536000"

I've added special rules for the locales files, which will allow them to be used for one full day, while still checking for changes in the background.

Copy link
Member

@tuxpiper tuxpiper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, still lgtm 👍

@Angamanga
Copy link
Collaborator Author

@Obadha2 Ready for QA. Another smoke test is needed, and could you also include some tests with the change of language? I did some changes there. 🙏

@AmTryingMyBest AmTryingMyBest merged commit 05a65c4 into develop Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants