{"action":"created","issue":{"url":"https://api.github.com/repos/jdiaz5513/capnp-ts/issues/113","repository_url":"https://api.github.com/repos/jdiaz5513/capnp-ts","labels_url":"https://api.github.com/repos/jdiaz5513/capnp-ts/issues/113/labels{/name}","comments_url":"https://api.github.com/repos/jdiaz5513/capnp-ts/issues/113/comments","events_url":"https://api.github.com/repos/jdiaz5513/capnp-ts/issues/113/events","html_url":"https://github.com/jdiaz5513/capnp-ts/issues/113","id":392864902,"node_id":"MDU6SXNzdWUzOTI4NjQ5MDI=","number":113,"title":"As implemented, module-scoped constants may not work properly","user":{"login":"popham","id":1271170,"node_id":"MDQ6VXNlcjEyNzExNzA=","avatar_url":"https://avatars1.githubusercontent.com/u/1271170?v=4","gravatar_id":"","url":"https://api.github.com/users/popham","html_url":"https://github.com/popham","followers_url":"https://api.github.com/users/popham/followers","following_url":"https://api.github.com/users/popham/following{/other_user}","gists_url":"https://api.github.com/users/popham/gists{/gist_id}","starred_url":"https://api.github.com/users/popham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/popham/subscriptions","organizations_url":"https://api.github.com/users/popham/orgs","repos_url":"https://api.github.com/users/popham/repos","events_url":"https://api.github.com/users/popham/events{/privacy}","received_events_url":"https://api.github.com/users/popham/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-20T02:53:13Z","updated_at":"2018-12-20T04:01:10Z","closed_at":null,"author_association":"NONE","body":"I noticed that your schema's constants get translated to naked values, e.g. [capnpc-ts/test/integration/test.capnp.ts#L2110-L2145](https://github.com/jdiaz5513/capnp-ts/blob/524b6bde7d81037de586e2905d1d40955bbe22b0/packages/capnpc-ts/test/integration/test.capnp.ts#L2110-L2145). Unfortunately, ES6 and Node's module resolution don't guarantee that imports are available at module scope. When you go to wrap an imported struct around some data for a module-scoped constant, you may discover that the imported struct is not yet available. Translating `someConstant` to `getSomeConstant()` generalizes to module scope without any problems, but I'm curious if you've got some other workaround."},"comment":{"url":"https://api.github.com/repos/jdiaz5513/capnp-ts/issues/comments/448857614","html_url":"https://github.com/jdiaz5513/capnp-ts/issues/113#issuecomment-448857614","issue_url":"https://api.github.com/repos/jdiaz5513/capnp-ts/issues/113","id":448857614,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODg1NzYxNA==","user":{"login":"jdiaz5513","id":2752359,"node_id":"MDQ6VXNlcjI3NTIzNTk=","avatar_url":"https://avatars2.githubusercontent.com/u/2752359?v=4","gravatar_id":"","url":"https://api.github.com/users/jdiaz5513","html_url":"https://github.com/jdiaz5513","followers_url":"https://api.github.com/users/jdiaz5513/followers","following_url":"https://api.github.com/users/jdiaz5513/following{/other_user}","gists_url":"https://api.github.com/users/jdiaz5513/gists{/gist_id}","starred_url":"https://api.github.com/users/jdiaz5513/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdiaz5513/subscriptions","organizations_url":"https://api.github.com/users/jdiaz5513/orgs","repos_url":"https://api.github.com/users/jdiaz5513/repos","events_url":"https://api.github.com/users/jdiaz5513/events{/privacy}","received_events_url":"https://api.github.com/users/jdiaz5513/received_events","type":"User","site_admin":false},"created_at":"2018-12-20T04:01:10Z","updated_at":"2018-12-20T04:01:10Z","author_association":"OWNER","body":"I might be missing something here, but isn't this only a problem when you\nhave circular imports?\n\nThat's a thing to be avoided at all costs, and I certainly remember having\nto go out of my way to prevent it within this library.\n\nA minimal example of how this might break would help.\n\nOn Wed, Dec 19, 2018, 6:53 PM Tim Popham <notifications@github.com wrote:\n\n> I noticed that your schema's constants get translated to naked values,\n> e.g. capnpc-ts/test/integration/test.capnp.ts#L2110-L2145\n> <https://github.com/jdiaz5513/capnp-ts/blob/524b6bde7d81037de586e2905d1d40955bbe22b0/packages/capnpc-ts/test/integration/test.capnp.ts#L2110-L2145>.\n> Unfortunately, ES6 and Node's module resolution don't guarantee that\n> imports are available at module scope. When you go to wrap an imported\n> struct around some data for a module-scoped constant, you may discover that\n> the imported struct is not yet available. Translating someConstant to\n> getSomeConstant() generalizes to module scope without any problems, but\n> I'm curious if you've got some other workaround.\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/jdiaz5513/capnp-ts/issues/113>, or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/ACn_Z5fb8ldqWfEm0Opg4q3KmpVhk4Zyks5u6vuZgaJpZM4ZbZkH>\n> .\n>\n"}}
{"actor":{"display_login":"jdiaz5513"}}