Skip to content

Conversation

@ermshiperete
Copy link
Contributor

This change adds a static findStores function to VarStoreSerializer and VariableStoreCookieSerializer as well as to the VariableStoreSerializer interface.

Also add unit tests for VariableStoreCookieSerializer.

Part-of: #13426
Test-bot: skip

This change adds a static `findStores` function to `VarStoreSerializer`
and `VariableStoreCookieSerializer` as well as to the
`VariableStoreSerializer` interface.

Also add unit tests for `VariableStoreCookieSerializer`.

Part-of: #13426
Test-bot: skip
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Jan 15, 2026

User Test Results

Test specification and instructions

User tests are not required

Test Artifacts

  • Android
    • Keyman for Android apk - build : all tests passed (no artifacts on BuildLevel "build")
    • FirstVoices Keyboards for Android apk - build : all tests passed (no artifacts on BuildLevel "build")
    • FirstVoices Keyboards for Android apk (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
    • KeyboardHarness apk - build : all tests passed (no artifacts on BuildLevel "build")
    • Keyman for Android apk (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
    • KMSample1 apk - build : all tests passed (no artifacts on BuildLevel "build")
    • KMSample2 apk - build : all tests passed (no artifacts on BuildLevel "build")
  • Developer
    • Keyman Developer - build : all tests passed (no artifacts on BuildLevel "build")
    • Compiler Regression Tests - build : all tests passed (no artifacts on BuildLevel "build")
    • Keyman Developer (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
    • kmcomp.zip - build : all tests passed (no artifacts on BuildLevel "build")
    • kmcomp.zip (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
  • iOS
    • Keyman for iOS (simulator image) - build : all tests passed (no artifacts on BuildLevel "build")
    • FirstVoices Keyboards for iOS (simulator image) - build : all tests passed (no artifacts on BuildLevel "build")
    • FirstVoices Keyboards for iOS (simulator image) (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
    • Keyman for iOS (simulator image) (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
  • Keyboards
    • Test Keyboards - build : all tests passed (no artifacts on BuildLevel "build")
  • Web
    • KeymanWeb Test Home - build : all tests passed (no artifacts on BuildLevel "build")

@keymanapp-test-bot keymanapp-test-bot bot changed the title feat(web): add findStores functions feat(web): add findStores functions 🎼 Jan 15, 2026
@github-actions github-actions bot added the web/ label Jan 15, 2026
@keymanapp-test-bot keymanapp-test-bot bot added this to the A19S20 milestone Jan 15, 2026
@github-actions github-actions bot added the feat label Jan 15, 2026
@ermshiperete ermshiperete changed the title feat(web): add findStores functions 🎼 feat(web): add findStores functions 🍪 🎼 Jan 15, 2026
Base automatically changed from chore/web/e2e to epic/web-core January 15, 2026 11:53
@keyman-server keyman-server modified the milestones: A19S20, A19S21 Jan 16, 2026
@@ -9,27 +9,51 @@ import { CookieSerializer } from "keyman/engine/dom-utils";
// dynamic property names; they'd have to be known at compile time to facilitate
// strict type checking.
class VarStoreSerializer extends CookieSerializer<VariableStore> {
Copy link
Member

Choose a reason for hiding this comment

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

So ... we have VarStoreSerializer, VariableStoreSerializer, VariableStoreCookieSerializer, and CookieSerializer<VariableStore>. Yuck! Why do we need 4? Can't we do this all with just one? What benefit are we getting with this complexity and confusion?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Follow-up in #15470. It reduces the number of types, although it's still more than one - see PR description.

Comment on lines 9 to 10
// dynamic property names; they'd have to be known at compile time to facilitate
// strict type checking.
Copy link
Member

Choose a reason for hiding this comment

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

This comment (lines 4-10) is an excuse for the implementation, but doesn't help describe the purpose of the class. It's missing background which doesn't help a reader understand (a) what is this 'transformation' for, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I left that comment for now.

@ermshiperete ermshiperete merged commit 2e40439 into epic/web-core Jan 19, 2026
16 of 17 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Keyman Jan 19, 2026
@ermshiperete ermshiperete deleted the feat/web/findStores branch January 19, 2026 12:01
ermshiperete added a commit that referenced this pull request Jan 19, 2026
This addresses code review comments in #15437 and removes some
unnecessary definitions related to variable stores. It keeps the
`VariableStoreSerializer` interface although currently
`VariableStoreCookieSerializer` is the only implementation. Conceptually
IMO it makes sense to use a more abstract interface so that in the future
for example we could easily use a different store for a node
implementation.

Details of this change:
- remove `VariableStoreDictionary` interface and replace with
  `VariableStore` type
- remove `VarStoreSerializer` class and replace with
  ` CookieSerializer<VariableStore>`
- also fix baseline tests to use dynamic time value and set cookies to
  expire in 60s instead of at some arbitrary time which might be in the
  past.

Follow-up-of: #15437
Test-bot: skip
ermshiperete added a commit that referenced this pull request Jan 19, 2026
This addresses code review comments in #15437 and removes some
unnecessary definitions related to variable stores. It keeps the
`VariableStoreSerializer` interface although currently
`VariableStoreCookieSerializer` is the only implementation. Conceptually
IMO it makes sense to use a more abstract interface so that in the future
for example we could easily use a different store for a node
implementation.

Details of this change:
- remove `VariableStoreDictionary` interface and replace with
  `VariableStore` type
- remove `VarStoreSerializer` class and replace with
  ` CookieSerializer<VariableStore>`

Follow-up-of: #15437
Test-bot: skip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants