Files
react-native-devtools-frontend/front_end/changes/changes-meta.ts
T
Tim van der Lippe 2f1ea1c2ca [module.json extensions] changes
R=andoli@chromium.org

Bug: 1134103
Change-Id: Ic2d249ae33f7e291ff7bdf921e35c92d8f5649ad
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2612853
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
2021-01-13 10:55:43 +00:00

34 lines
1.1 KiB
TypeScript

// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import {ls} from '../platform/platform.js';
import * as Root from '../root/root.js';
import * as UI from '../ui/ui.js';
// eslint-disable-next-line rulesdir/es_modules_import
import type * as Changes from './changes.js';
let loadedChangesModule: (typeof Changes|undefined);
async function loadChangesModule(): Promise<typeof Changes> {
if (!loadedChangesModule) {
// Side-effect import resources in module.json
await Root.Runtime.Runtime.instance().loadModulePromise('changes');
loadedChangesModule = await import('./changes.js');
}
return loadedChangesModule;
}
UI.ViewManager.registerViewExtension({
location: UI.ViewManager.ViewLocationValues.DRAWER_VIEW,
id: 'changes.changes',
title: ls`Changes`,
commandPrompt: 'Show Changes',
persistence: UI.ViewManager.ViewPersistence.CLOSEABLE,
async loadView() {
const Changes = await loadChangesModule();
return Changes.ChangesView.ChangesView.instance();
},
});