{"action":"created","issue":{"url":"https://api.github.com/repos/erikras/redux-form/issues/1716","repository_url":"https://api.github.com/repos/erikras/redux-form","labels_url":"https://api.github.com/repos/erikras/redux-form/issues/1716/labels{/name}","comments_url":"https://api.github.com/repos/erikras/redux-form/issues/1716/comments","events_url":"https://api.github.com/repos/erikras/redux-form/issues/1716/events","html_url":"https://github.com/erikras/redux-form/pull/1716","id":175396466,"number":1716,"title":"Support for ImmutableJS setIn array paths","user":{"login":"Reanmachine","id":126049,"avatar_url":"https://avatars.githubusercontent.com/u/126049?v=3","gravatar_id":"","url":"https://api.github.com/users/Reanmachine","html_url":"https://github.com/Reanmachine","followers_url":"https://api.github.com/users/Reanmachine/followers","following_url":"https://api.github.com/users/Reanmachine/following{/other_user}","gists_url":"https://api.github.com/users/Reanmachine/gists{/gist_id}","starred_url":"https://api.github.com/users/Reanmachine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Reanmachine/subscriptions","organizations_url":"https://api.github.com/users/Reanmachine/orgs","repos_url":"https://api.github.com/users/Reanmachine/repos","events_url":"https://api.github.com/users/Reanmachine/events{/privacy}","received_events_url":"https://api.github.com/users/Reanmachine/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-07T02:10:37Z","updated_at":"2016-09-07T02:16:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/erikras/redux-form/pulls/1716","html_url":"https://github.com/erikras/redux-form/pull/1716","diff_url":"https://github.com/erikras/redux-form/pull/1716.diff","patch_url":"https://github.com/erikras/redux-form/pull/1716.patch"},"body":"## Problem\r\n\r\nImmutableJS's `setIn` (and thereby `updateIn` / `deleteIn` / etc...) do not seem architected to work with a mixture of `Map` and `List` objects. The call assumes that an \"unset\" value can only be one thing, and only has one resolution path for when that value is empty. (Namely, add it as an empty map) [See Immutable-js Source](https://github.com/facebook/immutable-js/blob/master/src/Map.js#L802)\r\n\r\nThis leads to the issue found in #1574 where we get the infamous error:\r\n\r\n    Uncaught TypeError: list.splice is not a function\r\n\r\nWhen using immutable-js with `FieldArray`. The focus / blur events are calling `setIn` on `fields.fieldName[0].touched` etc... which causes the `fieldName` part of the tree to be instantiated as `Map` instead of a `List`.\r\n\r\n## Solution\r\n\r\nWe need to pre-seed a mixed type path like `fields.thing[0].visisted` with empty `List` objects at each array breakout point. This allows immutable to simply update the existing `List` with a call to `set()` instead of trying to instantiate it as a `Map`\r\n\r\nI have broken the `structure/immutable`'s `setIn` method out [into it's own file](https://github.com/Reanmachine/redux-form/blob/reanmachine/immutable-array-setIn/src/structure/immutable/setIn.js) to allow us to take some liberties with it.\r\n\r\n## Extra\r\n\r\nAlong with this PR I've included regression tests for the `setIn` behaviors I fixed as well as some tests for some of the expected vanilla `setIn` behavior the library depends on.\r\n"},"comment":{"url":"https://api.github.com/repos/erikras/redux-form/issues/comments/245155019","html_url":"https://github.com/erikras/redux-form/pull/1716#issuecomment-245155019","issue_url":"https://api.github.com/repos/erikras/redux-form/issues/1716","id":245155019,"user":{"login":"codecov-io","id":8655789,"avatar_url":"https://avatars.githubusercontent.com/u/8655789?v=3","gravatar_id":"","url":"https://api.github.com/users/codecov-io","html_url":"https://github.com/codecov-io","followers_url":"https://api.github.com/users/codecov-io/followers","following_url":"https://api.github.com/users/codecov-io/following{/other_user}","gists_url":"https://api.github.com/users/codecov-io/gists{/gist_id}","starred_url":"https://api.github.com/users/codecov-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codecov-io/subscriptions","organizations_url":"https://api.github.com/users/codecov-io/orgs","repos_url":"https://api.github.com/users/codecov-io/repos","events_url":"https://api.github.com/users/codecov-io/events{/privacy}","received_events_url":"https://api.github.com/users/codecov-io/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T02:16:20Z","updated_at":"2016-09-07T02:16:20Z","body":"## [Current coverage](https://codecov.io/gh/erikras/redux-form/pull/1716?src=pr) is 100% (diff: 100%)\n> Merging [#1716](https://codecov.io/gh/erikras/redux-form/pull/1716?src=pr) into [master](https://codecov.io/gh/erikras/redux-form/branch/master?src=pr) will not change coverage\n\n\n```diff\n@@           master   #1716   diff @@\n=====================================\n  Files          52      53     +1   \n  Lines        1115    1134    +19   \n  Methods         0       0          \n  Messages        0       0          \n  Branches        0       0          \n=====================================\n+ Hits         1115    1134    +19   \n  Misses          0       0          \n  Partials        0       0          \n```\n\n> Powered by [Codecov](https://codecov.io?src=pr). Last update [9186bd3...5df2acd](https://codecov.io/gh/erikras/redux-form/compare/9186bd3b33458d595368a3f0379bea5258443888...5df2acd64b9e27cca7665575a74e564db6462ced?src=pr)"}}
{"actor":{"display_login":"codecov-io"}}