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(pat-date-picker): Cache the ajax call to retrieve i18n picker translations. #1208

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

thet
Copy link
Member

@thet thet commented Dec 12, 2024

Ref: scrum-2726

This implementation uses good ol' store module from @patternslib/patternslib/src/core/store - it's still handy.
However, we can spare us the supported query because the web storage is just supported in practice by all modern browsers since Firefox 2 etc.

Testing FTW, I found a case where a unsuccessful call to an i18n URL led to an error.

NOTE: in a real environment where multiple instances are
initialized at once on the same page, before the ajax call has
been completed, each instance will do an AJAX call. After that,
when navigating to other pages with other date picker instance
the cached value should be used and no more AJAX calls should be
made.

It would be hard to work around this limitation and I think it's a tradeoff we can live with, right?

@thet thet requested a review from reinhardt December 12, 2024 23:01
@thet
Copy link
Member Author

thet commented Dec 12, 2024

Done in: #1208

@reinhardt reinhardt merged commit 70c08a3 into master Dec 13, 2024
1 check passed
@reinhardt reinhardt deleted the scrum-2726--i18ncache branch December 13, 2024 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants