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 @@
import("//third_party/closure_compiler/compile_js.gni")
js_type_check("closure_compile") {
uses_js_modules = true
deps = [ ":domain_reliability_internals" ]
}
js_library("domain_reliability_internals") {
deps = [
"//third_party/jstemplate:jstemplate",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:util",
"//ui/webui/resources/js:cr.m",
"//ui/webui/resources/js:util.m",
]
}
......@@ -4,12 +4,7 @@
<meta charset="utf-8">
<link rel="stylesheet" href="chrome://resources/css/text_defaults.css">
<link rel="stylesheet" href="domain_reliability_internals.css">
<script src="chrome://resources/js/assert.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>
<script type="module" src="domain_reliability_internals.js"></script>
</head>
<body>
<div id="template">
......
......@@ -2,20 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
cr.define('DomainReliabilityInternals', function() {
'use strict';
import 'chrome://resources/js/jstemplate_compiled.js';
function initialize() {
cr.sendWithPromise('updateData').then(data => {
jstProcess(new JsEvalContext(data), $('template'));
});
}
import {sendWithPromise} from 'chrome://resources/js/cr.m.js';
import {$} from 'chrome://resources/js/util.m.js';
// Return an object with all of the exports.
return {
initialize: initialize,
};
document.addEventListener('DOMContentLoaded', function() {
sendWithPromise('updateData').then(data => {
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