PDF Plugin: Compile JS with Closure compiler |
|||||||||||||
Issue descriptionIt 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/.
,
May 10 2017
,
May 10 2017
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.
,
May 11 2017
Thanks! I'll setup the initial compilation target shortly.
,
May 11 2017
Initial dummy setup is at https://codereview.chromium.org/2879543002.
,
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
,
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.
,
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!
,
May 17 2017
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.
,
May 19 2017
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.
,
May 19 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d2d647796babde3b2c5648e72b146d08d7e5c40d commit d2d647796babde3b2c5648e72b146d08d7e5c40d Author: dpapad <dpapad@chromium.org> Date: Fri May 19 02:30:38 2017 Type check PDF plugin JS code, down to 53 errors. BUG=721073 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Review-Url: https://codereview.chromium.org/2892623002 Cr-Commit-Position: refs/heads/master@{#473038} [modify] https://crrev.com/d2d647796babde3b2c5648e72b146d08d7e5c40d/chrome/browser/resources/pdf/navigator.js [modify] https://crrev.com/d2d647796babde3b2c5648e72b146d08d7e5c40d/chrome/browser/resources/pdf/open_pdf_params_parser.js [modify] https://crrev.com/d2d647796babde3b2c5648e72b146d08d7e5c40d/chrome/browser/resources/pdf/toolbar_manager.js [modify] https://crrev.com/d2d647796babde3b2c5648e72b146d08d7e5c40d/chrome/browser/resources/pdf/viewport.js [modify] https://crrev.com/d2d647796babde3b2c5648e72b146d08d7e5c40d/chrome/browser/resources/pdf/viewport_scroller.js
,
May 19 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3856b1d2931d37cef28514af93c291fbfc4d4eb2 commit 3856b1d2931d37cef28514af93c291fbfc4d4eb2 Author: dpapad <dpapad@chromium.org> Date: Fri May 19 17:58:41 2017 WebUI: Add externs from chrome.mimeHandlerPrivate API. BUG=721073 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Review-Url: https://codereview.chromium.org/2896433002 Cr-Commit-Position: refs/heads/master@{#473243} [modify] https://crrev.com/3856b1d2931d37cef28514af93c291fbfc4d4eb2/extensions/common/api/PRESUBMIT.py [modify] https://crrev.com/3856b1d2931d37cef28514af93c291fbfc4d4eb2/third_party/closure_compiler/externs/compiled_resources2.gyp [add] https://crrev.com/3856b1d2931d37cef28514af93c291fbfc4d4eb2/third_party/closure_compiler/externs/mime_handler_private.js
,
May 23 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d8ec752daeb8bd6815a87a6d41e40c8a98f257d4 commit d8ec752daeb8bd6815a87a6d41e40c8a98f257d4 Author: dpapad <dpapad@chromium.org> Date: Tue May 23 20:14:22 2017 PDF Plugin: Add compile targets for a few files. - gesture_detector - open_pdf_params_parser - pdf_scripting_api - viewport_scroller BUG=721073 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Review-Url: https://codereview.chromium.org/2886943006 Cr-Commit-Position: refs/heads/master@{#474025} [modify] https://crrev.com/d8ec752daeb8bd6815a87a6d41e40c8a98f257d4/chrome/browser/resources/pdf/compiled_resources2.gyp [modify] https://crrev.com/d8ec752daeb8bd6815a87a6d41e40c8a98f257d4/chrome/browser/resources/pdf/gesture_detector.js [modify] https://crrev.com/d8ec752daeb8bd6815a87a6d41e40c8a98f257d4/chrome/browser/resources/pdf/open_pdf_params_parser.js [modify] https://crrev.com/d8ec752daeb8bd6815a87a6d41e40c8a98f257d4/third_party/closure_compiler/compiled_resources2.gyp
,
May 25 2017
FYI remaining progress is blocked on https://codereview.chromium.org/2905553002, which rolls a new version of Closure compiler, with update externs definitions.
,
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
,
Jun 1 2017
,
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
,
Oct 7 2017
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.
,
Oct 7 2017
,
Oct 10 2017
per #3 sending over to thestig, since it sounds like compiler is setup.
,
Oct 17 2017
Someone somewhere is laughing because they know how weak my JS-fu is.
,
Oct 18 2017
I'll add it to my plate and see where it goes.
,
Oct 18 2017
,
Sep 4
Setting PDF bugs assigned to me back to untriaged so they can get re-assigned as needed.
,
Sep 5
|
|||||||||||||
►
Sign in to add a comment |
|||||||||||||
Comment 1 by dpa...@chromium.org
, May 10 2017