react.tsx instantiates a single Emitter at module scope, which means all <FlagsmithProvider> trees in a process share the same event bus.
On long-lived Node hosts (Fluid Compute, serverful SSR) this is a cross-request coupling hazard setups it causes unrelated providers to notify each other's hooks (safe today thanks to value comparisons).
Objective
Move the emitter to a useRef in FlagsmithProvider and pass it via context alongside flagsmith; hooks read it from context.
Surfaced by #390
react.tsxinstantiates a single Emitter at module scope, which means all<FlagsmithProvider>trees in a process share the same event bus.On long-lived Node hosts (Fluid Compute, serverful SSR) this is a cross-request coupling hazard setups it causes unrelated providers to notify each other's hooks (safe today thanks to value comparisons).
Objective
Move the emitter to a
useRefinFlagsmithProviderand pass it via context alongside flagsmith; hooks read it from context.Surfaced by #390