{"action":"created","issue":{"url":"https://api.github.com/repos/cyclejs-community/cyclic-router/issues/95","repository_url":"https://api.github.com/repos/cyclejs-community/cyclic-router","labels_url":"https://api.github.com/repos/cyclejs-community/cyclic-router/issues/95/labels{/name}","comments_url":"https://api.github.com/repos/cyclejs-community/cyclic-router/issues/95/comments","events_url":"https://api.github.com/repos/cyclejs-community/cyclic-router/issues/95/events","html_url":"https://github.com/cyclejs-community/cyclic-router/issues/95","id":169042932,"number":95,"title":"Component runs twice, isolated child components lose scope/namespace","user":{"login":"wyqydsyq","id":621277,"avatar_url":"https://avatars.githubusercontent.com/u/621277?v=3","gravatar_id":"","url":"https://api.github.com/users/wyqydsyq","html_url":"https://github.com/wyqydsyq","followers_url":"https://api.github.com/users/wyqydsyq/followers","following_url":"https://api.github.com/users/wyqydsyq/following{/other_user}","gists_url":"https://api.github.com/users/wyqydsyq/gists{/gist_id}","starred_url":"https://api.github.com/users/wyqydsyq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wyqydsyq/subscriptions","organizations_url":"https://api.github.com/users/wyqydsyq/orgs","repos_url":"https://api.github.com/users/wyqydsyq/repos","events_url":"https://api.github.com/users/wyqydsyq/events{/privacy}","received_events_url":"https://api.github.com/users/wyqydsyq/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cyclejs-community/cyclic-router/labels/Status:%20Help%20Wanted","name":"Status: Help Wanted","color":"2e7d32"},{"url":"https://api.github.com/repos/cyclejs-community/cyclic-router/labels/Type:%20Bug","name":"Type: Bug","color":"ff0000"},{"url":"https://api.github.com/repos/cyclejs-community/cyclic-router/labels/Weight:%203%20-%20Should","name":"Weight: 3 - Should","color":"777777"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-08-03T04:02:21Z","updated_at":"2016-08-09T01:09:13Z","closed_at":null,"body":"I have an app with a bunch of nested components and have found that when I use cyclic-router, the component that's being loaded (`Welcome`) gets called twice, causing isolated child components with implicit scopes (e.g. `export default sources => isolate(UserProfile)(sources)`) lose track of their scope because it seems the scopes are recalculated when the component is reran.\r\n\r\nIf you `git clone` https://github.com/wyqydsyq/hapi-cycle, run `npm install && npm run launch` and then visit [http://localhost:1337/](http://localhost:1337/) you can see the UI in this case works fine, but if you then swap the part of https://github.com/wyqydsyq/hapi-cycle/blob/master/src/ui/app.js that returns just the component with the commented out lines to make it use cyclic-router instead of calling the component directly, subcomponents will no longer emit/recieve events from/to themselves.\r\n\r\nUsing explicit scopes seems to remedy this, as each isolated child component would be using the same scope string in between calling the main component, but that's more of a band-aid fix than a solution.\r\n\r\nSo the working/not working cases for me are:\r\n- ✅ Router with explicit isolation scope on child components\r\n- ✅ No router (calling component directly) with implied isolation scope on child components\r\n- ❎ Router with implied isolation scope on child components"},"comment":{"url":"https://api.github.com/repos/cyclejs-community/cyclic-router/issues/comments/238424788","html_url":"https://github.com/cyclejs-community/cyclic-router/issues/95#issuecomment-238424788","issue_url":"https://api.github.com/repos/cyclejs-community/cyclic-router/issues/95","id":238424788,"user":{"login":"wyqydsyq","id":621277,"avatar_url":"https://avatars.githubusercontent.com/u/621277?v=3","gravatar_id":"","url":"https://api.github.com/users/wyqydsyq","html_url":"https://github.com/wyqydsyq","followers_url":"https://api.github.com/users/wyqydsyq/followers","following_url":"https://api.github.com/users/wyqydsyq/following{/other_user}","gists_url":"https://api.github.com/users/wyqydsyq/gists{/gist_id}","starred_url":"https://api.github.com/users/wyqydsyq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wyqydsyq/subscriptions","organizations_url":"https://api.github.com/users/wyqydsyq/orgs","repos_url":"https://api.github.com/users/wyqydsyq/repos","events_url":"https://api.github.com/users/wyqydsyq/events{/privacy}","received_events_url":"https://api.github.com/users/wyqydsyq/received_events","type":"User","site_admin":false},"created_at":"2016-08-09T01:09:13Z","updated_at":"2016-08-09T01:09:13Z","body":"One thing I just noticed is that it doesn't seem to be just re-calling the routed component once, it calls the component once per each sink I'm mapping over from the router, so for example when I added a `Router` sink to my `main()` (previously I was just reading from the Router sources) that maps over the Router sink of the routed component, the debug message started firing 3 times instead of 2."}}
{"actor":{"display_login":"wyqydsyq"}}