{"action":"created","issue":{"url":"https://api.github.com/repos/pie-framework/pie-lib/issues/23","repository_url":"https://api.github.com/repos/pie-framework/pie-lib","labels_url":"https://api.github.com/repos/pie-framework/pie-lib/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/pie-framework/pie-lib/issues/23/comments","events_url":"https://api.github.com/repos/pie-framework/pie-lib/issues/23/events","html_url":"https://github.com/pie-framework/pie-lib/issues/23","id":341155367,"node_id":"MDU6SXNzdWUzNDExNTUzNjc=","number":23,"title":"with-drag-context.js - will trigger HTML5Backend error if in 2 different modules","user":{"login":"edeustace","id":101623,"node_id":"MDQ6VXNlcjEwMTYyMw==","avatar_url":"https://avatars2.githubusercontent.com/u/101623?v=4","gravatar_id":"","url":"https://api.github.com/users/edeustace","html_url":"https://github.com/edeustace","followers_url":"https://api.github.com/users/edeustace/followers","following_url":"https://api.github.com/users/edeustace/following{/other_user}","gists_url":"https://api.github.com/users/edeustace/gists{/gist_id}","starred_url":"https://api.github.com/users/edeustace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edeustace/subscriptions","organizations_url":"https://api.github.com/users/edeustace/orgs","repos_url":"https://api.github.com/users/edeustace/repos","events_url":"https://api.github.com/users/edeustace/events{/privacy}","received_events_url":"https://api.github.com/users/edeustace/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-13T20:49:22Z","updated_at":"2018-07-16T14:23:46Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"this module is designed so that there is only ever 1 instance of the html5backend running on a page, it does this by internally storing a singleton inside the module.\r\n\r\nIf you have 2 bundles built by webpack running on the same page, the logic in this module will fail, because they will both create the singleton, which causes react-dnd to check it's own global reference.\r\n\r\nWe'll probably need to check the global and return that instead of creating it. Check how react-dnd store this global ref and return that if needed."},"comment":{"url":"https://api.github.com/repos/pie-framework/pie-lib/issues/comments/405264602","html_url":"https://github.com/pie-framework/pie-lib/issues/23#issuecomment-405264602","issue_url":"https://api.github.com/repos/pie-framework/pie-lib/issues/23","id":405264602,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTI2NDYwMg==","user":{"login":"elodszopos","id":4669986,"node_id":"MDQ6VXNlcjQ2Njk5ODY=","avatar_url":"https://avatars1.githubusercontent.com/u/4669986?v=4","gravatar_id":"","url":"https://api.github.com/users/elodszopos","html_url":"https://github.com/elodszopos","followers_url":"https://api.github.com/users/elodszopos/followers","following_url":"https://api.github.com/users/elodszopos/following{/other_user}","gists_url":"https://api.github.com/users/elodszopos/gists{/gist_id}","starred_url":"https://api.github.com/users/elodszopos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elodszopos/subscriptions","organizations_url":"https://api.github.com/users/elodszopos/orgs","repos_url":"https://api.github.com/users/elodszopos/repos","events_url":"https://api.github.com/users/elodszopos/events{/privacy}","received_events_url":"https://api.github.com/users/elodszopos/received_events","type":"User","site_admin":false},"created_at":"2018-07-16T14:23:46Z","updated_at":"2018-07-16T14:23:46Z","author_association":"CONTRIBUTOR","body":"@edeustace I've looked into this. Unfortunately, they do no store a reference to the singleton itself on the window, they simply set up a boolean flag to indicate if the setup has already happened.\r\n\r\nhttps://github.com/react-dnd/react-dnd/blob/master/packages/react-dnd-html5-backend/src/HTML5Backend.ts#L81\r\n\r\nHowever, for our usage I think as long as we can make sure the setup has taken place, by checking for the boolean on the window, we can be certain that full functionality will be retained even if we do not return anything.\r\n\r\nAll event listeners are set up on the same window object, so technically everything should work for all the separate modules on the same page."}}
{"actor":{"display_login":"elodszopos"}}