Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ea3ec51

Browse files
committedJun 8, 2020
Fix dynamic requires
1 parent 32f1283 commit ea3ec51

File tree

1 file changed

+35
-17
lines changed

1 file changed

+35
-17
lines changed
 

‎lib/runtime.js

+35-17
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,43 @@
11
'use babel'
22
import { CompositeDisposable, Disposable } from 'atom';
33

4-
// TODO Fix all of these dynamic requires and circular dependencies
4+
// TODO use babel to export ... from ...
5+
import modules from './runtime/modules'
6+
import * as environments from './runtime/environments'
7+
import evaluation from './runtime/evaluation'
8+
import * as console from './runtime/console'
9+
import completions from './runtime/completions'
10+
import workspace from './runtime/workspace'
11+
import plots from './runtime/plots'
12+
import * as frontend from './runtime/frontend'
13+
import * as debug from './runtime/debugger'
14+
import * as profiler from './runtime/profiler'
15+
import * as outline from './runtime/outline'
16+
import * as linter from './runtime/linter'
17+
import * as packages from './runtime/packages'
18+
import debuginfo from './runtime/debuginfo'
19+
import * as formatter from './runtime/formatter'
20+
import goto from './runtime/goto'
521

622
export default {
7-
modules: require('./runtime/modules'),
8-
environments: require('./runtime/environments'),
9-
evaluation: require('./runtime/evaluation'),
10-
console: require('./runtime/console'),
11-
completions: require('./runtime/completions'),
12-
workspace: require('./runtime/workspace'),
13-
plots: require('./runtime/plots'),
14-
frontend: require('./runtime/frontend'),
15-
debugger: require('./runtime/debugger'),
16-
profiler: require('./runtime/profiler'),
17-
outline: require('./runtime/outline'),
18-
linter: require('./runtime/linter'),
19-
packages: require('./runtime/packages'),
20-
debuginfo: require('./runtime/debuginfo'),
21-
formatter: require('./runtime/formatter'),
22-
goto: require('./runtime/goto'),
23+
// TODO remove these from the export default and export them directly (prevents expensive copy)
24+
// TODO don't use this.message use message directly (prevents expensive copy)
25+
modules: modules,
26+
environments: environments,
27+
evaluation: evaluation,
28+
console: console,
29+
completions: completions,
30+
workspace: workspace,
31+
plots: plots,
32+
frontend: frontend,
33+
debugger: debug,
34+
profiler: profiler,
35+
outline: outline,
36+
linter: linter,
37+
packages: packages,
38+
debuginfo: debuginfo,
39+
formatter: formatter,
40+
goto: goto,
2341

2442
activate() {
2543
this.subs = new CompositeDisposable();

0 commit comments

Comments
 (0)