Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var gulp = require('gulp');
var gulpPlugins = require('gulp-load-plugins')();
var runSequence = require('run-sequence');
var madge = require('madge');
var merge = require('merge');
var gulpTraceur = require('./tools/transpiler/gulp-traceur');

Expand Down Expand Up @@ -457,6 +458,25 @@ gulp.task('build/format.dart', rundartpackage(gulp, gulpPlugins, {
args: CONFIG.formatDart.args
}));

// ------------
// check circular dependencies in Node.js context
gulp.task('build/checkCircularDependencies', function (done) {
var dependencyObject = madge(CONFIG.dest.js.dev.es6, {
format: 'es6',
paths: [CONFIG.dest.js.dev.es6],
extensions: ['.js', '.es6'],
onParseFile: function(data) {
data.src = data.src.replace(/import \* as/g, "//import * as");
}
});
var circularDependencies = dependencyObject.circular().getArray();
if (circularDependencies.length > 0) {
console.log(circularDependencies);
process.exit(1);
}
done();
});

// ------------------
// web servers
gulp.task('serve.js.dev', jsserve(gulp, gulpPlugins, {
Expand Down Expand Up @@ -623,6 +643,7 @@ gulp.task('build.dart', function(done) {
gulp.task('build.js.dev', function(done) {
runSequence(
['build/transpile.js.dev', 'build/html.js.dev', 'build/copy.js.dev', 'build/multicopy.js.dev.es6'],
'build/checkCircularDependencies',
done
);
});
Expand Down
4 changes: 2 additions & 2 deletions modules/angular2/src/core/compiler/element_binder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import {int, isBlank, BaseException} from 'angular2/src/facade/lang';
import {ProtoElementInjector} from './element_injector';
import {DirectiveMetadata} from './directive_metadata';
import {List, StringMap} from 'angular2/src/facade/collection';
import {ProtoView} from './view';
import * as viewModule from './view';

export class ElementBinder {
protoElementInjector:ProtoElementInjector;
componentDirective:DirectiveMetadata;
viewportDirective:DirectiveMetadata;
textNodeIndices:List<int>;
hasElementPropertyBindings:boolean;
nestedProtoView: ProtoView;
nestedProtoView: viewModule.ProtoView;
events:StringMap;
contentTagSelector:string;
parent:ElementBinder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {DirectiveMetadata} from '../directive_metadata';
import {Decorator, Component, Viewport} from '../../annotations/annotations';
import {ElementBinder} from '../element_binder';
import {ProtoElementInjector} from '../element_injector';
import {ProtoView} from '../view';
import * as viewModule from '../view';
import {dashCaseToCamelCase} from './util';

import {AST} from 'angular2/change_detection';
Expand Down Expand Up @@ -33,7 +33,7 @@ export class CompileElement {
_allDirectives:List<DirectiveMetadata>;
isViewRoot:boolean;
hasBindings:boolean;
inheritedProtoView:ProtoView;
inheritedProtoView:viewModule.ProtoView;
inheritedProtoElementInjector:ProtoElementInjector;
inheritedElementBinder:ElementBinder;
distanceToParentInjector:int;
Expand Down
4 changes: 2 additions & 2 deletions modules/angular2/src/core/compiler/pipeline/compile_step.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {CompileElement} from './compile_element';
import {CompileControl} from './compile_control';
import * as ccModule from './compile_control';

/**
* One part of the compile process.
* Is guaranteed to be called in depth first order
*/
export class CompileStep {
process(parent:CompileElement, current:CompileElement, control:CompileControl) {}
process(parent:CompileElement, current:CompileElement, control:ccModule.CompileControl) {}
}
8 changes: 4 additions & 4 deletions modules/angular2/src/core/compiler/view_container.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ import {Injector} from 'angular2/di';
import * as eiModule from 'angular2/src/core/compiler/element_injector';
import {isPresent, isBlank} from 'angular2/src/facade/lang';
import {EventManager} from 'angular2/src/core/events/event_manager';
import * as ldModule from './shadow_dom_emulation/light_dom';
import {LightDom} from './shadow_dom_emulation/light_dom';

export class ViewContainer {
parentView: viewModule.View;
templateElement;
defaultProtoView: viewModule.ProtoView;
_views: List<viewModule.View>;
_lightDom: ldModule.LightDom;
_lightDom: LightDom;
_eventManager: EventManager;
elementInjector: eiModule.ElementInjector;
appInjector: Injector;
hostElementInjector: eiModule.ElementInjector;
hostLightDom: ldModule.LightDom;
hostLightDom: LightDom;

constructor(parentView: viewModule.View,
templateElement,
Expand All @@ -40,7 +40,7 @@ export class ViewContainer {
this._eventManager = eventManager;
}

hydrate(appInjector: Injector, hostElementInjector: eiModule.ElementInjector, hostLightDom: ldModule.LightDom) {
hydrate(appInjector: Injector, hostElementInjector: eiModule.ElementInjector, hostLightDom: LightDom) {
this.appInjector = appInjector;
this.hostElementInjector = hostElementInjector;
this.hostLightDom = hostLightDom;
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"karma-dart": "^0.2.8",
"karma-jasmine": "^0.2.2",
"lodash": "^2.4.1",
"madge": "mlaval/madge#es6",
"merge": "^1.2.0",
"minimatch": "^2.0.1",
"minimist": "1.1.x",
Expand Down