New issue
Advanced search Search tips

Issue 711706 link

Starred by 26 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 31
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Task

Blocked on:
issue 594639

Blocking:
issue v8:5785



Sign in to add a comment

Implement dynamic import

Project Member Reported by gsat...@chromium.org, Apr 14 2017

Issue description

Change description:

Implement the import() function-like form for dynamically loading JavaScript modules in Blink

Changes to API surface:

A new JavaScript syntactic form, import(), will be available

Links:

Public standards discussion:
 - https://github.com/tc39/proposal-dynamic-import
 - https://tc39.github.io/proposal-dynamic-import/
 - https://github.com/tc39/proposal-dynamic-import/blob/master/HTML%20Integration.md
 - https://github.com/whatwg/html/issues/2315

Corresponding V8 side bug (completed): https://bugs.chromium.org/p/v8/issues/detail?id=5785.

Support in other browsers:
- Edge: public support; not implemented
- Firefox: public support; not implemented
- Safari: implemented and shipping in Safari Tech Preview
 
Blocking: v8:5785

Comment 2 by kouhei@chromium.org, Apr 15 2017

Cc: module-dev@chromium.org

Comment 3 by kouhei@chromium.org, Apr 15 2017

Blockedon: 594639
Blocking: -594639
Components: Blink>HTML>Script
Labels: OS-All
Owner: kouhei@chromium.org
Status: Started (was: Untriaged)
Labels: -Type-Feature OWP-Standards-OfficialSpec OWP-Type-NewAPI OWP-Design-No M-62 Type-Launch-OWP
Description: Show this description
Project Member

Comment 7 by bugdroid1@chromium.org, Aug 7 2017

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

commit daa1b9e45d911a5e15b4c4a0f9e668f07d739974
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Mon Aug 07 10:20:22 2017

[ES6 modules] Add ScriptModule::V8Namespace

This CL introduces V8 binding for v8::Module::GetModuleNamespace(), which
will be used to resolve dynamic import promise.

Bug:  711706 
Change-Id: I2b2249c02d40fa340cc7b0f3db7d07bde16d0f8e
Reviewed-on: https://chromium-review.googlesource.com/602101
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#492288}
[modify] https://crrev.com/daa1b9e45d911a5e15b4c4a0f9e668f07d739974/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp
[modify] https://crrev.com/daa1b9e45d911a5e15b4c4a0f9e668f07d739974/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h
[modify] https://crrev.com/daa1b9e45d911a5e15b4c4a0f9e668f07d739974/third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp

Comment 8 by kouhei@chromium.org, Aug 16 2017

Cc: gsat...@chromium.org
 Issue 755869  has been merged into this issue.
Project Member

Comment 9 by bugdroid1@chromium.org, Aug 21 2017

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

commit e12884119f3c6fc1b9aea87428d98ff3b75727ad
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Mon Aug 21 11:14:19 2017

[ES6 modules] Update ScriptModuleTest.Evaluate to verify module namespace object

This CL updates ScriptModuleTest.Evaluate to actually verify that exported variable from script has a set value.

Bug:  711706 
Change-Id: I0e57f46ec7e615b94f0a979a22ac943c6d3ff37a
Reviewed-on: https://chromium-review.googlesource.com/622111
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495911}
[modify] https://crrev.com/e12884119f3c6fc1b9aea87428d98ff3b75727ad/third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp

Project Member

Comment 10 by bugdroid1@chromium.org, Sep 5 2017

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

commit 08445c2cf77f2e2f2849704f7df22448ff8c15bc
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Tue Sep 05 03:58:30 2017

[ES6 modules] Introduce --enable-module-scripts-dynamic-import

This CL introduces a new flag "--enable-module-scripts-dynamic-import", which will enable:
- import() syntax support in V8, and
- dynamic import() implementation in Blink.
Future CLs which implement these features will be gated through this command-line flag.

For details, please see Intent-to-Implement thread:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/wRLMM5-kpCY

Bug:  711706 
Change-Id: Iabca29e52ea87e84f5bfd414f217cbbdf55f77b4
Reviewed-on: https://chromium-review.googlesource.com/625514
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499553}
[modify] https://crrev.com/08445c2cf77f2e2f2849704f7df22448ff8c15bc/chrome/browser/about_flags.cc
[modify] https://crrev.com/08445c2cf77f2e2f2849704f7df22448ff8c15bc/chrome/browser/flag_descriptions.cc
[modify] https://crrev.com/08445c2cf77f2e2f2849704f7df22448ff8c15bc/chrome/browser/flag_descriptions.h
[modify] https://crrev.com/08445c2cf77f2e2f2849704f7df22448ff8c15bc/content/child/runtime_features.cc
[modify] https://crrev.com/08445c2cf77f2e2f2849704f7df22448ff8c15bc/content/public/common/content_features.cc
[modify] https://crrev.com/08445c2cf77f2e2f2849704f7df22448ff8c15bc/content/public/common/content_features.h
[modify] https://crrev.com/08445c2cf77f2e2f2849704f7df22448ff8c15bc/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5
[modify] https://crrev.com/08445c2cf77f2e2f2849704f7df22448ff8c15bc/third_party/WebKit/Source/platform/exported/WebRuntimeFeatures.cpp
[modify] https://crrev.com/08445c2cf77f2e2f2849704f7df22448ff8c15bc/third_party/WebKit/public/platform/WebRuntimeFeatures.h
[modify] https://crrev.com/08445c2cf77f2e2f2849704f7df22448ff8c15bc/tools/metrics/histograms/enums.xml

Labels: migrated-launch-owp Type-Task
This issue has been automatically relabelled type=task because type=launch-owp issues are now officially deprecated. The deprecation is because they were creating confusion about how to get launch approvals, which should be instead done via type=launch issues.

We recommend this issue be used for implementation tracking (for public visibility), but if you already have an issue for that, you may mark this as duplicate.

For more details see here: https://docs.google.com/document/d/1JA6RohjtZQc26bTrGoIE_bSXGXUDQz8vc6G0n_sZJ2o/edit

For any questions, please contact owencm, sshruthi, larforge
Project Member

Comment 12 by bugdroid1@chromium.org, Sep 15 2017

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

commit a788bcd802e5ef17eb5a02b23bff3698281f70dd
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Fri Sep 15 06:51:05 2017

[ES6 modules] Introduce ReferrerScriptInfo

This CL implements ReferrerScriptInfo, which holds a copy of "referencing
script" info, referenced in the "HostImportModuleDynamically" algorithm:
https://github.com/tc39/proposal-dynamic-import/blob/master/HTML%20Integration.md#hostimportmoduledynamicallyreferencingscriptormodule-specifier-promisecapability

This info can be encoded into v8::Local<v8::PrimitiveArray> and will be
attached to v8::ScriptOrigin in future CLs. Dynamic import resolver will
extract this from the ScriptOrigin of the referencing script in its
implementation of "HostImportModuleDynamically" algorithm.

Bug:  711706 
Change-Id: I0649b6f0334154cdde910a657eee449b39f5f9c7
Reviewed-on: https://chromium-review.googlesource.com/668257
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502176}
[modify] https://crrev.com/a788bcd802e5ef17eb5a02b23bff3698281f70dd/third_party/WebKit/Source/bindings/bindings.gni
[add] https://crrev.com/a788bcd802e5ef17eb5a02b23bff3698281f70dd/third_party/WebKit/Source/bindings/core/v8/ReferrerScriptInfo.cpp
[add] https://crrev.com/a788bcd802e5ef17eb5a02b23bff3698281f70dd/third_party/WebKit/Source/bindings/core/v8/ReferrerScriptInfo.h
[add] https://crrev.com/a788bcd802e5ef17eb5a02b23bff3698281f70dd/third_party/WebKit/Source/bindings/core/v8/ReferrerScriptInfoTest.cpp

Project Member

Comment 13 by bugdroid1@chromium.org, Sep 20 2017

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

commit 9b7ad685a8220d59aaba1d51fc3e56413302b5a0
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Wed Sep 20 01:25:47 2017

[ES6 modules] Update V8ScriptRunner::Compile{Script,Module} to set ReferrerScriptInfo

This CL adds ReferrerScriptInfo arg to V8ScriptRunner::Compile{Script,Module}, and the method will set the ReferrerScriptInfo specified to v8::ScriptOrigin.
This CL also modifies module script compilation pipeline to plumb down the ReferrerScriptInfo up to V8ScriptRunner::CompileModule.

V8ScriptRunner::CompileScript will be modified in future CLs.

Bug:  711706 
Change-Id: I7787e5c59af34d86cae8dbbb8677e1eadf49d44d
Reviewed-on: https://chromium-review.googlesource.com/668337
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503019}
[modify] https://crrev.com/9b7ad685a8220d59aaba1d51fc3e56413302b5a0/third_party/WebKit/Source/bindings/core/v8/ReferrerScriptInfo.cpp
[modify] https://crrev.com/9b7ad685a8220d59aaba1d51fc3e56413302b5a0/third_party/WebKit/Source/bindings/core/v8/ReferrerScriptInfo.h
[modify] https://crrev.com/9b7ad685a8220d59aaba1d51fc3e56413302b5a0/third_party/WebKit/Source/bindings/core/v8/ReferrerScriptInfoTest.cpp
[modify] https://crrev.com/9b7ad685a8220d59aaba1d51fc3e56413302b5a0/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp
[modify] https://crrev.com/9b7ad685a8220d59aaba1d51fc3e56413302b5a0/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h
[modify] https://crrev.com/9b7ad685a8220d59aaba1d51fc3e56413302b5a0/third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp
[modify] https://crrev.com/9b7ad685a8220d59aaba1d51fc3e56413302b5a0/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
[modify] https://crrev.com/9b7ad685a8220d59aaba1d51fc3e56413302b5a0/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h
[modify] https://crrev.com/9b7ad685a8220d59aaba1d51fc3e56413302b5a0/third_party/WebKit/Source/core/dom/Modulator.h
[modify] https://crrev.com/9b7ad685a8220d59aaba1d51fc3e56413302b5a0/third_party/WebKit/Source/core/dom/ModulatorImplBase.cpp
[modify] https://crrev.com/9b7ad685a8220d59aaba1d51fc3e56413302b5a0/third_party/WebKit/Source/core/dom/ModulatorImplBase.h
[modify] https://crrev.com/9b7ad685a8220d59aaba1d51fc3e56413302b5a0/third_party/WebKit/Source/core/dom/ModuleScript.cpp
[modify] https://crrev.com/9b7ad685a8220d59aaba1d51fc3e56413302b5a0/third_party/WebKit/Source/core/dom/ScriptModuleResolverImplTest.cpp
[modify] https://crrev.com/9b7ad685a8220d59aaba1d51fc3e56413302b5a0/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderTest.cpp
[modify] https://crrev.com/9b7ad685a8220d59aaba1d51fc3e56413302b5a0/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinkerTest.cpp
[modify] https://crrev.com/9b7ad685a8220d59aaba1d51fc3e56413302b5a0/third_party/WebKit/Source/core/testing/DummyModulator.cpp
[modify] https://crrev.com/9b7ad685a8220d59aaba1d51fc3e56413302b5a0/third_party/WebKit/Source/core/testing/DummyModulator.h

Project Member

Comment 14 by bugdroid1@chromium.org, Sep 20 2017

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

commit c7a7ce3a7d9d243947f2b3cd50013a658122617d
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Wed Sep 20 08:14:45 2017

[ES6 modules] WPT: Add basic dynamic import test case

This CL adds a very basic dynamic import test case for modules.
It is "expected to fail" until we land the entire implementation.

Bug:  711706 
Change-Id: I39e31701c6df08859a19d8457b367eadb7089001
Reviewed-on: https://chromium-review.googlesource.com/674424
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503084}
[modify] https://crrev.com/c7a7ce3a7d9d243947f2b3cd50013a658122617d/third_party/WebKit/LayoutTests/TestExpectations
[add] https://crrev.com/c7a7ce3a7d9d243947f2b3cd50013a658122617d/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports.html
[modify] https://crrev.com/c7a7ce3a7d9d243947f2b3cd50013a658122617d/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/imports-a.js

Project Member

Comment 15 by bugdroid1@chromium.org, Sep 20 2017

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

commit 7f2eeeb0f085b1cfe28986ce2a2961cf4b5d3055
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Wed Sep 20 10:34:54 2017

[ES6 modules] Enable V8 dynamic import syntax when the feature is enabled

This CL enables "--harmony-dynamic-import" when kModuleScriptsDynamicImport
feature is enabled, and plumbs the V8 callback for HostImportModuleDynamically
to blink::Modulator.

Bug:  711706 
Change-Id: I46ae646f340adb86c025750d0dd51bd122141cb9
Reviewed-on: https://chromium-review.googlesource.com/674406
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Kinuko Yasuda (slow) <kinuko@chromium.org>
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503102}
[modify] https://crrev.com/7f2eeeb0f085b1cfe28986ce2a2961cf4b5d3055/content/renderer/render_process_impl.cc
[modify] https://crrev.com/7f2eeeb0f085b1cfe28986ce2a2961cf4b5d3055/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
[modify] https://crrev.com/7f2eeeb0f085b1cfe28986ce2a2961cf4b5d3055/third_party/WebKit/Source/core/dom/Modulator.h
[modify] https://crrev.com/7f2eeeb0f085b1cfe28986ce2a2961cf4b5d3055/third_party/WebKit/Source/core/dom/ModulatorImplBase.cpp
[modify] https://crrev.com/7f2eeeb0f085b1cfe28986ce2a2961cf4b5d3055/third_party/WebKit/Source/core/dom/ModulatorImplBase.h
[modify] https://crrev.com/7f2eeeb0f085b1cfe28986ce2a2961cf4b5d3055/third_party/WebKit/Source/core/testing/DummyModulator.cpp
[modify] https://crrev.com/7f2eeeb0f085b1cfe28986ce2a2961cf4b5d3055/third_party/WebKit/Source/core/testing/DummyModulator.h

Project Member

Comment 16 by bugdroid1@chromium.org, Sep 21 2017

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

commit 056417169cf186dc2c1564d39963a70de3257aba
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Thu Sep 21 05:01:58 2017

Dedupe: use "WebScriptSource::operator ScriptSourceCode()" where possible

This CL dedupes custom WebScriptSource -> ScriptSourceCode conversion and
make them all use "WebScriptSource::operator ScriptSourceCode()".

Bug:  711706 
Change-Id: Ifef70136505d5aba2a10ae66814a2ab90085922d
Reviewed-on: https://chromium-review.googlesource.com/676703
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503355}
[modify] https://crrev.com/056417169cf186dc2c1564d39963a70de3257aba/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp

Project Member

Comment 17 by bugdroid1@chromium.org, Sep 21 2017

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

commit 79ba387aee6a457ab9f6896a227d759c4de1b89b
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Thu Sep 21 05:13:01 2017

Make ScriptReferrerInfo non-optional for 2 overloads of V8ScriptRunner::CompileScript

ScriptReferrerInfo should be passed explicitly for all invocation of
V8ScriptRunner::CompileScript.  This CL partially addresses the issue by making
the ScriptReferrerInfo argument non-optional for its 2 overloads.

A follow-up CL is planned to fix the last overload of the V8ScriptRunner::CompileScript.

Bug:  711706 
Change-Id: Idf883bac5174ad856176b895ca47ae7b9704e964
Reviewed-on: https://chromium-review.googlesource.com/676603
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503358}
[modify] https://crrev.com/79ba387aee6a457ab9f6896a227d759c4de1b89b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
[modify] https://crrev.com/79ba387aee6a457ab9f6896a227d759c4de1b89b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h
[modify] https://crrev.com/79ba387aee6a457ab9f6896a227d759c4de1b89b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunnerTest.cpp
[modify] https://crrev.com/79ba387aee6a457ab9f6896a227d759c4de1b89b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp

Project Member

Comment 18 by bugdroid1@chromium.org, Sep 22 2017

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

commit d4c912f9895cd2120c9f9f032bc09ddd4f2bdaf7
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Fri Sep 22 03:49:20 2017

[ES6 modules] WPT: dynamically imported modules from valid nonce should eval

This CL adds web-platform-tests that verify dynamically imported modules
from {out-of-line,inline} {classic,module} script w/ a valid nonce should eval.

Bug:  711706 
Change-Id: Ifff153f2da31163eb8f74f0493fa7594d6ebdc4f
Reviewed-on: https://chromium-review.googlesource.com/674471
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503644}
[modify] https://crrev.com/d4c912f9895cd2120c9f9f032bc09ddd4f2bdaf7/third_party/WebKit/LayoutTests/TestExpectations
[add] https://crrev.com/d4c912f9895cd2120c9f9f032bc09ddd4f2bdaf7/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-external-classic.html
[add] https://crrev.com/d4c912f9895cd2120c9f9f032bc09ddd4f2bdaf7/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-external-module.html
[add] https://crrev.com/d4c912f9895cd2120c9f9f032bc09ddd4f2bdaf7/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-external.js
[add] https://crrev.com/d4c912f9895cd2120c9f9f032bc09ddd4f2bdaf7/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-inline-classic.html
[add] https://crrev.com/d4c912f9895cd2120c9f9f032bc09ddd4f2bdaf7/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-inline-module.html

Project Member

Comment 19 by bugdroid1@chromium.org, Sep 22 2017

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

commit d40e5de77a5e0f2614ea1ece0a4f76b0da965ec7
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Fri Sep 22 09:22:23 2017

[ES6 modules] Implement run-a-module-script with "rethrow errors" flag

This CL updates the run-a-module-script HTML spec algorithm with its new
argument "rethrow errors" flag, which is used from dynamic imports.

With this CL, ScriptModule::Evaluate takes another argument
CaptureEvalErrorFlag, and allows the caller to capture the error instead
of "report the error" algorithm.

Bug:  711706 
Change-Id: I4653e2cbfdc523b6711173b5ff1ae3dfffbaf80f
Reviewed-on: https://chromium-review.googlesource.com/677995
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503696}
[modify] https://crrev.com/d40e5de77a5e0f2614ea1ece0a4f76b0da965ec7/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp
[modify] https://crrev.com/d40e5de77a5e0f2614ea1ece0a4f76b0da965ec7/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h
[modify] https://crrev.com/d40e5de77a5e0f2614ea1ece0a4f76b0da965ec7/third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp
[modify] https://crrev.com/d40e5de77a5e0f2614ea1ece0a4f76b0da965ec7/third_party/WebKit/Source/core/dom/Modulator.h
[modify] https://crrev.com/d40e5de77a5e0f2614ea1ece0a4f76b0da965ec7/third_party/WebKit/Source/core/dom/ModulatorImplBase.cpp
[modify] https://crrev.com/d40e5de77a5e0f2614ea1ece0a4f76b0da965ec7/third_party/WebKit/Source/core/dom/ModulatorImplBase.h
[modify] https://crrev.com/d40e5de77a5e0f2614ea1ece0a4f76b0da965ec7/third_party/WebKit/Source/core/testing/DummyModulator.cpp
[modify] https://crrev.com/d40e5de77a5e0f2614ea1ece0a4f76b0da965ec7/third_party/WebKit/Source/core/testing/DummyModulator.h

Project Member

Comment 20 by bugdroid1@chromium.org, Sep 25 2017

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

commit 180489ebe22b335487c03a99603b11c0e467d75f
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Mon Sep 25 10:03:23 2017

[ES6 modules] Implement DynamicModuleResolver

This CL introduces DynamicModuleResolver, which implements
"Runtime Semantics: HostImportModuleDynamically" interface in TC39 proposal:
https://tc39.github.io/proposal-dynamic-import/#sec-hostimportmoduledynamically

The implemented algorithm follows the spec proposal:
https://github.com/whatwg/html/pull/3044

Bug:  711706 
Change-Id: I847d70e902368b99721dca528404724cc170cc4a
Reviewed-on: https://chromium-review.googlesource.com/623041
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504019}
[modify] https://crrev.com/180489ebe22b335487c03a99603b11c0e467d75f/third_party/WebKit/Source/core/BUILD.gn
[modify] https://crrev.com/180489ebe22b335487c03a99603b11c0e467d75f/third_party/WebKit/Source/core/dom/BUILD.gn
[add] https://crrev.com/180489ebe22b335487c03a99603b11c0e467d75f/third_party/WebKit/Source/core/dom/DynamicModuleResolver.cpp
[add] https://crrev.com/180489ebe22b335487c03a99603b11c0e467d75f/third_party/WebKit/Source/core/dom/DynamicModuleResolver.h
[add] https://crrev.com/180489ebe22b335487c03a99603b11c0e467d75f/third_party/WebKit/Source/core/dom/DynamicModuleResolverTest.cpp

Project Member

Comment 21 by bugdroid1@chromium.org, Sep 25 2017

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

commit 89c4a1850f017fa691ad06b4eace97a10c93bd94
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Mon Sep 25 12:51:27 2017

[ES6 modules] Plumb V8 host callbacks to DynamicModuleResolver

This CL plumbs the V8 callback for "Runtime Semantics: HostImportModuleDynamically"
to DynamicModuleResolver.
With this CL, basic usage of dynamic imports should work when
--enable-features=ModuleScriptsDynamicImport.

Tests: external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/*
Bug:  711706 
Change-Id: I7aef3fe56ee3e4f516d139f27858bff8e0d6faac
Reviewed-on: https://chromium-review.googlesource.com/676364
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504036}
[modify] https://crrev.com/89c4a1850f017fa691ad06b4eace97a10c93bd94/third_party/WebKit/Source/core/dom/ModulatorImplBase.cpp
[modify] https://crrev.com/89c4a1850f017fa691ad06b4eace97a10c93bd94/third_party/WebKit/Source/core/dom/ModulatorImplBase.h

Project Member

Comment 23 by bugdroid1@chromium.org, Sep 29 2017

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

commit 4e3e2998d214b6d8a0a009ca71b623d09f187b9e
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Fri Sep 29 03:53:57 2017

[ES6 modules] enable dynamic import by default

Intent-to-ship thread w/ 3 lgtms:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/ut-Mr0jt5X8/Q8B4F3wxBQAJ

Bug:  711706 
Change-Id: Ib28083a8473fb74a1f6222c4c6cf84d9a810564a
Reviewed-on: https://chromium-review.googlesource.com/691394
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505288}
[modify] https://crrev.com/4e3e2998d214b6d8a0a009ca71b623d09f187b9e/content/public/common/content_features.cc

Project Member

Comment 24 by bugdroid1@chromium.org, Oct 2 2017

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

commit 9da284ba7ab742893cba73c1078908eac5d3a6d1
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Mon Oct 02 05:23:46 2017

[ES6 modules] ResolveDynamically should plumb URL through KURL not WTFString

Bug:  711706 
Change-Id: I15be3aa6d19d1c3c7bebb4841fd42e9419ba9894
Reviewed-on: https://chromium-review.googlesource.com/691375
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505540}
[modify] https://crrev.com/9da284ba7ab742893cba73c1078908eac5d3a6d1/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
[modify] https://crrev.com/9da284ba7ab742893cba73c1078908eac5d3a6d1/third_party/WebKit/Source/core/dom/DynamicModuleResolver.cpp
[modify] https://crrev.com/9da284ba7ab742893cba73c1078908eac5d3a6d1/third_party/WebKit/Source/core/dom/DynamicModuleResolver.h
[modify] https://crrev.com/9da284ba7ab742893cba73c1078908eac5d3a6d1/third_party/WebKit/Source/core/dom/DynamicModuleResolverTest.cpp
[modify] https://crrev.com/9da284ba7ab742893cba73c1078908eac5d3a6d1/third_party/WebKit/Source/core/dom/Modulator.h
[modify] https://crrev.com/9da284ba7ab742893cba73c1078908eac5d3a6d1/third_party/WebKit/Source/core/dom/ModulatorImplBase.cpp
[modify] https://crrev.com/9da284ba7ab742893cba73c1078908eac5d3a6d1/third_party/WebKit/Source/core/dom/ModulatorImplBase.h
[modify] https://crrev.com/9da284ba7ab742893cba73c1078908eac5d3a6d1/third_party/WebKit/Source/core/testing/DummyModulator.cpp
[modify] https://crrev.com/9da284ba7ab742893cba73c1078908eac5d3a6d1/third_party/WebKit/Source/core/testing/DummyModulator.h

Project Member

Comment 25 by bugdroid1@chromium.org, Oct 2 2017

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

commit 299fab12a65f713e06de6efccf8245be4f391380
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Mon Oct 02 07:22:55 2017

ScriptSourceCode: Carry nonce/parser_state

This CL adds ScriptSourceCode::{nonce_,parser_state_}, which are used to
carry the corresponding <script> element's nonce attr value and whether
the element was parser inserted or not.

The added nonce/parser_state is stored in V8 via
ScriptReferrerInfo/V8::ScriptOrigin when compiling the script.

This CL also removes obsolete DCHECK in V8ScriptRunner::CompileScript which
assumes classic scripts to be always fetch credentials mode "omit", as the
corresponding spec text was removed in latest spec.

Bug:  711706 
Change-Id: I4abcb90d0567c303635a00c01b838d60b02c1f54
Reviewed-on: https://chromium-review.googlesource.com/676605
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505550}
[modify] https://crrev.com/299fab12a65f713e06de6efccf8245be4f391380/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/299fab12a65f713e06de6efccf8245be4f391380/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp
[modify] https://crrev.com/299fab12a65f713e06de6efccf8245be4f391380/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.h
[modify] https://crrev.com/299fab12a65f713e06de6efccf8245be4f391380/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp
[modify] https://crrev.com/299fab12a65f713e06de6efccf8245be4f391380/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
[modify] https://crrev.com/299fab12a65f713e06de6efccf8245be4f391380/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp
[modify] https://crrev.com/299fab12a65f713e06de6efccf8245be4f391380/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
[modify] https://crrev.com/299fab12a65f713e06de6efccf8245be4f391380/third_party/WebKit/Source/core/dom/ScriptLoader.h
[modify] https://crrev.com/299fab12a65f713e06de6efccf8245be4f391380/third_party/WebKit/Source/core/exported/WebScriptSource.cpp
[modify] https://crrev.com/299fab12a65f713e06de6efccf8245be4f391380/third_party/WebKit/Source/core/loader/WorkletScriptLoader.cpp

Project Member

Comment 26 by bugdroid1@chromium.org, Oct 2 2017

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

commit 275b48370a35ab8a0dc2fab885e05b8c2c8386fc
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Mon Oct 02 16:37:01 2017

[ES6 modules] import should not crash when used inside inline event handler

Before this CL, dynamic import from non-script tag has failed DCHECK().
This CL fixes the crash and makes it refer document.URL for resolving relative URLs.

Bug:  711706 
Change-Id: Ibb862c99054a30c054d3b2eb35799f76d52b56bd
Reviewed-on: https://chromium-review.googlesource.com/689357
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505641}
[modify] https://crrev.com/275b48370a35ab8a0dc2fab885e05b8c2c8386fc/third_party/WebKit/LayoutTests/TestExpectations
[add] https://crrev.com/275b48370a35ab8a0dc2fab885e05b8c2c8386fc/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/inline-event-handler.html
[modify] https://crrev.com/275b48370a35ab8a0dc2fab885e05b8c2c8386fc/third_party/WebKit/Source/core/dom/DynamicModuleResolver.cpp
[modify] https://crrev.com/275b48370a35ab8a0dc2fab885e05b8c2c8386fc/third_party/WebKit/Source/core/dom/DynamicModuleResolverTest.cpp

Project Member

Comment 27 by bugdroid1@chromium.org, Oct 11 2017

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

commit f7bd4ce21651472a01877af861a6ec582e6f778f
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Wed Oct 11 10:50:42 2017

[ES6 modules] Remove VirtualTestSuites for dynamic imports

They no longer need to be virtual tests since we have enabled dynamic
imports by default.

Bug:  711706 , 773622
Change-Id: I4d4eb4838694ef947ab3ca795a2b6848b9d2d04f
Reviewed-on: https://chromium-review.googlesource.com/711537
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#507942}
[modify] https://crrev.com/f7bd4ce21651472a01877af861a6ec582e6f778f/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/f7bd4ce21651472a01877af861a6ec582e6f778f/third_party/WebKit/LayoutTests/VirtualTestSuites
[delete] https://crrev.com/961817f7c152c667729417f4aedebd8602df042e/third_party/WebKit/LayoutTests/virtual/dynamic-import/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/README.txt

Labels: -M-62 M-63
Status: Fixed (was: Started)
Dynamic import has been shipped since M63:
https://www.chromestatus.com/feature/5684934484164608
Project Member

Comment 29 by bugdroid1@chromium.org, Oct 1

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

commit 14d350d474272ad31b29d5b4897c9b1deba2ff52
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Mon Oct 01 02:36:27 2018

[ES6 modules] Enable dynamic import and import.meta by default without feature flags

Retire the flags now that it is very unlikely we'll revert them.

Bug:  711706 ,  773713 
Change-Id: I854c5be068b42ef5fb58fe23f45ba1af107ece9a
Reviewed-on: https://chromium-review.googlesource.com/1250681
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595371}
[modify] https://crrev.com/14d350d474272ad31b29d5b4897c9b1deba2ff52/chrome/browser/about_flags.cc
[modify] https://crrev.com/14d350d474272ad31b29d5b4897c9b1deba2ff52/content/child/runtime_features.cc
[modify] https://crrev.com/14d350d474272ad31b29d5b4897c9b1deba2ff52/content/public/common/content_features.cc
[modify] https://crrev.com/14d350d474272ad31b29d5b4897c9b1deba2ff52/content/public/common/content_features.h
[modify] https://crrev.com/14d350d474272ad31b29d5b4897c9b1deba2ff52/content/renderer/render_process_impl.cc
[modify] https://crrev.com/14d350d474272ad31b29d5b4897c9b1deba2ff52/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
[modify] https://crrev.com/14d350d474272ad31b29d5b4897c9b1deba2ff52/third_party/blink/renderer/platform/exported/web_runtime_features.cc
[modify] https://crrev.com/14d350d474272ad31b29d5b4897c9b1deba2ff52/third_party/blink/renderer/platform/runtime_enabled_features.json5

Project Member

Comment 30 by bugdroid1@chromium.org, Oct 17

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

commit d3888464b0adb2e905a60d50041ab2639c47971b
Author: Hiroki Nakagawa <nhiroki@chromium.org>
Date: Wed Oct 17 04:51:24 2018

ES Modules: Remove unnecessary flags for ES Modules

This CL removes unnecessary flags and descriptions for import.meta and
dynamic import.

- import.meta was shipped in M64:
https://www.chromestatus.com/feature/5637509807603712
- dynamic import was shipped in M63:
https://www.chromestatus.com/feature/5684934484164608

Bonus: This change stops running duplicate virtual tests for import.meta.

Bug:  711706 ,  773713 
Cq-Include-Trybots: luci.chromium.try:linux-blink-gen-property-trees;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: If4de7343f0c5d6b449e50804de6254eb9cc191d0
Reviewed-on: https://chromium-review.googlesource.com/c/1285493
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600279}
[modify] https://crrev.com/d3888464b0adb2e905a60d50041ab2639c47971b/chrome/browser/flag_descriptions.cc
[modify] https://crrev.com/d3888464b0adb2e905a60d50041ab2639c47971b/chrome/browser/flag_descriptions.h
[modify] https://crrev.com/d3888464b0adb2e905a60d50041ab2639c47971b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-gen-property-trees
[modify] https://crrev.com/d3888464b0adb2e905a60d50041ab2639c47971b/third_party/WebKit/LayoutTests/VirtualTestSuites
[delete] https://crrev.com/2a94e36850459037c558613bc5292047567ccdf4/third_party/WebKit/LayoutTests/virtual/import-meta-url/external/wpt/html/semantics/scripting-1/the-script-element/module/import-meta/README.txt
[modify] https://crrev.com/d3888464b0adb2e905a60d50041ab2639c47971b/third_party/blink/public/platform/web_runtime_features.h

Project Member

Comment 31 by bugdroid1@chromium.org, Nov 2

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

commit 1457da0fd307988608aee177b13ec9527c56dbe9
Author: Kouhei Ueno <kouhei@chromium.org>
Date: Fri Nov 02 05:53:28 2018

UseCounter: Count dynamic import usage

Bug:  711706 
Change-Id: I46271b96329d45d4b2ad6ad0988490dcad98943e
Reviewed-on: https://chromium-review.googlesource.com/c/1314013
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604851}
[modify] https://crrev.com/1457da0fd307988608aee177b13ec9527c56dbe9/third_party/blink/public/platform/web_feature.mojom
[modify] https://crrev.com/1457da0fd307988608aee177b13ec9527c56dbe9/third_party/blink/renderer/core/script/modulator_impl_base.cc
[modify] https://crrev.com/1457da0fd307988608aee177b13ec9527c56dbe9/tools/metrics/histograms/enums.xml

Sign in to add a comment