New issue
Advanced search Search tips

Issue 721073 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 3
Type: Feature

Blocked on:
issue 728733



Sign in to add a comment

PDF Plugin: Compile JS with Closure compiler

Project Member Reported by dpa...@chromium.org, May 10 2017

Issue description

It seems that we are currently not compiling (type-checking) the PDF plugin's JS code at https://cs.chromium.org/chromium/src/chrome/browser/resources/pdf/.
 

Comment 1 by dpa...@chromium.org, May 10 2017

Description: Show this description

Comment 2 by dbeam@chromium.org, May 10 2017

Cc: dsinclair@chromium.org tsergeant@chromium.org raymes@chromium.org
If someone wants to set up Closure compiler and leave the rule commented out like we did for print preview, I can then help fix it up.

Comment 4 by dpa...@chromium.org, May 11 2017

Thanks! I'll setup the initial compilation target shortly.

Comment 5 by dpa...@chromium.org, May 11 2017

Initial dummy setup is at https://codereview.chromium.org/2879543002.
Project Member

Comment 6 by bugdroid1@chromium.org, May 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/367dcbb346040d38334453592c0f61d827a00cae

commit 367dcbb346040d38334453592c0f61d827a00cae
Author: dpapad <dpapad@chromium.org>
Date: Wed May 17 03:42:53 2017

PDF Plugin: Add dummy JS compilation target.

- Uncomment line at third_party/closure_compiler/compiled_resources2.gyp:36
- Execute ./third_party/closure_compiler/run_compiler main

The dummy compilation target will facilitate the work needed to
fully type check the PDF Plugin's JS codebase.

BUG=721073
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2879543002
Cr-Commit-Position: refs/heads/master@{#472309}

[add] https://crrev.com/367dcbb346040d38334453592c0f61d827a00cae/chrome/browser/resources/pdf/compiled_resources2.gyp
[modify] https://crrev.com/367dcbb346040d38334453592c0f61d827a00cae/third_party/closure_compiler/compiled_resources2.gyp

Comment 7 by dpa...@chromium.org, May 17 2017

FYI, attempted to start adding individual compile targets for each file at https://codereview.chromium.org/2892623002, but started hitting circular dependencies unfortunately (viewport -> zoom_manager -> viewport).

Wondering if a better approach is to just create a single target for main.js and have a flat list of all transitive dependencies (I think this would work around the circular deps, without having to restructure the code). Will try that too.

Comment 8 by dpa...@chromium.org, May 17 2017

Patch2 at https://codereview.chromium.org/2892623002 shows the alternate approach of using a flat list. No circular deps problem anymore, down to 79 errors and 3 warnings!

Comment 9 by dpa...@chromium.org, May 17 2017

Owner: dpa...@chromium.org
Status: Started (was: Available)
I'll give it a shot to fix the most obvious errors first. Might need to delegate to someone more knowledgeable about the PDF codebase for more obscure errors.
Cc: mcnee@chromium.org
Status update:
 1) Some errors being fixed at https://codereview.chromium.org/2892623002, no compile targets added yet.
 2) Some compile targets being added at https://codereview.chromium.org/2886943006.
 3) Adding externs for chrome.mimeHandlerPrivate API at https://codereview.chromium.org/2896433002 (necessary to compile browser_api.js).
 4) w3c_pointerlock.js externs included in Closure compiler's default externs at https://github.com/google/closure-compiler/issues/2502.
 5) chrome.tabs setZoom,getZoom,setZoomSettings,getZoomSettings externs being added to Closure compiler, WIP (necessary for browser_api.js).

After steps 4 and 5 a new Closure compiler version needs to be rolled to Chromium. Still have not addressed circular dependencies problems.
Project Member

Comment 13 by bugdroid1@chromium.org, May 23 2017

FYI remaining progress is blocked on https://codereview.chromium.org/2905553002, which rolls a new version of Closure compiler, with update externs definitions.
Project Member

Comment 15 by bugdroid1@chromium.org, May 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/062b17c082a63b24de989a5f79c77d6382e1aa15

commit 062b17c082a63b24de989a5f79c77d6382e1aa15
Author: dpapad <dpapad@chromium.org>
Date: Wed May 31 23:43:50 2017

Roll closure compiler

Change log:
https://github.com/google/closure-compiler/compare/ee44867683988d37c9cdb1b5c9557fe984c87135...e061fc7bd4ac37730534828a9484d528fcd80eb5
chrome_extensions.js: f9877b62e50844da51a50374dbc3c98d31d85ce3 -> 927e44d6e32d7b2f50ddb2b20f6515b79a0914b3
polymer-1.0.js: 5b180dcd7e8913c66386a675086b99aaad2f0a53 -> cc53ce238def6597f71ddd75e961011edb18e6a3

R=dbeam@chromium.org
BUG=721073
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2918683002 .
Cr-Commit-Position: refs/heads/master@{#476093}

[modify] https://crrev.com/062b17c082a63b24de989a5f79c77d6382e1aa15/chrome/browser/resources/md_bookmarks/list.js
[modify] https://crrev.com/062b17c082a63b24de989a5f79c77d6382e1aa15/chrome/browser/resources/md_bookmarks/types.js
[modify] https://crrev.com/062b17c082a63b24de989a5f79c77d6382e1aa15/third_party/closure_compiler/README.chromium
[modify] https://crrev.com/062b17c082a63b24de989a5f79c77d6382e1aa15/third_party/closure_compiler/compiler/compiler.jar
[modify] https://crrev.com/062b17c082a63b24de989a5f79c77d6382e1aa15/third_party/closure_compiler/externs/chrome_extensions.js
[modify] https://crrev.com/062b17c082a63b24de989a5f79c77d6382e1aa15/third_party/closure_compiler/externs/polymer-1.0.js

Blockedon: 728733
Project Member

Comment 17 by bugdroid1@chromium.org, Jun 3 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9b2a8220cc2d621aad2a53f704b9ba9cd0ef183e

commit 9b2a8220cc2d621aad2a53f704b9ba9cd0ef183e
Author: dpapad <dpapad@chromium.org>
Date: Sat Jun 03 03:05:57 2017

PDF Plugin: Add compile targets for a few more files.

 - browser_api
 - viewer-bookmark
 - viewer-error-screen
 - viewer-page-indicator
 - viewer-page-selector
 - viewer-password-screen

BUG=721073
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2915773003
Cr-Commit-Position: refs/heads/master@{#476879}

[modify] https://crrev.com/9b2a8220cc2d621aad2a53f704b9ba9cd0ef183e/chrome/browser/resources/pdf/browser_api.js
[modify] https://crrev.com/9b2a8220cc2d621aad2a53f704b9ba9cd0ef183e/chrome/browser/resources/pdf/compiled_resources2.gyp
[add] https://crrev.com/9b2a8220cc2d621aad2a53f704b9ba9cd0ef183e/chrome/browser/resources/pdf/elements/viewer-bookmark/compiled_resources2.gyp
[add] https://crrev.com/9b2a8220cc2d621aad2a53f704b9ba9cd0ef183e/chrome/browser/resources/pdf/elements/viewer-error-screen/compiled_resources2.gyp
[modify] https://crrev.com/9b2a8220cc2d621aad2a53f704b9ba9cd0ef183e/chrome/browser/resources/pdf/elements/viewer-error-screen/viewer-error-screen.js
[add] https://crrev.com/9b2a8220cc2d621aad2a53f704b9ba9cd0ef183e/chrome/browser/resources/pdf/elements/viewer-page-indicator/compiled_resources2.gyp
[modify] https://crrev.com/9b2a8220cc2d621aad2a53f704b9ba9cd0ef183e/chrome/browser/resources/pdf/elements/viewer-page-indicator/viewer-page-indicator.js
[add] https://crrev.com/9b2a8220cc2d621aad2a53f704b9ba9cd0ef183e/chrome/browser/resources/pdf/elements/viewer-page-selector/compiled_resources2.gyp
[modify] https://crrev.com/9b2a8220cc2d621aad2a53f704b9ba9cd0ef183e/chrome/browser/resources/pdf/elements/viewer-page-selector/viewer-page-selector.js
[add] https://crrev.com/9b2a8220cc2d621aad2a53f704b9ba9cd0ef183e/chrome/browser/resources/pdf/elements/viewer-password-screen/compiled_resources2.gyp
[modify] https://crrev.com/9b2a8220cc2d621aad2a53f704b9ba9cd0ef183e/chrome/browser/resources/pdf/elements/viewer-password-screen/viewer-password-screen.js

Status: Available (was: Started)
I am not actively working no this, so marking as Available so others can continue. The basic setup is in place and some files are already being type checked.
Owner: ----
Owner: thestig@chromium.org
Status: Assigned (was: Available)
per #3 sending over to thestig, since it sounds like compiler is setup.
Cc: -raymes@chromium.org -tsergeant@chromium.org
Labels: -Pri-2 OS-Chrome OS-Linux OS-Mac OS-Windows Pri-3
Owner: ----
Status: Available (was: Assigned)
Someone somewhere is laughing because they know how weak my JS-fu is.
Owner: dsinclair@chromium.org
I'll add it to my plate and see where it goes.
Status: Assigned (was: Available)
Owner: ----
Status: Untriaged (was: Assigned)
Setting PDF bugs assigned to me back to untriaged so they can get re-assigned as needed.
Status: Available (was: Untriaged)

Sign in to add a comment