{"action":"created","issue":{"url":"https://api.github.com/repos/cincheo/jsweet/issues/190","repository_url":"https://api.github.com/repos/cincheo/jsweet","labels_url":"https://api.github.com/repos/cincheo/jsweet/issues/190/labels{/name}","comments_url":"https://api.github.com/repos/cincheo/jsweet/issues/190/comments","events_url":"https://api.github.com/repos/cincheo/jsweet/issues/190/events","html_url":"https://github.com/cincheo/jsweet/issues/190","id":190487543,"number":190,"title":"Making a bundle breaks the dependencies order.","user":{"login":"negora","id":2098654,"avatar_url":"https://avatars.githubusercontent.com/u/2098654?v=3","gravatar_id":"","url":"https://api.github.com/users/negora","html_url":"https://github.com/negora","followers_url":"https://api.github.com/users/negora/followers","following_url":"https://api.github.com/users/negora/following{/other_user}","gists_url":"https://api.github.com/users/negora/gists{/gist_id}","starred_url":"https://api.github.com/users/negora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/negora/subscriptions","organizations_url":"https://api.github.com/users/negora/orgs","repos_url":"https://api.github.com/users/negora/repos","events_url":"https://api.github.com/users/negora/events{/privacy}","received_events_url":"https://api.github.com/users/negora/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-19T09:49:19Z","updated_at":"2016-11-20T16:49:39Z","closed_at":null,"body":"I believe that it didn't happen before. Yesterday, my builds started to fail at runtime. I checked the generated JavaScript and it turned out that the classes weren't in the right order. There was a class that was creating an instance of another class that still hadn't been declared. I'm not sure, but, Could it be related to the resolution of the bugs #173 and #186? Just a guess.\r\n\r\nTo reproduce the error, create these classes:\r\n\r\n\r\n```\r\na.Car\r\nb.Wheel\r\n```\r\n\r\n`a` and `b` are the names of the packages. The code of the classes is this:\r\n\r\n```java\r\npackage a;\r\nimport b.Wheel;\r\n\r\npublic class Car {\r\n\r\n\tpublic static void main (String[] args) {\r\n\t\tWheel wheel = new Wheel ();\r\n\t}\r\n\r\n}\r\n```\r\n\r\n```java\r\npackage b;\r\n\r\npublic class Wheel {\r\n}\r\n```\r\n\r\nThis will transpile the classes in the right order: `b.Wheel` first, `a.Car` after. However, if we switch the packages of the classes like this:\r\n\r\n```\r\na.Wheel\r\nb.Car\r\n```\r\n\r\nThis will transpile the classes in the **wrong order**: `b.Car` first, `a.Wheel` after. And this will make the browser (Firefox in this case) throw this error: `TypeError: a is undefined`.\r\n\r\nI don't know how JSweet works internally, but it seems that the alphabetical order of the package has some influence in the order in which the classes are transpiled. At least, after certain update of JSweet. I believe that it didn't fail before.\r\n\r\nBy the way, I'm referring to the option `bundle`. I'm using Maven and editing that option from the `pom.xml` file.\r\n\r\nThanks.\r\n"},"comment":{"url":"https://api.github.com/repos/cincheo/jsweet/issues/comments/261789454","html_url":"https://github.com/cincheo/jsweet/issues/190#issuecomment-261789454","issue_url":"https://api.github.com/repos/cincheo/jsweet/issues/190","id":261789454,"user":{"login":"renaudpawlak","id":6288061,"avatar_url":"https://avatars.githubusercontent.com/u/6288061?v=3","gravatar_id":"","url":"https://api.github.com/users/renaudpawlak","html_url":"https://github.com/renaudpawlak","followers_url":"https://api.github.com/users/renaudpawlak/followers","following_url":"https://api.github.com/users/renaudpawlak/following{/other_user}","gists_url":"https://api.github.com/users/renaudpawlak/gists{/gist_id}","starred_url":"https://api.github.com/users/renaudpawlak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renaudpawlak/subscriptions","organizations_url":"https://api.github.com/users/renaudpawlak/orgs","repos_url":"https://api.github.com/users/renaudpawlak/repos","events_url":"https://api.github.com/users/renaudpawlak/events{/privacy}","received_events_url":"https://api.github.com/users/renaudpawlak/received_events","type":"User","site_admin":false},"created_at":"2016-11-20T16:49:39Z","updated_at":"2016-11-20T16:49:39Z","body":"Ok. It seems that this commit is to blame: https://github.com/cincheo/jsweet/commit/3f46fb5cf18190b8cea8309f2380a27eddbfb775\r\n\r\nIt is a bad regression in the bundle mode. I will fix tomorrow (and add some tests to make sure that it does not happen again)."}}
{"actor":{"display_login":"renaudpawlak"}}