From ea3ec51cadb2c69e132a9f6e51139603be950985 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Mon, 8 Jun 2020 04:07:17 -0500 Subject: [PATCH] Fix dynamic requires --- lib/runtime.js | 52 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/lib/runtime.js b/lib/runtime.js index 21c562b0..665aa461 100644 --- a/lib/runtime.js +++ b/lib/runtime.js @@ -1,25 +1,43 @@ 'use babel' import { CompositeDisposable, Disposable } from 'atom'; -// TODO Fix all of these dynamic requires and circular dependencies +// TODO use babel to export ... from ... +import modules from './runtime/modules' +import * as environments from './runtime/environments' +import evaluation from './runtime/evaluation' +import * as console from './runtime/console' +import completions from './runtime/completions' +import workspace from './runtime/workspace' +import plots from './runtime/plots' +import * as frontend from './runtime/frontend' +import * as debug from './runtime/debugger' +import * as profiler from './runtime/profiler' +import * as outline from './runtime/outline' +import * as linter from './runtime/linter' +import * as packages from './runtime/packages' +import debuginfo from './runtime/debuginfo' +import * as formatter from './runtime/formatter' +import goto from './runtime/goto' export default { - modules: require('./runtime/modules'), - environments: require('./runtime/environments'), - evaluation: require('./runtime/evaluation'), - console: require('./runtime/console'), - completions: require('./runtime/completions'), - workspace: require('./runtime/workspace'), - plots: require('./runtime/plots'), - frontend: require('./runtime/frontend'), - debugger: require('./runtime/debugger'), - profiler: require('./runtime/profiler'), - outline: require('./runtime/outline'), - linter: require('./runtime/linter'), - packages: require('./runtime/packages'), - debuginfo: require('./runtime/debuginfo'), - formatter: require('./runtime/formatter'), - goto: require('./runtime/goto'), + // TODO remove these from the export default and export them directly (prevents expensive copy) + // TODO don't use this.message use message directly (prevents expensive copy) + modules: modules, + environments: environments, + evaluation: evaluation, + console: console, + completions: completions, + workspace: workspace, + plots: plots, + frontend: frontend, + debugger: debug, + profiler: profiler, + outline: outline, + linter: linter, + packages: packages, + debuginfo: debuginfo, + formatter: formatter, + goto: goto, activate() { this.subs = new CompositeDisposable();