From 32f2b4e573c71cb0cdd3d7c249d42989d42c3dff Mon Sep 17 00:00:00 2001 From: Tiger Oakes Date: Wed, 28 Nov 2018 06:57:05 -0800 Subject: [PATCH] Remove TypeScript-specific static Compress import (#338) Previously, Compress had a static import only used by TypeScript, as the module was loaded dynamically. The type can be replaced with `import().default`. TypeScript 2.9 introduced the ability to use `import()` within type statements. https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html#import-types --- src/components/App/index.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/App/index.tsx b/src/components/App/index.tsx index e28b498e..8a1eb498 100644 --- a/src/components/App/index.tsx +++ b/src/components/App/index.tsx @@ -9,9 +9,6 @@ import '../../lib/SnackBar'; import Intro from '../intro'; import '../custom-els/LoadingSpinner'; -// This is imported for TypeScript only. It isn't used. -import Compress from '../compress'; - const compressPromise = import( /* webpackChunkName: "main-app" */ '../compress', @@ -31,7 +28,7 @@ interface Props {} interface State { file?: File | Fileish; - Compress?: typeof Compress; + Compress?: typeof import('../compress').default; } export default class App extends Component {