Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Issue 699569 Mojo JS bindings: change module loading from AMD to <script> tag
Starred by 1 user Project Member Reported by yzshen@chromium.org, Mar 8 Back to list
Status: Started
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment
.
 
Project Member Comment 1 by bugdroid1@chromium.org, Mar 8
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e3c870b6d13a2b5a55deba853b04ad328fc4bc6b

commit e3c870b6d13a2b5a55deba853b04ad328fc4bc6b
Author: yzshen <yzshen@chromium.org>
Date: Wed Mar 08 18:06:52 2017

Mojo JS bindings: duplicate the bindings files into src/mojo/public/js/new_bindings.

New module-loading approach will be developed on this copy. The original code
will be removed after all user code is switched to the new approach.

BUG=699569

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

[add] https://crrev.com/e3c870b6d13a2b5a55deba853b04ad328fc4bc6b/mojo/public/js/new_bindings/bindings.js
[add] https://crrev.com/e3c870b6d13a2b5a55deba853b04ad328fc4bc6b/mojo/public/js/new_bindings/buffer.js
[add] https://crrev.com/e3c870b6d13a2b5a55deba853b04ad328fc4bc6b/mojo/public/js/new_bindings/codec.js
[add] https://crrev.com/e3c870b6d13a2b5a55deba853b04ad328fc4bc6b/mojo/public/js/new_bindings/connector.js
[add] https://crrev.com/e3c870b6d13a2b5a55deba853b04ad328fc4bc6b/mojo/public/js/new_bindings/interface_types.js
[add] https://crrev.com/e3c870b6d13a2b5a55deba853b04ad328fc4bc6b/mojo/public/js/new_bindings/lib/control_message_handler.js
[add] https://crrev.com/e3c870b6d13a2b5a55deba853b04ad328fc4bc6b/mojo/public/js/new_bindings/lib/control_message_proxy.js
[add] https://crrev.com/e3c870b6d13a2b5a55deba853b04ad328fc4bc6b/mojo/public/js/new_bindings/router.js
[add] https://crrev.com/e3c870b6d13a2b5a55deba853b04ad328fc4bc6b/mojo/public/js/new_bindings/unicode.js
[add] https://crrev.com/e3c870b6d13a2b5a55deba853b04ad328fc4bc6b/mojo/public/js/new_bindings/validator.js

Project Member Comment 2 by bugdroid1@chromium.org, Yesterday (41 hours ago)
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/628771d2f70705a9aba44a5f994dafdac9fd61ea

commit 628771d2f70705a9aba44a5f994dafdac9fd61ea
Author: yzshen <yzshen@chromium.org>
Date: Sat Mar 25 07:24:06 2017

Layout tests: Enable fetching generated files from the build directory.

This CL allows URLs that start with "file:///gen/" to be mapped to the files in "<build_dir>/gen/".

One use case is to allow loading generated mojom.js files using <script> tag. (We are already loading those generated mojom.js files, but using a special JS function exposed to the testing environment for AMD-style module loading. This CL is a cleaner approach.)

BUG=699569
TBR=jam@chromium.org
(jam@ delegated to other reviewers)

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

[modify] https://crrev.com/628771d2f70705a9aba44a5f994dafdac9fd61ea/content/shell/browser/layout_test/blink_test_controller.cc
[modify] https://crrev.com/628771d2f70705a9aba44a5f994dafdac9fd61ea/content/shell/common/layout_test.mojom
[modify] https://crrev.com/628771d2f70705a9aba44a5f994dafdac9fd61ea/content/shell/renderer/layout_test/blink_test_runner.cc

Project Member Comment 3 by bugdroid1@chromium.org, Yesterday (32 hours ago)
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0

commit e6a5534bb3fe61b5224f1a22e43ba957190ad5d0
Author: yzshen <yzshen@chromium.org>
Date: Sat Mar 25 15:59:50 2017

Mojo JS bindings: change module loading solution.

This change takes place on the mojo/public/js/new_bindings copy so it doesn't
affect existing users.

- This change gets rid of AMD module loading. Now the bindings API is defined in
the "mojoBindings" namespace. At build time, all bindings files are combined
into a single file "mojo_bindings.js". Users should use <script> tag to include
this file (as well as generated mojom.js files).

- Generated mojom.js files export their definitions under the same namespace as
the "module" statement in the corresponding mojom files.

- This change also adds a "use_new_js_bindings" option to the generator. It
  duplicates the control message mojom files in order to generate two
  different flavors of JS bindings.

- The new bindings use the Mojo system API defined by Web IDL.

BUG=699569

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

[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/interfaces/bindings/BUILD.gn
[add] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/interfaces/bindings/new_bindings/OWNERS
[add] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/interfaces/bindings/new_bindings/interface_control_messages.mojom
[add] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/interfaces/bindings/new_bindings/pipe_control_messages.mojom
[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/interfaces/bindings/tests/BUILD.gn
[add] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/interfaces/bindings/tests/echo.mojom
[add] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/interfaces/bindings/tests/echo_import.mojom
[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/js/BUILD.gn
[add] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/js/new_bindings/base.js
[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/js/new_bindings/bindings.js
[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/js/new_bindings/buffer.js
[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/js/new_bindings/codec.js
[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/js/new_bindings/connector.js
[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/js/new_bindings/interface_types.js
[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/js/new_bindings/lib/control_message_handler.js
[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/js/new_bindings/lib/control_message_proxy.js
[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/js/new_bindings/router.js
[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/js/new_bindings/unicode.js
[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/js/new_bindings/validator.js
[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/tools/bindings/generators/js_templates/module.amd.tmpl
[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/tools/bindings/generators/js_templates/module_definition.tmpl
[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/tools/bindings/generators/mojom_js_generator.py
[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/tools/bindings/mojom.gni
[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/tools/bindings/mojom_bindings_generator.py
[modify] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/mojo/public/tools/bindings/pylib/mojom/generate/generator.py
[add] https://crrev.com/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0/third_party/WebKit/LayoutTests/mojo/module-loading.html

Sign in to add a comment