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, Mar 25
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, Mar 25
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

Project Member Comment 5 by bugdroid1@chromium.org, Mar 27
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ae2b29ed27f84f0209be6f0482f5b85c0578ee75

commit ae2b29ed27f84f0209be6f0482f5b85c0578ee75
Author: hayato <hayato@chromium.org>
Date: Mon Mar 27 08:48:19 2017

Revert of Mojo JS bindings: support auto-loading mojom.js deps. (patchset #3 id:40001 of https://codereview.chromium.org/2779493002/ )

Reason for revert:
It looks we have to revert this CL too in order to revert https://codereview.chromium.org/2759563004/.

The previous revert failed in: https://codereview.chromium.org/2779533002/

Original issue's description:
> Mojo JS bindings: support auto-loading mojom.js deps.
>
> It also adds a config to turn off this behavior.
>
> BUG=699569
>
> Review-Url: https://codereview.chromium.org/2779493002
> Cr-Commit-Position: refs/heads/master@{#459695}
> Committed: https://chromium.googlesource.com/chromium/src/+/e326a5d409dadb3df6811b3dca7f1cfecb4ef520

TBR=rockot@chromium.org,yzshen@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=699569

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

[modify] https://crrev.com/ae2b29ed27f84f0209be6f0482f5b85c0578ee75/mojo/public/js/new_bindings/base.js
[modify] https://crrev.com/ae2b29ed27f84f0209be6f0482f5b85c0578ee75/mojo/public/tools/bindings/generators/js_templates/module.amd.tmpl
[modify] https://crrev.com/ae2b29ed27f84f0209be6f0482f5b85c0578ee75/mojo/public/tools/bindings/generators/mojom_js_generator.py
[delete] https://crrev.com/f988185f6973f485ef5aeed2cc1b6e38797359bd/third_party/WebKit/LayoutTests/mojo/module-loading-manual-deps-loading.html
[modify] https://crrev.com/ae2b29ed27f84f0209be6f0482f5b85c0578ee75/third_party/WebKit/LayoutTests/mojo/module-loading.html

Project Member Comment 6 by bugdroid1@chromium.org, Mar 27
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/06cde11f9f3843eb13e3d3d73296a07e9e8601f5

commit 06cde11f9f3843eb13e3d3d73296a07e9e8601f5
Author: hayato <hayato@chromium.org>
Date: Mon Mar 27 10:55:09 2017

Revert of Mojo JS bindings: change module loading solution. (patchset #7 id:120001 of https://codereview.chromium.org/2759563004/ )

Reason for revert:
Consistent failure: webkit_tests failing on 6 builders

33 since the first detection
e.g. https://uberchromegw.corp.google.com/i/chromium.webkit/builders/WebKit%20Mac10.10

This CL is suspicious because mojo/module-loading.html has been failing.

https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.webkit%2FWebKit_Mac10.10%2F31815%2F%2B%2Frecipes%2Fsteps%2Fwebkit_tests%2F0%2Fstdout

Regressions: Unexpected text-only failures (1)
  mojo/module-loading.html [ Failure ]

09:20:53.708 5958 worker/0 virtual/mojo-loading/http/tests/bluetooth/https/requestDevice/cross-origin-iframe.html output stderr lines:
09:20:53.709 5958   [09:20:53.354] vtDecompressionDuctCreate signalled err=-8973 (err) (Could not select and open decoder instance) at /SourceCache/CoreMedia_frameworks/CoreMedia-1562.235/Sources/VideoToolbox/VTDecompressionSession.c line 1181
09:20:53.709 5958   <<<< VTVideoEncoderSelection >>>> VTSelectAndCreateVideoEncoderInstanceInternal: no video encoder found for 'avc1'

Original issue's description:
> 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}
> Committed: https://chromium.googlesource.com/chromium/src/+/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0

TBR=rockot@chromium.org,dcheng@chromium.org,alokp@chromium.org,yzshen@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=699569

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

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

Project Member Comment 7 by bugdroid1@chromium.org, Apr 2
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a06469911359843f3d823fac7a7c06fec3c46edb

commit a06469911359843f3d823fac7a7c06fec3c46edb
Author: yzshen <yzshen@chromium.org>
Date: Sun Apr 02 22:01:27 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 "mojo" 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-Original-Commit-Position: refs/heads/master@{#459654}
Committed: https://chromium.googlesource.com/chromium/src/+/e6a5534bb3fe61b5224f1a22e43ba957190ad5d0
Review-Url: https://codereview.chromium.org/2759563004
Cr-Commit-Position: refs/heads/master@{#461349}

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

Sign in to add a comment