Skip to content

Conversation

TomStrepsil
Copy link
Contributor

@TomStrepsil TomStrepsil commented Jul 24, 2025

Issue

resolves #50

Details

  • Added a FeaturesStoreFactory interface, mandating that all features stores are created with a named toggleType
    • for the nodeRequestScopedFeaturesStoreFactory this is used to key the features store against a a runtime-wide global symbol to ensure it can be shared in cross-realm runtimes (e.g. NextJS). Hence, there can only be a single features store per named toggleType, for this store type. See express-http-context for similar.
    • this supplants the name property the reactContextFeaturesStoreFactory, required previously to provide a nice displayName for the react context provider. Its also used to form part of the id of the backing script for the ssrBackedReactContextFeaturesStoreFactory

Scout Rule

  • Fix JSDoc output for interfaces
  • Fixed descriptions in test files to better match name of factories
  • Rename nodeRequestScopedStoreFactory to nodeRequestScopedFeaturesStoreFactory, for consistency
  • Improve valtio examples in the README.md

Upgrade guide

This change will represent breaking changes in consumers of the features package.

Any use of stores now require a toggleType property, replacing the name that may have come before. It should represent the type of toggle, e.g. "experiments".

Any name import of nodeRequestScopedStoreFactory should now import nodeRequestScopedFeaturesStoreFactory

CheckList

  • PR starts with [ISSUE_ID].
  • Has been tested (where required) before merge to main.

TomStrepsil and others added 14 commits December 24, 2024 17:31
* rename to proper module namespace

* update docs links

* update versions

* web toggle point in readme title

* fixup changelog from revised 0.x range

* 2.0.0 -> 0.5.0 in oss version scheme

* fix broken link syntax in CHANGELOG

* consistent quoting

* more version history issues

* fixup module name in jsdoc

* add web
remove sdkInstanceProvider

* remove SDKInstanceProvider

* fixup jsdoc dedupe

* tweak

* clarity re: ssr package

* casing etc
* update workflows

* version

* typo

* update chromium linux snaps

* versions for serve update

* package.json repository field

* update root package.lock

* bugs & directories/doc fields

* fix changelog

---------

Co-authored-by: Tom Pereira <tom.pereira@johnlewis.co.uk>
Co-authored-by: Tom Pereira <tom.pereira@johnlewis.co.uk>
@TomStrepsil TomStrepsil requested a review from a team as a code owner July 24, 2025 09:03
@TomStrepsil TomStrepsil changed the title [50] ensure realm-scoped node request scoped features store factory [50] ensure realm-scoped value in the nodeRequestScopedFeaturesStoreFactory export of the features package Jul 24, 2025
rename of nodeRequestScopedFeaturesStoreFactory
@TomStrepsil TomStrepsil changed the title [50] ensure realm-scoped value in the nodeRequestScopedFeaturesStoreFactory export of the features package [50] ensure multi-realm-scoped value in the nodeRequestScopedFeaturesStoreFactory export of the features package Sep 16, 2025
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.

Ensure nodeRequestScopedFeaturesStoreFactory can create stores shared within a NextJS / multi-realm runtime
1 participant