fix: refactor update data to avoid lodash issues - #2585
Merged
Conversation
✅ Deploy Preview for jsonforms-examples ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
lucas-koehler
left a comment
Contributor
There was a problem hiding this comment.
Looks pretty good to me already 🚀
I have one minor concern inline. please have a look :)
Improvements on top of the lodash/fp/set replacement: - Store "__proto__" segments as own properties via defineProperty and traverse own properties only, so such keys neither corrupt the container's prototype nor get dropped. Clone containers key-by-key because downleveled object spreads assign instead of define. - Read the updater's old data with resolveData instead of lodash get, so reads use the same literal path semantics as writes. - Fall back to lodash's index heuristic when creating missing containers without schema type information. - Match lodash's isIndex semantics with a strict index regex instead of Number() coercion. - Avoid strict-mode TypeErrors when unsetting non-index array properties (e.g. "length") and return the same reference when there is nothing to unset. - Treat an empty path as addressing the root, and replace non-object root data instead of spreading it. Also documents the path semantics change in MIGRATION.md and adds unit tests for setDataAt/unsetDataAt.
lucas-koehler
requested changes
Jul 23, 2026
lucas-koehler
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the update and advanced edge case handling 🚀
The changes already looks pretty good to me. I only have one question and one needed updated for the migration guide. Please have a look :)
Added heading "Migration to JSON Forms 3.9" and moved "Data update paths treat all segments literally" from "Mifration to JSON Forms 3.8" to "Migration to JSON FOrms 3.9". This resolves the change request comment for `MIGRATION.md` file in PR #2585.
Added strict equality checks (`!== null && !== undefined`) inside `ownPropertyValue`. This resolves comment in PR #2585 regarding use of loose inequality.
…uests Resolve PR #2585 Change Requests
lucas-koehler
approved these changes
Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the lodash/fp/set call in UPDATE_DATA with a dedicated helper. This fixes issues with numeric segments (e.g. "group-key.15") and bracket characters in property names (e.g. "test[0]").
Fixes #2102
Fixes #2397