Skip to content

🔥 feat(states): Updating observable state access; adding profile availability state#166

Merged
Charles Hudson (phobetron) merged 1 commit intomainfrom
NT-2684_more-state-visibility
Mar 5, 2026
Merged

🔥 feat(states): Updating observable state access; adding profile availability state#166
Charles Hudson (phobetron) merged 1 commit intomainfrom
NT-2684_more-state-visibility

Conversation

@phobetron
Copy link
Copy Markdown
Collaborator

@phobetron Charles Hudson (phobetron) commented Mar 5, 2026

  • Refactor shared state internals into a dedicated signals/ module (signals.ts -> signals/).
  • Introduce a richer observable API with current, subscribe, and subscribeOnce.
  • Deep-clone observable snapshots and subscriber payloads to prevent consumer mutations from leaking into internal SDK state.
  • Add derived canPersonalize state (personalizations !== undefined) and expose it via CoreStateful.states and PersonalizationStates.
  • Harden interceptor execution by deep-cloning values before each interceptor step to isolate mutations and protect caller-owned references.
  • Add test coverage for observable clone/one-shot behavior, interceptor clone isolation, and canPersonalize state transitions.
  • Update Core/Web SDK docs for the expanded states API and entry-interaction tracking guidance, including hover behavior and options.
  • Update the pre-push checks to more completely scan pushed commits for changes

[NT-2684]

@phobetron Charles Hudson (phobetron) force-pushed the NT-2684_more-state-visibility branch 2 times, most recently from 09b7e08 to e24de0e Compare March 5, 2026 14:25
…lability state

- Refactor shared state internals into a dedicated `signals/` module (`signals.ts` -> `signals/`).
- Introduce a richer observable API with `current`, `subscribe`, and `subscribeOnce`.
- Deep-clone observable snapshots and subscriber payloads to prevent consumer mutations from leaking into internal SDK state.
- Add derived `canPersonalize` state (`personalizations !== undefined`) and expose it via `CoreStateful.states` and `PersonalizationStates`.
- Harden interceptor execution by deep-cloning values before each interceptor step to isolate mutations and protect caller-owned references.
- Add test coverage for observable clone/one-shot behavior, interceptor clone isolation, and `canPersonalize` state transitions.
- Update Core/Web SDK docs for the expanded `states` API and entry-interaction tracking guidance, including hover behavior and options.
- Update the `pre-push` checks to more completely scan pushed commits for changes

[[NT-2684](https://contentful.atlassian.net/browse/NT-2684)]
@phobetron Charles Hudson (phobetron) force-pushed the NT-2684_more-state-visibility branch from e24de0e to 38789ef Compare March 5, 2026 14:56
@phobetron Charles Hudson (phobetron) merged commit 75c9d4c into main Mar 5, 2026
30 checks passed
@phobetron Charles Hudson (phobetron) deleted the NT-2684_more-state-visibility branch March 5, 2026 15:34
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