-
-
Notifications
You must be signed in to change notification settings - Fork 850
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
Draft type no longer handles nested readonly objects with mixed property value types correctly #1013
Closed
3 tasks done
Labels
Comments
Methuselah96
changed the title
Draft type no longer handles deeply nested readonly object with mixed property type correctly
Draft type no longer handles deeply nested readonly object with mixed property value types correctly
Jan 16, 2023
Methuselah96
changed the title
Draft type no longer handles deeply nested readonly object with mixed property value types correctly
Draft type no longer handles nested readonly objects with mixed property value types correctly
Jan 16, 2023
This was referenced Jan 16, 2023
Hi, |
🎉 This issue has been resolved in version 9.0.19 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug Report
The fix in #990 does not seem to properly fix #839 and also breaks other scenarios. It should probably be reverted.
That PR "fixes" the issue of recursive types by bailing out of the recursion if the property's value type does not extend
object
. This "works" in the case ofJsonObject
becauseJsonObject
's property's value type is a union of objects and primitives, and so it doesn't recurse on the object's properties because the property's value type does not extend theobject
type.This is problematic because it won't remove the
readonly
modifier from nested objects if they have mixed property value types (both in the case of theJsonObject
type and in other cases).Link to repro
Playground Link
To Reproduce
See above.
Observed behavior
There is a TypeScript error.
Expected behavior
There should be no TypeScript error.
Environment
We only accept bug reports against the latest Immer version.
setUseProxies(true)
setUseProxies(false)
(ES5 only)The text was updated successfully, but these errors were encountered: