New issue
Advanced search Search tips

Issue 898493 link

Starred by 2 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

YAPS: Migrate to official js proto bindings and up-to-date closure compiler

Project Member Reported by pmarko@chromium.org, Oct 24

Issue description

YAPS is using nonstandard js proto bindings and a pretty old closure compiler.

Migrate to
- the official js bindings generated using protoc
- an up-to-date closure compiler.

If we're lucky, this will fix disappearing proto enums on the js side of things, which currently lead to empty fileds in the "Clients" table.
 
Work notes:

Work that needs to be done here:
(1) regenerate model.pb.js. A command line that seems to do something useful for me turned out to be:
protoc --proto_path=$POLICY_SERVER_ROOT/src/gae --js_out=library=model.pb,binary:. model.proto
(I'm using protoc 3.5.1 currently)
(2) Put a matching version of the google-protobuf runtime somewhere in the yaps source tree and pass it to the closure compiler (the model.pb.js gnerated in (2) depends on it). It seems that this should be fine:
pmarko@pmarko0:~/chromium-dm-test/src/protobuf_js_runtime$ ls
arith.js  constants.js  decoder.js  encoder.js  map.js  message.js  reader.js  README  utils.js  writer.js
Those files are from ~/chromium/src/third_party/protobuf/js and ~/chromium/src/third_party/protobuf/js/binary.
(3) Use up to date closure compiler, e.g. https://dl.google.com/closure-compiler/compiler-latest.zip
(4) Migrate stuff. So far I've identified:
(4.1) Change proto bindings class names on the js side of things. The old bindings had names like yaps.model.UserConfig, while the new bindings have proto.yaps.model.UserConfig (and the proto prefix doesn't seem to be optional). Make sure _not_ to change these in the URLs though, as those are treated as DB keys
(4.2) goog.dom.a11y.Role -> goog.a11y.aria.Role (checkbox.js)
(4.3) Optional: change closure compilation command line:
      .../closure-library/closure/bin/build/closurebuilder.py: Closure Compiler now natively understands and orders Closure dependencies and is prefererred over using this script for performing JavaScript compilation. 
      https://github.com/google/closure-compiler/wiki/Managing-Dependencies

Sign in to add a comment