Skip to content

Commit

Permalink
use async import
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Oct 17, 2024
1 parent 151018d commit 187c48b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/@ember/debug/ember-inspector-support/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { VERSION } from '@ember/version';
import Adapters from './adapters';
import MainModule from './main';
import type Adapters from './adapters';
import { guidFor } from '@ember/object/internals';
import { A } from '@ember/array';
import Namespace from '@ember/application/namespace';
Expand All @@ -15,14 +14,15 @@ export function setupEmberInspectorSupport() {
window.addEventListener('ember-inspector-loaded' as any, (event: CustomEvent) => {
const adapter = event.detail.adapter;
const EMBER_VERSIONS_SUPPORTED = event.detail.EMBER_VERSIONS_SUPPORTED;
loadEmberDebug(adapter, EMBER_VERSIONS_SUPPORTED);
void loadEmberDebug(adapter, EMBER_VERSIONS_SUPPORTED);
});

const e = new Event('ember-inspector-support-setup');
window.dispatchEvent(e);
}

function loadEmberDebug(
// eslint-disable-next-line disable-features/disable-async-await
async function loadEmberDebug(
adapter: keyof typeof Adapters,
EMBER_VERSIONS_SUPPORTED: [string, string]
) {
Expand All @@ -32,6 +32,11 @@ function loadEmberDebug(
return;
}

// @ts-ignore

Check warning on line 35 in packages/@ember/debug/ember-inspector-support/index.ts

View workflow job for this annotation

GitHub Actions / Linting

Do not use "@ts-ignore" because it alters compilation errors
const Adapters = await import('./adapters');
// @ts-ignore

Check warning on line 37 in packages/@ember/debug/ember-inspector-support/index.ts

View workflow job for this annotation

GitHub Actions / Linting

Do not use "@ts-ignore" because it alters compilation errors
const MainModule = await import('./main');

if (!versionTest(VERSION, EMBER_VERSIONS_SUPPORTED)) {
// Wrong inspector version. Redirect to the correct version.
sendVersionMiss();
Expand Down
2 changes: 2 additions & 0 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ function legacyBundleConfig(input, output, { isDeveloping, isExternal }) {
file: `dist/${output}`,
generatedCode: 'es2015',
sourcemap: true,
inlineDynamicImports: true,

// We are relying on unfrozen modules because we need to add the
// __esModule marker to them in our amd-compat-entrypoints. Rollup has an
Expand Down Expand Up @@ -273,6 +274,7 @@ function entrypoint(pkg, which) {
return;
}
let resolved = resolve(pkg.root, module);
console.log('entrypoint', module, pkg.name, pkg.root, resolved);

Check failure on line 277 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / Linting

Unexpected console statement
let { dir, base } = parse(resolved);
return {
dir,
Expand Down

0 comments on commit 187c48b

Please sign in to comment.