Skip to content

Commit 3b8e478

Browse files
committed
tech(systemjs): finally starting to get systemjs and typescript and runtime loading to work together in a manner that I want it to.. took forever
1 parent c24935b commit 3b8e478

File tree

6 files changed

+45
-39
lines changed

6 files changed

+45
-39
lines changed

public/app/app.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ import kbn = require('app/core/utils/kbn');
1717
import angular = require('angular');
1818
import config = require('app/core/config');
1919

20+
import mod from 'app/core/core_module';
21+
console.log(mod);
22+
2023
class GrafanaApp {
2124
registerFunctions: any;
2225
ngModuleDependencies: any[];
@@ -66,7 +69,8 @@ class GrafanaApp {
6669
this.useModule(angular.module(moduleName, []));
6770
});
6871

69-
var preBootRequires = [System.import('app/features/all')];
72+
//var preBootRequires = [System.import('app/features/all')];
73+
var preBootRequires = [];
7074
var pluginModules = config.bootData.pluginModules || [];
7175

7276
// add plugin modules
@@ -76,7 +80,7 @@ class GrafanaApp {
7680

7781
Promise.all(preBootRequires).then(() => {
7882
// disable tool tip animation
79-
$.fn.tooltip.defaults.animation = false;
83+
//$.fn.tooltip.defaults.animation = false;
8084
// bootstrap the app
8185
angular.bootstrap(document, this.ngModuleDependencies).invoke(() => {
8286
_.each(this.preBootModules, module => {

public/app/core/core.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ import * as routes from 'app/core/routes/all';
2828
// export * from './directives/give_focus'
2929
// export * from './filters/filters'
3030

31-
import {Component} from 'angular2/core';
31+
import {Component} from 'vendor/jspm/angular2/core';
3232
console.log(Component);
33+
3334
// console.log(Component);
3435
// // console.log(Component);
3536

public/app/headers/common.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
///<reference path="lodash/lodash.d.ts" />
22
///<reference path="moment/moment.d.ts" />
3+
///<reference path="../../vendor/jspm/angular2/typings/tsd.d.ts" />
4+
///<reference path="../../vendor/jspm/angular2/manual_typings/globals.d.ts" />
35

46
// dummy modules
57
declare module 'app/core/config' {

public/app/jspm.conf.js

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
System.config({
2-
baseURL: "public",
3-
defaultJSExtensions: true,
4-
transpiler: false,
2+
defaultJSExtenions: true,
53
paths: {
6-
moment: 'vendor/moment',
7-
"jquery": "vendor/jquery/dist/jquery.js",
8-
'lodash-src': 'vendor/lodash',
9-
"lodash": 'app/core/lodash_extended',
10-
"angular": "vendor/angular/angular.js",
11-
"bootstrap": "vendor/bootstrap/bootstrap.js",
12-
'angular-route': 'vendor/angular-route/angular-route',
13-
'angular-sanitize': 'vendor/angular-sanitize/angular-sanitize',
14-
"angular-ui": "vendor/angular-ui/ui-bootstrap-tpls.js",
15-
"angular-strap": "vendor/angular-other/angular-strap.js",
16-
"angular-dragdrop": "vendor/angular-native-dragdrop/draganddrop.js",
17-
"angular-bindonce": "vendor/angular-bindonce/bindonce.js",
18-
"spectrum": "vendor/spectrum.js",
19-
"filesaver": "vendor/filesaver.js",
20-
"bootstrap-tagsinput": "vendor/tagsinput/bootstrap-tagsinput.js",
4+
moment: 'public/vendor/moment.js',
5+
"jquery": "public/vendor/jquery/dist/jquery.js",
6+
'lodash-src': 'public/vendor/lodash.js',
7+
"lodash": 'public/app/core/lodash_extended.js',
8+
"angular": "public/vendor/angular/angular.js",
9+
"bootstrap": "public/vendor/bootstrap/bootstrap.js",
10+
'angular-route': 'public/vendor/angular-route/angular-route.js',
11+
'angular-sanitize': 'public/vendor/angular-sanitize/angular-sanitize.js',
12+
"angular-ui": "public/vendor/angular-ui/ui-bootstrap-tpls.js",
13+
"angular-strap": "public/vendor/angular-other/angular-strap.js",
14+
"angular-dragdrop": "public/vendor/angular-native-dragdrop/draganddrop.js",
15+
"angular-bindonce": "public/vendor/angular-bindonce/bindonce.js",
16+
"spectrum": "public/vendor/spectrum.js",
17+
"filesaver": "public/vendor/filesaver.js",
18+
"bootstrap-tagsinput": "public/vendor/tagsinput/bootstrap-tagsinput.js",
2119
"jquery.flot": "vendor/flot/jquery.flot",
2220
"jquery.flot.pie": "vendor/flot/jquery.flot.pie",
2321
"jquery.flot.events": "vendor/flot/jquery.flot.events",
@@ -30,12 +28,15 @@ System.config({
3028
},
3129

3230
packages: {
33-
"js": {
34-
"defaultExtension": "js"
35-
}
31+
app: {
32+
defaultExtension: 'js',
33+
},
3634
},
3735

3836
map: {
37+
'vendor/jspm/angular2': 'angular2',
38+
app: 'public/app',
39+
vendor: 'public/vendor',
3940
},
4041

4142
meta: {

tasks/options/typescript.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ module.exports = function() {
1111
rootDir: 'public/',
1212
sourceRoot: 'public/',
1313
declaration: true,
14-
moduleResolution: 2,
1514
emitDecoratorMetadata: true,
1615
experimentalDecorators: true,
1716
sourceMap: true,

tsconfig.json

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
{
22
"compilerOptions": {
3-
"sourceMap": true,
4-
"declaration": true,
5-
"outDir": "public_gen",
6-
"noImplicitAny": false,
7-
"target": "es5",
8-
"rootDir": "public/",
9-
"module": "system",
10-
"moduleResolution": 2,
11-
"noEmitOnError": true
12-
},
13-
"files": [
14-
"public/app/core/core_module.ts"
15-
]
16-
}
3+
"emitDecoratorMetadata": true,
4+
"experimentalDecorators": true,
5+
"sourceMap": true,
6+
"declaration": true,
7+
"outDir": "public_gen",
8+
"noImplicitAny": false,
9+
"target": "es5",
10+
"rootDir": "public",
11+
"module": "system",
12+
"noEmitOnError": true,
13+
"moduleResolution": "classic"
14+
}
15+
}

0 commit comments

Comments
 (0)