{"action":"created","issue":{"url":"https://api.github.com/repos/google/closure-compiler/issues/2130","repository_url":"https://api.github.com/repos/google/closure-compiler","labels_url":"https://api.github.com/repos/google/closure-compiler/issues/2130/labels{/name}","comments_url":"https://api.github.com/repos/google/closure-compiler/issues/2130/comments","events_url":"https://api.github.com/repos/google/closure-compiler/issues/2130/events","html_url":"https://github.com/google/closure-compiler/pull/2130","id":187523688,"number":2130,"title":"Support the node module resolution algorithm for ES6 modules.","user":{"login":"ChadKillingsworth","id":1247639,"avatar_url":"https://avatars.githubusercontent.com/u/1247639?v=3","gravatar_id":"","url":"https://api.github.com/users/ChadKillingsworth","html_url":"https://github.com/ChadKillingsworth","followers_url":"https://api.github.com/users/ChadKillingsworth/followers","following_url":"https://api.github.com/users/ChadKillingsworth/following{/other_user}","gists_url":"https://api.github.com/users/ChadKillingsworth/gists{/gist_id}","starred_url":"https://api.github.com/users/ChadKillingsworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChadKillingsworth/subscriptions","organizations_url":"https://api.github.com/users/ChadKillingsworth/orgs","repos_url":"https://api.github.com/users/ChadKillingsworth/repos","events_url":"https://api.github.com/users/ChadKillingsworth/events{/privacy}","received_events_url":"https://api.github.com/users/ChadKillingsworth/received_events","type":"User","site_admin":false},"labels":[{"id":147878228,"url":"https://api.github.com/repos/google/closure-compiler/labels/cla:%20yes","name":"cla: yes","color":"009800","default":false},{"id":375210269,"url":"https://api.github.com/repos/google/closure-compiler/labels/Import%20In%20Progress","name":"Import In Progress","color":"00DD00","default":false}],"state":"open","locked":false,"assignee":{"login":"brad4d","id":1115235,"avatar_url":"https://avatars.githubusercontent.com/u/1115235?v=3","gravatar_id":"","url":"https://api.github.com/users/brad4d","html_url":"https://github.com/brad4d","followers_url":"https://api.github.com/users/brad4d/followers","following_url":"https://api.github.com/users/brad4d/following{/other_user}","gists_url":"https://api.github.com/users/brad4d/gists{/gist_id}","starred_url":"https://api.github.com/users/brad4d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brad4d/subscriptions","organizations_url":"https://api.github.com/users/brad4d/orgs","repos_url":"https://api.github.com/users/brad4d/repos","events_url":"https://api.github.com/users/brad4d/events{/privacy}","received_events_url":"https://api.github.com/users/brad4d/received_events","type":"User","site_admin":false},"assignees":[{"login":"brad4d","id":1115235,"avatar_url":"https://avatars.githubusercontent.com/u/1115235?v=3","gravatar_id":"","url":"https://api.github.com/users/brad4d","html_url":"https://github.com/brad4d","followers_url":"https://api.github.com/users/brad4d/followers","following_url":"https://api.github.com/users/brad4d/following{/other_user}","gists_url":"https://api.github.com/users/brad4d/gists{/gist_id}","starred_url":"https://api.github.com/users/brad4d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brad4d/subscriptions","organizations_url":"https://api.github.com/users/brad4d/orgs","repos_url":"https://api.github.com/users/brad4d/repos","events_url":"https://api.github.com/users/brad4d/events{/privacy}","received_events_url":"https://api.github.com/users/brad4d/received_events","type":"User","site_admin":false}],"milestone":null,"comments":42,"created_at":"2016-11-05T21:15:53Z","updated_at":"2016-11-17T18:11:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/google/closure-compiler/pulls/2130","html_url":"https://github.com/google/closure-compiler/pull/2130","diff_url":"https://github.com/google/closure-compiler/pull/2130.diff","patch_url":"https://github.com/google/closure-compiler/pull/2130.patch"},"body":"Adds a `--module_resolution` flag to allow users to opt-out of loading from node_modules registries. However the path-based algorithm still follows the node module loading spec with regard to file extension priority and utilizing package.json file main enteries for directories.\r\n\r\nAdds JSON file support if any module processing is enabled.\r\n\r\nNote that the JSParser attempts to resolve ES6 module paths and issue loading errors. This seems strange because similar functionality exists in the ProcessEs6Modules pass (which seems more appropriate). I'm not sure why this logic exists in the parser, but I didn't want to move that until I understood the implications.\r\n\r\nFixes #1897 - any file extension is now allowed for either CommonJS or ES6 modules"},"comment":{"url":"https://api.github.com/repos/google/closure-compiler/issues/comments/261323465","html_url":"https://github.com/google/closure-compiler/pull/2130#issuecomment-261323465","issue_url":"https://api.github.com/repos/google/closure-compiler/issues/2130","id":261323465,"user":{"login":"ChadKillingsworth","id":1247639,"avatar_url":"https://avatars.githubusercontent.com/u/1247639?v=3","gravatar_id":"","url":"https://api.github.com/users/ChadKillingsworth","html_url":"https://github.com/ChadKillingsworth","followers_url":"https://api.github.com/users/ChadKillingsworth/followers","following_url":"https://api.github.com/users/ChadKillingsworth/following{/other_user}","gists_url":"https://api.github.com/users/ChadKillingsworth/gists{/gist_id}","starred_url":"https://api.github.com/users/ChadKillingsworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChadKillingsworth/subscriptions","organizations_url":"https://api.github.com/users/ChadKillingsworth/orgs","repos_url":"https://api.github.com/users/ChadKillingsworth/repos","events_url":"https://api.github.com/users/ChadKillingsworth/events{/privacy}","received_events_url":"https://api.github.com/users/ChadKillingsworth/received_events","type":"User","site_admin":false},"created_at":"2016-11-17T18:11:24Z","updated_at":"2016-11-17T18:11:24Z","body":"> For example, will this cause Closure Compiler to start searching the filesystem for files that weren't specified via flags?\r\n\r\nNo. You still are responsible for providing the complete source set of files.\r\n\r\nNode module resolution solves many of the same problems that `goog.module` does inside Google: namely that you don't have to know the exact filesystem path of dependencies in code. Instead, any module path that doesn't begin with a `.` or a `/` is looked for from the `node_modules` folder. There's quite a few intricacies involved, but that folder is managed in such a way so that if 2 packages have conflicting dependencies, the import will return the correct version for each.\r\n\r\nTo provide the correct source set there are a couple of options:\r\n\r\n 1. Pass in all the JS and JSON files in the \"node_modules\" folder as source and let the compiler dependency management drop and sort them.\r\n 2. Run a pre-build step that discovers dependencies from an entry point and passes in the exact set. This option is the recommended one.\r\n\r\nI'm working on tooling for the NPM deployment to facilitate the 2nd option. This will probably lead into an easy way to configure and support the code-splitting functionality of the compiler as well: https://twitter.com/chadhikes/status/799266788290613249"}}
{"actor":{"display_login":"ChadKillingsworth"}}