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

feat: disable caching for dynamic locale messages #2355

Merged

Conversation

BobbieGoede
Copy link
Collaborator

πŸ”— Linked issue

#2185

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This changes the messages caching behaviour, only message file keys are used to store and retrieve cached messages. If a message loader is dynamic (ie. a function) then its key and messages are not used for caching.

As described in #2185 (comment) we want to disable caching by default for js and ts files, this PR is a step into that direction but does not offer control over caching yet.

It may be preferred to delay this until I have made a solution that provides control over the caching via a cache property.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link
Collaborator

@kazupon kazupon left a comment

Choose a reason for hiding this comment

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

Good job!
Thanks!
Your PR is a great for improving next step of lazy-loading caching.

we want to disable caching by default for js and ts files, this PR is a step into that direction but does not offer control over caching yet.

I hope that you will put the docs about it.
https://v8.i18n.nuxtjs.org/guide/lazy-load-translations

Near the future it may not be necessary with cache property, but we need to understand for caching of js / ts resources.

@nuxt-studio
Copy link

nuxt-studio bot commented Aug 31, 2023

βœ… Live Preview ready!

Name Edit Preview Latest Commit
i18n Edit on Studio β†—οΈŽ View Live Preview ba93582

@BobbieGoede BobbieGoede force-pushed the feat/disable-cache-dynamic-locale-loader branch from ef61a66 to ba93582 Compare August 31, 2023 07:34
@BobbieGoede
Copy link
Collaborator Author

I have added a warning about the caching behaviour! Will add a section about cache when adding support for the cache property.

@kazupon kazupon merged commit 3a62121 into nuxt-modules:next Aug 31, 2023
4 checks passed
DarthGigi pushed a commit to DarthGigi/i18n that referenced this pull request Apr 16, 2024
* feat: disable caching for dynamic locale messages

* docs: add warning about current cache behaviour
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants