{"action":"created","comment":{"url":"https://api.github.com/repos/mrdoob/three.js/pulls/comments/245117519","pull_request_review_id":189162894,"id":245117519,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NTExNzUxOQ==","diff_hunk":"@@ -0,0 +1,94 @@\n+/**\n+ * @author mrdoob / http://mrdoob.com/\n+ */\n+\n+var fs = require( 'fs' );\n+\n+var srcFolder = '../examples/js/';\n+var dstFolder = '../examples/jsm/';\n+\n+var files = [\n+\t{ path: 'controls/OrbitControls.js', ignoreList: [] },\n+\t{ path: 'controls/MapControls.js', ignoreList: [] },\n+\t{ path: 'controls/TrackballControls.js', ignoreList: [] },\n+\t// { file: 'controls/TransformControls.js', ignoreList: [] },\n+\t{ path: 'loaders/GLTFLoader.js', ignoreList: [ 'NoSide', 'Matrix2', 'DDSLoader', 'DRACOLoader', 'BufferGeometryUtils' ] },\n+\t{ path: 'loaders/OBJLoader.js', ignoreList: [] }\n+];\n+\n+for ( var i = 0; i < files.length; i ++ ) {\n+\n+\tvar file = files[ i ];\n+\tconvert( file.path, file.ignoreList );\n+\n+}\n+\n+//\n+\n+function convert( path, ignoreList ) {\n+\n+\tvar contents = fs.readFileSync( srcFolder + path, 'utf8' );\n+\n+\tvar className = '';\n+\tvar dependencies = {};\n+\n+\t// class name\n+\n+\tcontents = contents.replace( /THREE\\.([a-zA-Z0-9]+) = /g, function ( match, p1 ) {\n+\n+\t\tclassName = p1;\n+\n+\t\tconsole.log( className );\n+\n+\t\treturn `_IMPORTS_\\n\\nvar ${p1} = `;\n+\n+\t} );\n+\n+\tcontents = contents.replace( /THREE\\.([a-zA-Z0-9]+)\\./g, function ( match, p1 ) {\n+\n+\t\tif ( p1 === className ) return `${p1}.`;\n+\n+\t\treturn match;\n+\n+\t} );\n+\n+\t// methods\n+\n+\tcontents = contents.replace( /new THREE\\.([a-zA-Z0-9]+)\\(/g, function ( match, p1 ) {\n+\n+\t\tif ( ignoreList.includes( p1 ) ) return match;\n+\n+\t\tdependencies[ p1 ] = true;\n+\n+\t\treturn `new ${p1}(`;\n+\n+\t} );\n+\n+\t// constants\n+\n+\tcontents = contents.replace( /THREE\\.([a-zA-Z0-9]+)/g, function ( match, p1 ) {\n+\n+\t\tif ( ignoreList.includes( p1 ) ) return match;\n+\t\tif ( p1 === className ) return match;\n+\n+\t\tdependencies[ p1 ] = true;\n+\n+\t\t// console.log( match, p1 );\n+\n+\t\treturn `${p1}`;\n+\n+\t} );\n+\n+\t//\n+\n+\tvar keys = Object.keys( dependencies ).sort().map( value => '\\n\\t' + value ).toString();\n+\tvar imports = `import {${keys}\\n} from \"../../../build/three.module.js\";`;","path":"utils/modularize.js","position":85,"original_position":85,"commit_id":"d695b757ac164020771bdb80de06d8d38e0fdee8","original_commit_id":"d695b757ac164020771bdb80de06d8d38e0fdee8","user":{"login":"sompylasar","id":498274,"node_id":"MDQ6VXNlcjQ5ODI3NA==","avatar_url":"https://avatars2.githubusercontent.com/u/498274?v=4","gravatar_id":"","url":"https://api.github.com/users/sompylasar","html_url":"https://github.com/sompylasar","followers_url":"https://api.github.com/users/sompylasar/followers","following_url":"https://api.github.com/users/sompylasar/following{/other_user}","gists_url":"https://api.github.com/users/sompylasar/gists{/gist_id}","starred_url":"https://api.github.com/users/sompylasar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sompylasar/subscriptions","organizations_url":"https://api.github.com/users/sompylasar/orgs","repos_url":"https://api.github.com/users/sompylasar/repos","events_url":"https://api.github.com/users/sompylasar/events{/privacy}","received_events_url":"https://api.github.com/users/sompylasar/received_events","type":"User","site_admin":false},"body":"I think it should import from individual module files in `src`, not from the build. Multiple import statements.","created_at":"2019-01-03T20:04:24Z","updated_at":"2019-01-03T20:04:24Z","html_url":"https://github.com/mrdoob/three.js/pull/15518#discussion_r245117519","pull_request_url":"https://api.github.com/repos/mrdoob/three.js/pulls/15518","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/comments/245117519"},"html":{"href":"https://github.com/mrdoob/three.js/pull/15518#discussion_r245117519"},"pull_request":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/15518"}}},"pull_request":{"url":"https://api.github.com/repos/mrdoob/three.js/pulls/15518","id":242083475,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQyMDgzNDc1","html_url":"https://github.com/mrdoob/three.js/pull/15518","diff_url":"https://github.com/mrdoob/three.js/pull/15518.diff","patch_url":"https://github.com/mrdoob/three.js/pull/15518.patch","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/15518","number":15518,"state":"closed","locked":false,"title":"Added script to generate modules out of example/js files.","user":{"login":"mrdoob","id":97088,"node_id":"MDQ6VXNlcjk3MDg4","avatar_url":"https://avatars0.githubusercontent.com/u/97088?v=4","gravatar_id":"","url":"https://api.github.com/users/mrdoob","html_url":"https://github.com/mrdoob","followers_url":"https://api.github.com/users/mrdoob/followers","following_url":"https://api.github.com/users/mrdoob/following{/other_user}","gists_url":"https://api.github.com/users/mrdoob/gists{/gist_id}","starred_url":"https://api.github.com/users/mrdoob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrdoob/subscriptions","organizations_url":"https://api.github.com/users/mrdoob/orgs","repos_url":"https://api.github.com/users/mrdoob/repos","events_url":"https://api.github.com/users/mrdoob/events{/privacy}","received_events_url":"https://api.github.com/users/mrdoob/received_events","type":"User","site_admin":false},"body":"The script currently converts some of the controls and loaders to javascript modules.\r\nA list of keywords to ignore was needed to get things working.\r\n\r\nThis is definitely experimental, we'll see how far we can push it...\r\n\r\nRelated #9403 #9562 #14803 #15482","created_at":"2019-01-03T19:07:17Z","updated_at":"2019-01-03T20:04:24Z","closed_at":"2019-01-03T19:07:29Z","merged_at":"2019-01-03T19:07:29Z","merge_commit_sha":"e88edaa2caea2b61c7ccfc00d1a4f8870399642a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/mrdoob/three.js/milestones/14","html_url":"https://github.com/mrdoob/three.js/milestone/14","labels_url":"https://api.github.com/repos/mrdoob/three.js/milestones/14/labels","id":3862399,"node_id":"MDk6TWlsZXN0b25lMzg2MjM5OQ==","number":14,"title":"r101","description":"","creator":{"login":"mrdoob","id":97088,"node_id":"MDQ6VXNlcjk3MDg4","avatar_url":"https://avatars0.githubusercontent.com/u/97088?v=4","gravatar_id":"","url":"https://api.github.com/users/mrdoob","html_url":"https://github.com/mrdoob","followers_url":"https://api.github.com/users/mrdoob/followers","following_url":"https://api.github.com/users/mrdoob/following{/other_user}","gists_url":"https://api.github.com/users/mrdoob/gists{/gist_id}","starred_url":"https://api.github.com/users/mrdoob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrdoob/subscriptions","organizations_url":"https://api.github.com/users/mrdoob/orgs","repos_url":"https://api.github.com/users/mrdoob/repos","events_url":"https://api.github.com/users/mrdoob/events{/privacy}","received_events_url":"https://api.github.com/users/mrdoob/received_events","type":"User","site_admin":false},"open_issues":110,"closed_issues":16,"state":"open","created_at":"2018-12-01T01:22:53Z","updated_at":"2019-01-03T19:21:36Z","due_on":"2019-01-23T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/mrdoob/three.js/pulls/15518/commits","review_comments_url":"https://api.github.com/repos/mrdoob/three.js/pulls/15518/comments","review_comment_url":"https://api.github.com/repos/mrdoob/three.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/15518/comments","statuses_url":"https://api.github.com/repos/mrdoob/three.js/statuses/d695b757ac164020771bdb80de06d8d38e0fdee8","head":{"label":"mrdoob:modularize-examples","ref":"modularize-examples","sha":"d695b757ac164020771bdb80de06d8d38e0fdee8","user":{"login":"mrdoob","id":97088,"node_id":"MDQ6VXNlcjk3MDg4","avatar_url":"https://avatars0.githubusercontent.com/u/97088?v=4","gravatar_id":"","url":"https://api.github.com/users/mrdoob","html_url":"https://github.com/mrdoob","followers_url":"https://api.github.com/users/mrdoob/followers","following_url":"https://api.github.com/users/mrdoob/following{/other_user}","gists_url":"https://api.github.com/users/mrdoob/gists{/gist_id}","starred_url":"https://api.github.com/users/mrdoob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrdoob/subscriptions","organizations_url":"https://api.github.com/users/mrdoob/orgs","repos_url":"https://api.github.com/users/mrdoob/repos","events_url":"https://api.github.com/users/mrdoob/events{/privacy}","received_events_url":"https://api.github.com/users/mrdoob/received_events","type":"User","site_admin":false},"repo":{"id":576201,"node_id":"MDEwOlJlcG9zaXRvcnk1NzYyMDE=","name":"three.js","full_name":"mrdoob/three.js","private":false,"owner":{"login":"mrdoob","id":97088,"node_id":"MDQ6VXNlcjk3MDg4","avatar_url":"https://avatars0.githubusercontent.com/u/97088?v=4","gravatar_id":"","url":"https://api.github.com/users/mrdoob","html_url":"https://github.com/mrdoob","followers_url":"https://api.github.com/users/mrdoob/followers","following_url":"https://api.github.com/users/mrdoob/following{/other_user}","gists_url":"https://api.github.com/users/mrdoob/gists{/gist_id}","starred_url":"https://api.github.com/users/mrdoob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrdoob/subscriptions","organizations_url":"https://api.github.com/users/mrdoob/orgs","repos_url":"https://api.github.com/users/mrdoob/repos","events_url":"https://api.github.com/users/mrdoob/events{/privacy}","received_events_url":"https://api.github.com/users/mrdoob/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mrdoob/three.js","description":"JavaScript 3D library.","fork":false,"url":"https://api.github.com/repos/mrdoob/three.js","forks_url":"https://api.github.com/repos/mrdoob/three.js/forks","keys_url":"https://api.github.com/repos/mrdoob/three.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrdoob/three.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrdoob/three.js/teams","hooks_url":"https://api.github.com/repos/mrdoob/three.js/hooks","issue_events_url":"https://api.github.com/repos/mrdoob/three.js/issues/events{/number}","events_url":"https://api.github.com/repos/mrdoob/three.js/events","assignees_url":"https://api.github.com/repos/mrdoob/three.js/assignees{/user}","branches_url":"https://api.github.com/repos/mrdoob/three.js/branches{/branch}","tags_url":"https://api.github.com/repos/mrdoob/three.js/tags","blobs_url":"https://api.github.com/repos/mrdoob/three.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrdoob/three.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrdoob/three.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrdoob/three.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrdoob/three.js/statuses/{sha}","languages_url":"https://api.github.com/repos/mrdoob/three.js/languages","stargazers_url":"https://api.github.com/repos/mrdoob/three.js/stargazers","contributors_url":"https://api.github.com/repos/mrdoob/three.js/contributors","subscribers_url":"https://api.github.com/repos/mrdoob/three.js/subscribers","subscription_url":"https://api.github.com/repos/mrdoob/three.js/subscription","commits_url":"https://api.github.com/repos/mrdoob/three.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrdoob/three.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrdoob/three.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrdoob/three.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrdoob/three.js/contents/{+path}","compare_url":"https://api.github.com/repos/mrdoob/three.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrdoob/three.js/merges","archive_url":"https://api.github.com/repos/mrdoob/three.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrdoob/three.js/downloads","issues_url":"https://api.github.com/repos/mrdoob/three.js/issues{/number}","pulls_url":"https://api.github.com/repos/mrdoob/three.js/pulls{/number}","milestones_url":"https://api.github.com/repos/mrdoob/three.js/milestones{/number}","notifications_url":"https://api.github.com/repos/mrdoob/three.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrdoob/three.js/labels{/name}","releases_url":"https://api.github.com/repos/mrdoob/three.js/releases{/id}","deployments_url":"https://api.github.com/repos/mrdoob/three.js/deployments","created_at":"2010-03-23T18:58:01Z","updated_at":"2019-01-03T19:22:11Z","pushed_at":"2019-01-03T19:22:42Z","git_url":"git://github.com/mrdoob/three.js.git","ssh_url":"git@github.com:mrdoob/three.js.git","clone_url":"https://github.com/mrdoob/three.js.git","svn_url":"https://github.com/mrdoob/three.js","homepage":"https://threejs.org/","size":706518,"stargazers_count":47715,"watchers_count":47715,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":17988,"mirror_url":null,"archived":false,"open_issues_count":770,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":17988,"open_issues":770,"watchers":47715,"default_branch":"dev"}},"base":{"label":"mrdoob:dev","ref":"dev","sha":"0dedbcb948f603e60bd9b9f105fe0269441c23e1","user":{"login":"mrdoob","id":97088,"node_id":"MDQ6VXNlcjk3MDg4","avatar_url":"https://avatars0.githubusercontent.com/u/97088?v=4","gravatar_id":"","url":"https://api.github.com/users/mrdoob","html_url":"https://github.com/mrdoob","followers_url":"https://api.github.com/users/mrdoob/followers","following_url":"https://api.github.com/users/mrdoob/following{/other_user}","gists_url":"https://api.github.com/users/mrdoob/gists{/gist_id}","starred_url":"https://api.github.com/users/mrdoob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrdoob/subscriptions","organizations_url":"https://api.github.com/users/mrdoob/orgs","repos_url":"https://api.github.com/users/mrdoob/repos","events_url":"https://api.github.com/users/mrdoob/events{/privacy}","received_events_url":"https://api.github.com/users/mrdoob/received_events","type":"User","site_admin":false},"repo":{"id":576201,"node_id":"MDEwOlJlcG9zaXRvcnk1NzYyMDE=","name":"three.js","full_name":"mrdoob/three.js","private":false,"owner":{"login":"mrdoob","id":97088,"node_id":"MDQ6VXNlcjk3MDg4","avatar_url":"https://avatars0.githubusercontent.com/u/97088?v=4","gravatar_id":"","url":"https://api.github.com/users/mrdoob","html_url":"https://github.com/mrdoob","followers_url":"https://api.github.com/users/mrdoob/followers","following_url":"https://api.github.com/users/mrdoob/following{/other_user}","gists_url":"https://api.github.com/users/mrdoob/gists{/gist_id}","starred_url":"https://api.github.com/users/mrdoob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrdoob/subscriptions","organizations_url":"https://api.github.com/users/mrdoob/orgs","repos_url":"https://api.github.com/users/mrdoob/repos","events_url":"https://api.github.com/users/mrdoob/events{/privacy}","received_events_url":"https://api.github.com/users/mrdoob/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mrdoob/three.js","description":"JavaScript 3D library.","fork":false,"url":"https://api.github.com/repos/mrdoob/three.js","forks_url":"https://api.github.com/repos/mrdoob/three.js/forks","keys_url":"https://api.github.com/repos/mrdoob/three.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrdoob/three.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrdoob/three.js/teams","hooks_url":"https://api.github.com/repos/mrdoob/three.js/hooks","issue_events_url":"https://api.github.com/repos/mrdoob/three.js/issues/events{/number}","events_url":"https://api.github.com/repos/mrdoob/three.js/events","assignees_url":"https://api.github.com/repos/mrdoob/three.js/assignees{/user}","branches_url":"https://api.github.com/repos/mrdoob/three.js/branches{/branch}","tags_url":"https://api.github.com/repos/mrdoob/three.js/tags","blobs_url":"https://api.github.com/repos/mrdoob/three.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrdoob/three.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrdoob/three.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrdoob/three.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrdoob/three.js/statuses/{sha}","languages_url":"https://api.github.com/repos/mrdoob/three.js/languages","stargazers_url":"https://api.github.com/repos/mrdoob/three.js/stargazers","contributors_url":"https://api.github.com/repos/mrdoob/three.js/contributors","subscribers_url":"https://api.github.com/repos/mrdoob/three.js/subscribers","subscription_url":"https://api.github.com/repos/mrdoob/three.js/subscription","commits_url":"https://api.github.com/repos/mrdoob/three.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrdoob/three.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrdoob/three.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrdoob/three.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrdoob/three.js/contents/{+path}","compare_url":"https://api.github.com/repos/mrdoob/three.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrdoob/three.js/merges","archive_url":"https://api.github.com/repos/mrdoob/three.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrdoob/three.js/downloads","issues_url":"https://api.github.com/repos/mrdoob/three.js/issues{/number}","pulls_url":"https://api.github.com/repos/mrdoob/three.js/pulls{/number}","milestones_url":"https://api.github.com/repos/mrdoob/three.js/milestones{/number}","notifications_url":"https://api.github.com/repos/mrdoob/three.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrdoob/three.js/labels{/name}","releases_url":"https://api.github.com/repos/mrdoob/three.js/releases{/id}","deployments_url":"https://api.github.com/repos/mrdoob/three.js/deployments","created_at":"2010-03-23T18:58:01Z","updated_at":"2019-01-03T19:22:11Z","pushed_at":"2019-01-03T19:22:42Z","git_url":"git://github.com/mrdoob/three.js.git","ssh_url":"git@github.com:mrdoob/three.js.git","clone_url":"https://github.com/mrdoob/three.js.git","svn_url":"https://github.com/mrdoob/three.js","homepage":"https://threejs.org/","size":706518,"stargazers_count":47715,"watchers_count":47715,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":17988,"mirror_url":null,"archived":false,"open_issues_count":770,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":17988,"open_issues":770,"watchers":47715,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/15518"},"html":{"href":"https://github.com/mrdoob/three.js/pull/15518"},"issue":{"href":"https://api.github.com/repos/mrdoob/three.js/issues/15518"},"comments":{"href":"https://api.github.com/repos/mrdoob/three.js/issues/15518/comments"},"review_comments":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/15518/comments"},"review_comment":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/15518/commits"},"statuses":{"href":"https://api.github.com/repos/mrdoob/three.js/statuses/d695b757ac164020771bdb80de06d8d38e0fdee8"}},"author_association":"OWNER"}}
{"actor":{"display_login":"sompylasar"}}