Commit 7ff900a2 authored by dpapad's avatar dpapad Committed by Chromium LUCI CQ

WebUI: Migrate domain_reliability_internals to JS modules.

Bug: 1028829
Change-Id: Ib72761c7cafa6ec574fafebaf39d4c38e23a31c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2616970
Commit-Queue: dpapad <dpapad@chromium.org>
Reviewed-by: default avatarJohn Lee <johntlee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841970}
parent a33e78ad
...@@ -5,13 +5,14 @@ ...@@ -5,13 +5,14 @@
import("//third_party/closure_compiler/compile_js.gni") import("//third_party/closure_compiler/compile_js.gni")
js_type_check("closure_compile") { js_type_check("closure_compile") {
uses_js_modules = true
deps = [ ":domain_reliability_internals" ] deps = [ ":domain_reliability_internals" ]
} }
js_library("domain_reliability_internals") { js_library("domain_reliability_internals") {
deps = [ deps = [
"//third_party/jstemplate:jstemplate", "//third_party/jstemplate:jstemplate",
"//ui/webui/resources/js:cr", "//ui/webui/resources/js:cr.m",
"//ui/webui/resources/js:util", "//ui/webui/resources/js:util.m",
] ]
} }
...@@ -4,12 +4,7 @@ ...@@ -4,12 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="chrome://resources/css/text_defaults.css"> <link rel="stylesheet" href="chrome://resources/css/text_defaults.css">
<link rel="stylesheet" href="domain_reliability_internals.css"> <link rel="stylesheet" href="domain_reliability_internals.css">
<script src="chrome://resources/js/assert.js"></script> <script type="module" src="domain_reliability_internals.js"></script>
<script src="chrome://resources/js/promise_resolver.js"></script>
<script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/util.js"></script>
<script src="chrome://resources/js/jstemplate_compiled.js"></script>
<script src="domain_reliability_internals.js"></script>
</head> </head>
<body> <body>
<div id="template"> <div id="template">
......
...@@ -2,20 +2,13 @@ ...@@ -2,20 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
cr.define('DomainReliabilityInternals', function() { import 'chrome://resources/js/jstemplate_compiled.js';
'use strict';
function initialize() { import {sendWithPromise} from 'chrome://resources/js/cr.m.js';
cr.sendWithPromise('updateData').then(data => { import {$} from 'chrome://resources/js/util.m.js';
jstProcess(new JsEvalContext(data), $('template'));
});
}
// Return an object with all of the exports. document.addEventListener('DOMContentLoaded', function() {
return { sendWithPromise('updateData').then(data => {
initialize: initialize, jstProcess(new JsEvalContext(data), $('template'));
}; });
}); });
document.addEventListener(
'DOMContentLoaded', DomainReliabilityInternals.initialize);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment