NgRX SignalStore not water tight fails references intermittent #4909
Replies: 17 comments
-
UI ![]() |
Beta Was this translation helpful? Give feedback.
-
UI ![]() |
Beta Was this translation helpful? Give feedback.
-
Please create a reproduction via Stackblitz or GitHub repo, with a clear description and full focus on the potential bug:
|
Beta Was this translation helpful? Give feedback.
-
thanks friend for paying attention if I get time, I doubt that I will have to hack up alot and produce an entire re-write smaller codebase is large and too dependent and my stance rightfully feels we shouldn't be here Im trying to develop code and continue to be prevented by what angular team keeps putting out the only framework thats helped my productivity is the Nx team my code posted shows several event origins and I have tried everyone in different variations whittled down to ONE ORIGIN event and each one has same results sorry to be such a critique but I have watched corps go chapt-11 centering on functional programming, closures, props and objects and tinkering at such micro-model level Signals have introduced the wild wild west with javascript and the entryway obviously react javascript sympathizers who love the whiz bang short-cuts and that mindset is extremely difficult to break If these teams pushing signals are spent chasing after these wild west references they need to be honest because the field is asking for SignalStore and the hype is obvious. Cute but dangerous. if I get time/energy I will post a stackblitz ciao |
Beta Was this translation helpful? Give feedback.
-
expected behavior UI Should render clean 1st pass |
Beta Was this translation helpful? Give feedback.
-
Let me know if you want access to repo I can grant you access to my repo |
Beta Was this translation helpful? Give feedback.
-
@nhhockeyplayer, don't get me wrong, criticism is always good, but if we should help you, you need to help us well. Currently, it’s challenging for me to grasp the underlying issue. Could you try to summarize the main problem in just a few sentences? A minimal repro would also help a lot — StackBlitz is ideal, as Marko mentioned. Bonus points if you can use that! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
there is a warning in the console about overriding users i thought your team might be able to spot why that is the signalstore is clean by definition nothing unusual standing out |
Beta Was this translation helpful? Give feedback.
-
Thanks, I understand the problem better now. First about the warning: It tells you that you must have two properties or methods with the same name "users". When the effects run and show you the correct data, but you don't see it in your table, can you
|
Beta Was this translation helpful? Give feedback.
-
Thank you Rainer, effect is running on same signal, the signal gets injected in appComponent, tabComponent, 2 router resolvers and of course effects and reducer And the signal gets run each time I see it passing thru in debugger on each consumers construction (what effect on references would this have... is SignalStore meant to be used as singleton (by reference)? or by value? ... if by reference this could be a shared reference pool issue across all consumers because its behaving like by value with references everywhere across all consumers.) I will also checkout ngrx-toolkit thanks if anything breaks on your side of the fence from my postings please advise
|
Beta Was this translation helpful? Give feedback.
-
changes.markForChange() is isolated to an imageWidget self contained effect is running on same signal as injected by appComponent so I dont know whats causing this corruption spanning components its definitely signalstore or signals beneath the corruption is there and I know it when i see it (no more breaks at breakpoints) my gut feel is it has to do with the references being tracked by the signal eFrastructure there is a break in integrity across the store being initialized across 3 components and then the redux attempting to run thru after something is being clobbered and leading the runtime astray I feel firm this is a bug I wish I had better to report about signals just seen too much trouble with javascript and functional closure (including promise) programming I will try to get a repo together by end of week and zip it up, Nx lends very well to this need so it will be in the form of an Nx monorepo but trimmed down
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the update. It would be great if you can provide us with an example. Very curious about it. |
Beta Was this translation helpful? Give feedback.
-
Hello Rainer, since you've taken interest I attempted to create a trimmed down repo and no chance. Too much work. repo there is a clean.zsh script at root of the Nx monorepo
my repo does the rest automagically that will automatically launch and seed on boot what the clean script does is just that, resets node_modules, cleans cache, installs pkgs, runs build and launches server which auto-seeds itself launch clean script (does it all) then goto another terminal and launch the nx app or you can try to set it up manually
let me know if you like this KEN |
Beta Was this translation helpful? Give feedback.
-
Thanks, I will open an issue in your repo then, where we can discuss issues I might encounter during the setup. |
Beta Was this translation helpful? Give feedback.
-
its turnkey
I just migrated to very latest NX and checkout my nx report for more revisions
|
Beta Was this translation helpful? Give feedback.
-
I'm going to convert this issue to a Q&A discussion. If there is a bug with SignalStore, it should be doable to create a minimal reproduction via Stackblitz playground or a public GitHub repo without Nx, Mongo, or any other third-party tool. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Which @ngrx/* package(s) are the source of the bug?
signals
Minimal reproduction of the bug/regression with instructions
all I can do is post my signalstore
my codebase is large NX Monorepo
the pundit/czar should be fully capable of seeing any anomalies
PROBLEM
I originally had a simple NgRX "IUserPojo[]" state that ran beautiful, populated my UI with the collection flawlessly with ActionGroup, effects, reducers and selectors
I converted my NgRX IUsers state to SignlState
Now its intermittent
UI gets populated 'whenever' sometimes not all the time moreso... no crashes or stack traces
Oh and btw, this new standard of wide open javascript model (micromodel which nx, rxjs, d3.js implement is pure javascript under the hood) imposes its entire implementation model onto the user for its use-model when its only been successfully demonstrated for frameworks as noted. You dont pollute and corrupt the implementation use-model with what rightfully should be obfuscated. Some say javascript is so dangerous its unfit for any commercial development. Well when you see a company commit to objects, properties, closures, functional programming (fast whiz bang one-liners and crafty javascript constructs) it grows into a malignancy. Ask a react programmer who is wrestling with critical mass and unablt to find that lost clobbered reference hidden beneath the chaos.
This wide open micromodel obviously new standard being pushed by angular signal has even impacted the IDE, refactoring has been observed breaking during attempted refactoring.
Im a critic of javascript and react they are pure javascript and do not follow object oriented principles and I have deemed javascript commercially unfit tinkering with regard to objects, properties, functional programming functions/closures anonymous functions and short-cuts therein.
impact widespread
NOW... being able to debug flawlessly prior...with SignalStore, the IDE is unable to even debug or hit s breakpoint IDE algorithms are no way even ABLE to articulate source code maps to even hit a breakpoint its so intermittent and unpredictable. We are sent back to the printf school of debugging now.
for my signalstore... I would love to be proven wrong but signalstore as driven by the google architects is driving the field now and I state its a wrong path, they may as well have chosen lisp or prolog and javascript habits are too hard to break... solution.... react developers have hijacked angular and ngrx and re-architecting the entire thing to fit their brains.
SignalStore smashes NgRX elite reliable commercially successful redux pattern to smithereens and to pure javascript
only thing salvagable are actions/events and effects
signals are suppose to be the glue resolving references and observables and its opened the door to intermittent chaos
one day this pattern will be obfuscated in its entirety from the so many times its been re-architected starting with PROPS (a react named construct). Nice job on generics but Im not impressed sorry (the signalers at google)
FACTS
SignalStore requires us to PATCH this (another level of indirection by way of references and point of failure) into the SignalStore (which is the glue and supposedly updates the reference of the signal)
nothing works
Im coding normally with observables, one SignalStore and simple crud table that works flawlessly
So here is my code
CODE CONSUMPTIONS
app.component.ts
tab-component.ts
ACTIONS
EFFECTS
Reducer
SignalStore
Expected behavior
signalstore should be able to cleanly articulate references and observables
it dont
SignalStore has chosen to manage payloads, references with javascript objects properties and functional programming functions/closures
very unpredictable
very intermittent
recipe for production failures****
Versions of NgRx, Angular, Node, affected browser(s) and operating system(s)
NX Report complete - copy this into the issue template
Node : 22.16.0
OS : darwin-arm64
Native Target : aarch64-macos
yarn : 1.22.22
nx (global) : 21.3.0
nx : 21.3.0
@nx/js : 21.3.0
@nx/jest : 21.3.0
@nx/eslint : 21.3.0
@nx/workspace : 21.3.0
@nx/angular : 21.3.0
@nx/cypress : 21.3.0
@nx/devkit : 21.3.0
@nx/esbuild : 21.3.0
@nx/eslint-plugin : 21.3.0
@nx/express : 21.3.0
@nx/module-federation : 21.3.0
@nx/nest : 21.3.0
@nx/node : 21.3.0
@nx/playwright : 21.3.0
@nx/rspack : 21.3.0
@nx/web : 21.3.0
@nx/webpack : 21.3.0
typescript : 5.8.3
Registered Plugins:
@nx/eslint/plugin
@nx/webpack/plugin
@nx/cypress/plugin
@nx/eslint/plugin
@nx/webpack/plugin
@nxext/capacitor/plugin
@nx/rspack/plugin
Community plugins:
@compodoc/compodoc : 1.1.26
@fortawesome/angular-fontawesome : 1.0.0
@ionic/angular : 8.6.5
@ngrx/component : 19.2.1
@ngrx/component-store : 19.2.1
@ngrx/effects : 19.2.1
@ngrx/entity : 19.2.1
@ngrx/operators : 19.2.1
@ngrx/router-store : 19.2.1
@ngrx/schematics : 19.2.1
@ngrx/signals : 19.2.1
@ngrx/store : 19.2.1
@ngrx/store-devtools : 19.2.1
@nxext/capacitor : 20.2.0
@nxext/ionic-angular : 20.1.0
angular-eslint : 20.0.0
apollo-angular : 8.0.2
Cache Usage: 93.26 MB / 372.19 GB
Other information
Here is my code
I would be willing to submit a PR to fix this issue
Beta Was this translation helpful? Give feedback.
All reactions