{"action":"created","comment":{"url":"https://api.github.com/repos/Polymer/polymer-bundler/pulls/comments/106065446","pull_request_review_id":26971322,"id":106065446,"diff_hunk":"@@ -217,6 +236,35 @@ export function rewriteAstBaseUrl(\n }\n \n /**\n+ * Walk through inline scripts of an import document.\n+ * For each script create identity source maps unless one already exists.\n+ *\n+ * The generated script mapping detail is the relative location within\n+ * the script tag. Later this will be updated to account for the\n+ * line offset within the final bundle.\n+ */\n+export async function addSourcemapsToInlineScripts(\n+    document: Document, ast: ASTNode, oldBaseUrl: UrlString) {\n+  const inlineScripts = dom5.queryAll(ast, matchers.inlineJavascript);\n+  const parsedHtmlDocument = document.parsedDocument as ParsedHtmlDocument;\n+  const promises = inlineScripts.map(scriptAst => {\n+    let content = dom5.getTextContent(scriptAst);\n+    const sourceRange = parsedHtmlDocument.sourceRangeForStartTag(scriptAst)!;","path":"src/import-utils.ts","position":117,"original_position":108,"commit_id":"df1f8b3d746c4cedeb7da63d1ec6ef166e6ed2f8","original_commit_id":"cd0a196788289877a12bf006a5ef6b9396c045b6","user":{"login":"ChadKillingsworth","id":1247639,"avatar_url":"https://avatars1.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},"body":"That one is being reparsed? I should just be reading the original AST there.","created_at":"2017-03-15T01:06:30Z","updated_at":"2017-03-15T01:06:30Z","html_url":"https://github.com/Polymer/polymer-bundler/pull/449#discussion_r106065446","pull_request_url":"https://api.github.com/repos/Polymer/polymer-bundler/pulls/449","_links":{"self":{"href":"https://api.github.com/repos/Polymer/polymer-bundler/pulls/comments/106065446"},"html":{"href":"https://github.com/Polymer/polymer-bundler/pull/449#discussion_r106065446"},"pull_request":{"href":"https://api.github.com/repos/Polymer/polymer-bundler/pulls/449"}}},"pull_request":{"url":"https://api.github.com/repos/Polymer/polymer-bundler/pulls/449","id":109356512,"html_url":"https://github.com/Polymer/polymer-bundler/pull/449","diff_url":"https://github.com/Polymer/polymer-bundler/pull/449.diff","patch_url":"https://github.com/Polymer/polymer-bundler/pull/449.patch","issue_url":"https://api.github.com/repos/Polymer/polymer-bundler/issues/449","number":449,"state":"open","locked":false,"title":"Add sourcemap support","user":{"login":"ChadKillingsworth","id":1247639,"avatar_url":"https://avatars1.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},"body":"Proper sourcemap support is a godsend to debugging and can provide unmangled stack traces from production environments using services like https://sentry.io/  I've been using a modified Vulcanize to generate sourcemaps on a production project. Now that polymer-build is far enough along, it's time to add that support here.\r\n\r\nWhen enabled, sourcemaps will be generated for any inline (or inlined) script tag that does not already have one. During the initial phase, the sourcemaps all contain generated mapping locations relative to the containing script tag. As a final set, these locations are updated so that they are absolute positions within the final bundle.\r\n\r\nWhen debugging, http://sourcemapper.qfox.nl/ is your friend. It lets you easily see if the mappings are correct.\r\n\r\nOnce all the polymer tooling properly supports sourcemaps, then turning this flag to `true` by default is recommended. However until then they will just get in the way.\r\n\r\nThis PR depends on DefinitelyTyped/DefinitelyTyped/pull/15018 for type information for the `acorn.tokenizer` function.\r\n\r\nI'm not super familiar with Typescript, so stylistically this may have issues. I'll be happy to correct them.\r\n\r\n - [x] CHANGELOG.md has been updated\r\n","created_at":"2017-03-06T21:47:52Z","updated_at":"2017-03-15T01:06:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea8d4184fac588760ab481a3d20d9940c7887d0d","assignee":{"login":"rictic","id":1659,"avatar_url":"https://avatars0.githubusercontent.com/u/1659?v=3","gravatar_id":"","url":"https://api.github.com/users/rictic","html_url":"https://github.com/rictic","followers_url":"https://api.github.com/users/rictic/followers","following_url":"https://api.github.com/users/rictic/following{/other_user}","gists_url":"https://api.github.com/users/rictic/gists{/gist_id}","starred_url":"https://api.github.com/users/rictic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rictic/subscriptions","organizations_url":"https://api.github.com/users/rictic/orgs","repos_url":"https://api.github.com/users/rictic/repos","events_url":"https://api.github.com/users/rictic/events{/privacy}","received_events_url":"https://api.github.com/users/rictic/received_events","type":"User","site_admin":false},"assignees":[{"login":"rictic","id":1659,"avatar_url":"https://avatars0.githubusercontent.com/u/1659?v=3","gravatar_id":"","url":"https://api.github.com/users/rictic","html_url":"https://github.com/rictic","followers_url":"https://api.github.com/users/rictic/followers","following_url":"https://api.github.com/users/rictic/following{/other_user}","gists_url":"https://api.github.com/users/rictic/gists{/gist_id}","starred_url":"https://api.github.com/users/rictic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rictic/subscriptions","organizations_url":"https://api.github.com/users/rictic/orgs","repos_url":"https://api.github.com/users/rictic/repos","events_url":"https://api.github.com/users/rictic/events{/privacy}","received_events_url":"https://api.github.com/users/rictic/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Polymer/polymer-bundler/pulls/449/commits","review_comments_url":"https://api.github.com/repos/Polymer/polymer-bundler/pulls/449/comments","review_comment_url":"https://api.github.com/repos/Polymer/polymer-bundler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Polymer/polymer-bundler/issues/449/comments","statuses_url":"https://api.github.com/repos/Polymer/polymer-bundler/statuses/df1f8b3d746c4cedeb7da63d1ec6ef166e6ed2f8","head":{"label":"ChadKillingsworth:sourcemaps-bundler","ref":"sourcemaps-bundler","sha":"df1f8b3d746c4cedeb7da63d1ec6ef166e6ed2f8","user":{"login":"ChadKillingsworth","id":1247639,"avatar_url":"https://avatars1.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},"repo":{"id":72646863,"name":"vulcanize","full_name":"ChadKillingsworth/vulcanize","owner":{"login":"ChadKillingsworth","id":1247639,"avatar_url":"https://avatars1.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},"private":false,"html_url":"https://github.com/ChadKillingsworth/vulcanize","description":"Build tool for HTMLImports and Web Components","fork":true,"url":"https://api.github.com/repos/ChadKillingsworth/vulcanize","forks_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/forks","keys_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/teams","hooks_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/hooks","issue_events_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/issues/events{/number}","events_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/events","assignees_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/assignees{/user}","branches_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/branches{/branch}","tags_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/tags","blobs_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/git/refs{/sha}","trees_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/statuses/{sha}","languages_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/languages","stargazers_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/stargazers","contributors_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/contributors","subscribers_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/subscribers","subscription_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/subscription","commits_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/commits{/sha}","git_commits_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/git/commits{/sha}","comments_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/comments{/number}","issue_comment_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/issues/comments{/number}","contents_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/contents/{+path}","compare_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/merges","archive_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/downloads","issues_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/issues{/number}","pulls_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/pulls{/number}","milestones_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/milestones{/number}","notifications_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/labels{/name}","releases_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/releases{/id}","deployments_url":"https://api.github.com/repos/ChadKillingsworth/vulcanize/deployments","created_at":"2016-11-02T14:18:02Z","updated_at":"2017-03-06T18:54:34Z","pushed_at":"2017-03-09T15:25:20Z","git_url":"git://github.com/ChadKillingsworth/vulcanize.git","ssh_url":"git@github.com:ChadKillingsworth/vulcanize.git","clone_url":"https://github.com/ChadKillingsworth/vulcanize.git","svn_url":"https://github.com/ChadKillingsworth/vulcanize","homepage":"","size":1317,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Polymer:master","ref":"master","sha":"a07820ed9e6ea6c47151c3b30e9fd438d84d5494","user":{"login":"Polymer","id":2159051,"avatar_url":"https://avatars0.githubusercontent.com/u/2159051?v=3","gravatar_id":"","url":"https://api.github.com/users/Polymer","html_url":"https://github.com/Polymer","followers_url":"https://api.github.com/users/Polymer/followers","following_url":"https://api.github.com/users/Polymer/following{/other_user}","gists_url":"https://api.github.com/users/Polymer/gists{/gist_id}","starred_url":"https://api.github.com/users/Polymer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polymer/subscriptions","organizations_url":"https://api.github.com/users/Polymer/orgs","repos_url":"https://api.github.com/users/Polymer/repos","events_url":"https://api.github.com/users/Polymer/events{/privacy}","received_events_url":"https://api.github.com/users/Polymer/received_events","type":"Organization","site_admin":false},"repo":{"id":13599100,"name":"polymer-bundler","full_name":"Polymer/polymer-bundler","owner":{"login":"Polymer","id":2159051,"avatar_url":"https://avatars0.githubusercontent.com/u/2159051?v=3","gravatar_id":"","url":"https://api.github.com/users/Polymer","html_url":"https://github.com/Polymer","followers_url":"https://api.github.com/users/Polymer/followers","following_url":"https://api.github.com/users/Polymer/following{/other_user}","gists_url":"https://api.github.com/users/Polymer/gists{/gist_id}","starred_url":"https://api.github.com/users/Polymer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polymer/subscriptions","organizations_url":"https://api.github.com/users/Polymer/orgs","repos_url":"https://api.github.com/users/Polymer/repos","events_url":"https://api.github.com/users/Polymer/events{/privacy}","received_events_url":"https://api.github.com/users/Polymer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Polymer/polymer-bundler","description":"Build tool for HTMLImports and Web Components","fork":false,"url":"https://api.github.com/repos/Polymer/polymer-bundler","forks_url":"https://api.github.com/repos/Polymer/polymer-bundler/forks","keys_url":"https://api.github.com/repos/Polymer/polymer-bundler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Polymer/polymer-bundler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Polymer/polymer-bundler/teams","hooks_url":"https://api.github.com/repos/Polymer/polymer-bundler/hooks","issue_events_url":"https://api.github.com/repos/Polymer/polymer-bundler/issues/events{/number}","events_url":"https://api.github.com/repos/Polymer/polymer-bundler/events","assignees_url":"https://api.github.com/repos/Polymer/polymer-bundler/assignees{/user}","branches_url":"https://api.github.com/repos/Polymer/polymer-bundler/branches{/branch}","tags_url":"https://api.github.com/repos/Polymer/polymer-bundler/tags","blobs_url":"https://api.github.com/repos/Polymer/polymer-bundler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Polymer/polymer-bundler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Polymer/polymer-bundler/git/refs{/sha}","trees_url":"https://api.github.com/repos/Polymer/polymer-bundler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Polymer/polymer-bundler/statuses/{sha}","languages_url":"https://api.github.com/repos/Polymer/polymer-bundler/languages","stargazers_url":"https://api.github.com/repos/Polymer/polymer-bundler/stargazers","contributors_url":"https://api.github.com/repos/Polymer/polymer-bundler/contributors","subscribers_url":"https://api.github.com/repos/Polymer/polymer-bundler/subscribers","subscription_url":"https://api.github.com/repos/Polymer/polymer-bundler/subscription","commits_url":"https://api.github.com/repos/Polymer/polymer-bundler/commits{/sha}","git_commits_url":"https://api.github.com/repos/Polymer/polymer-bundler/git/commits{/sha}","comments_url":"https://api.github.com/repos/Polymer/polymer-bundler/comments{/number}","issue_comment_url":"https://api.github.com/repos/Polymer/polymer-bundler/issues/comments{/number}","contents_url":"https://api.github.com/repos/Polymer/polymer-bundler/contents/{+path}","compare_url":"https://api.github.com/repos/Polymer/polymer-bundler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Polymer/polymer-bundler/merges","archive_url":"https://api.github.com/repos/Polymer/polymer-bundler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Polymer/polymer-bundler/downloads","issues_url":"https://api.github.com/repos/Polymer/polymer-bundler/issues{/number}","pulls_url":"https://api.github.com/repos/Polymer/polymer-bundler/pulls{/number}","milestones_url":"https://api.github.com/repos/Polymer/polymer-bundler/milestones{/number}","notifications_url":"https://api.github.com/repos/Polymer/polymer-bundler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Polymer/polymer-bundler/labels{/name}","releases_url":"https://api.github.com/repos/Polymer/polymer-bundler/releases{/id}","deployments_url":"https://api.github.com/repos/Polymer/polymer-bundler/deployments","created_at":"2013-10-15T18:56:20Z","updated_at":"2017-03-10T22:45:11Z","pushed_at":"2017-03-12T03:39:33Z","git_url":"git://github.com/Polymer/polymer-bundler.git","ssh_url":"git@github.com:Polymer/polymer-bundler.git","clone_url":"https://github.com/Polymer/polymer-bundler.git","svn_url":"https://github.com/Polymer/polymer-bundler","homepage":"","size":1301,"stargazers_count":1188,"watchers_count":1188,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":124,"mirror_url":null,"open_issues_count":94,"forks":124,"open_issues":94,"watchers":1188,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Polymer/polymer-bundler/pulls/449"},"html":{"href":"https://github.com/Polymer/polymer-bundler/pull/449"},"issue":{"href":"https://api.github.com/repos/Polymer/polymer-bundler/issues/449"},"comments":{"href":"https://api.github.com/repos/Polymer/polymer-bundler/issues/449/comments"},"review_comments":{"href":"https://api.github.com/repos/Polymer/polymer-bundler/pulls/449/comments"},"review_comment":{"href":"https://api.github.com/repos/Polymer/polymer-bundler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Polymer/polymer-bundler/pulls/449/commits"},"statuses":{"href":"https://api.github.com/repos/Polymer/polymer-bundler/statuses/df1f8b3d746c4cedeb7da63d1ec6ef166e6ed2f8"}}}}
{"actor":{"display_login":"ChadKillingsworth"}}