-
Notifications
You must be signed in to change notification settings - Fork 132
fix(withState): respect getters and setters of non hook properties #2665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🚀 Snapshot Release (
|
| Package | Version | Info |
|---|---|---|
@envelop/core |
5.3.2-alpha-20250915143539-fd5e49440b71c59031c3455714d9baf604d1ae63 |
npm ↗︎ unpkg ↗︎ |
@envelop/parser-cache |
9.0.1-alpha-20250915143539-fd5e49440b71c59031c3455714d9baf604d1ae63 |
npm ↗︎ unpkg ↗︎ |
@envelop/rate-limiter |
8.1.0-alpha-20250915143539-fd5e49440b71c59031c3455714d9baf604d1ae63 |
npm ↗︎ unpkg ↗︎ |
@envelop/response-cache |
8.0.2-alpha-20250915143539-fd5e49440b71c59031c3455714d9baf604d1ae63 |
npm ↗︎ unpkg ↗︎ |
@envelop/validation-cache |
9.0.1-alpha-20250915143539-fd5e49440b71c59031c3455714d9baf604d1ae63 |
npm ↗︎ unpkg ↗︎ |
💻 Website PreviewThe latest changes are available as preview in: https://87091d71.envelop.pages.dev |
ardatan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think failing tests are related?
|
Weird, no I don't see how it could be linked :/ the test doesn't even use |
fce0176 to
fd5e494
Compare
|
@ardatan Test are passing again after a rebase :-) |
The
withStateplugin utility was not respecting plugin properties with getters or setters.In particular, properties with getters were just copied at plugin creating time, leading to potential bugs where the getter doesn't always return the same thing over time.
This PR fixes this by enumerating all properties with
Object.getOwnPropertyDescriptorsand iterating over it instead ofObject.entries. This also allows to keep theenumerable,writableandconfigurableflags from each non-hooks properties.See this PR for a usage of this: graphql-hive/gateway#1360