{"action":"created","issue":{"url":"https://api.github.com/repos/antlr/antlr4/issues/1088","labels_url":"https://api.github.com/repos/antlr/antlr4/issues/1088/labels{/name}","comments_url":"https://api.github.com/repos/antlr/antlr4/issues/1088/comments","events_url":"https://api.github.com/repos/antlr/antlr4/issues/1088/events","html_url":"https://github.com/antlr/antlr4/issues/1088","id":124392024,"number":1088,"title":"Javascript runtime, better packaging for use in browsers","user":{"login":"bd82","id":4233843,"avatar_url":"https://avatars.githubusercontent.com/u/4233843?v=3","gravatar_id":"","url":"https://api.github.com/users/bd82","html_url":"https://github.com/bd82","followers_url":"https://api.github.com/users/bd82/followers","following_url":"https://api.github.com/users/bd82/following{/other_user}","gists_url":"https://api.github.com/users/bd82/gists{/gist_id}","starred_url":"https://api.github.com/users/bd82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bd82/subscriptions","organizations_url":"https://api.github.com/users/bd82/orgs","repos_url":"https://api.github.com/users/bd82/repos","events_url":"https://api.github.com/users/bd82/events{/privacy}","received_events_url":"https://api.github.com/users/bd82/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-30T19:47:15Z","updated_at":"2015-12-30T23:48:06Z","closed_at":null,"body":"The javascript runtime uses 'honey require' to load resources in the browser\r\nThis causes several issues:\r\n\r\n* **Synchronized** loading of ~50 files can easily take 5-10 seconds with 100-200ms latency.\r\n* The current version of honey [require.js](https://github.com/antlr/antlr4/blob/master/runtime/JavaScript/src/lib/require.js#L65) does not work on IE 11 as:\r\n```new URL(...)``` will throw ```Object doesn't support this action```.\r\n* Performance degradation of [~30%](http://sap.github.io/chevrotain/performance/antlr4.html) on chrome.\r\n * not sure why, may be related to use of eval to load the modules?\r\n* Generated code uses a mixture of module loading (require) and global variables (antlr4)."},"comment":{"url":"https://api.github.com/repos/antlr/antlr4/issues/comments/168096622","html_url":"https://github.com/antlr/antlr4/issues/1088#issuecomment-168096622","issue_url":"https://api.github.com/repos/antlr/antlr4/issues/1088","id":168096622,"user":{"login":"bd82","id":4233843,"avatar_url":"https://avatars.githubusercontent.com/u/4233843?v=3","gravatar_id":"","url":"https://api.github.com/users/bd82","html_url":"https://github.com/bd82","followers_url":"https://api.github.com/users/bd82/followers","following_url":"https://api.github.com/users/bd82/following{/other_user}","gists_url":"https://api.github.com/users/bd82/gists{/gist_id}","starred_url":"https://api.github.com/users/bd82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bd82/subscriptions","organizations_url":"https://api.github.com/users/bd82/orgs","repos_url":"https://api.github.com/users/bd82/repos","events_url":"https://api.github.com/users/bd82/events{/privacy}","received_events_url":"https://api.github.com/users/bd82/received_events","type":"User","site_admin":false},"created_at":"2015-12-30T23:48:06Z","updated_at":"2015-12-30T23:48:06Z","body":"Hi @ericvergnaud.\r\n\r\nIn response to your first comment:\r\nCompression/Packaging is **not** mutually exclusive with the source code being split into multiple files.\r\nnor does it conflict with running in node.js or delivering 'raw scripts'.\r\n\r\nThe above is only true if one assumes that the source code is delivered **as is** to the consumer.\r\n\r\n#### An Example:\r\nLets look at [Less.js](https://github.com/less/less.js).\r\n\r\n* Less.js runs both in node.js and in the browser.\r\n* Their sources are split into [multiple files](https://github.com/less/less.js/tree/master/lib/less) written using node.js require / export syntax.\r\n* ``` npm install less ``` will install **all** those separate files. \r\n* ``` bower install less ``` however will **only** contain concatenated versions as in a browser context\r\n       aggregated libraries are important.\r\n * It even contains two different concatenated versions, simple concatenated and a minified one.\r\n* The [download page](http://lesscss.org/#download-options) has links to concatenated minified version.\r\n\r\nThe discussion is not about changing the sources file structure (single big file), nor is it about \r\nchanging the existing delivery method of 'raw scripts'.\r\n\r\nIt is about a feature request to **also** deliver ANTLR4 JS runtime in an **easy to consume** manner in the browser.\r\n\r\n\r\n"}}