feat(router): adds the router to the self-executing bundle.
Due to limitation of system build, the router cannot have its own sfx bundle. Fixes an issue with RouteConfig decorator by moving it into its own file.
This commit is contained in:
		
							parent
							
								
									f5b56c627b
								
							
						
					
					
						commit
						8e1d53b5e9
					
				
							
								
								
									
										10
									
								
								gulpfile.js
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								gulpfile.js
									
									
									
									
									
								
							| @ -616,8 +616,6 @@ gulp.task('bundle.js.dev', ['build.js.dev'], function() { | ||||
|       { sourceMaps: true }); | ||||
| }); | ||||
| 
 | ||||
| // TODO: remove redundancies with router and angular bundles
 | ||||
| // development router build
 | ||||
| gulp.task('router.bundle.js.dev', ['build.js.dev'], function() { | ||||
|   var devBundleConfig = merge(true, bundleConfig); | ||||
|   devBundleConfig.paths = | ||||
| @ -626,8 +624,8 @@ gulp.task('router.bundle.js.dev', ['build.js.dev'], function() { | ||||
|     }); | ||||
|   return bundler.bundle( | ||||
|     devBundleConfig, | ||||
|     'angular2/router', | ||||
|     './dist/build/router.dev.js', | ||||
|     'angular2/router - angular2/angular2', | ||||
|     './dist/bundle/router.dev.js', | ||||
|     { sourceMaps: true }); | ||||
| }); | ||||
| 
 | ||||
| @ -647,7 +645,7 @@ gulp.task('bundle.js.sfx.dev', ['build.js.dev'], function() { | ||||
|       'angular2/angular2_sfx', | ||||
|       './dist/build/angular2.sfx.dev.js', | ||||
|       { sourceMaps: true }, | ||||
|       /* self-exectuting */ true); | ||||
|       /* self-executing */ true); | ||||
| }); | ||||
| 
 | ||||
| gulp.task('bundle.js.prod.deps', ['bundle.js.prod'], function() { | ||||
| @ -669,14 +667,12 @@ var JS_DEV_DEPS = ['node_modules/zone.js/zone.js', | ||||
| gulp.task('bundle.js.dev.deps', ['bundle.js.dev'], function() { | ||||
|   return bundler.modify(JS_DEV_DEPS.concat(['dist/build/angular2.dev.js']), 'angular2.dev.js') | ||||
|       .pipe(insert.append('\nSystem.config({"paths":{"*":"*.js","angular2/*":"angular2/*"}});\n')) | ||||
|       .pipe(insert.append('\nzone = zone.fork(Zone.longStackTraceZone);\n')) | ||||
|       .pipe(gulp.dest('dist/bundle')); | ||||
| }); | ||||
| 
 | ||||
| gulp.task('bundle.js.sfx.dev.deps', ['bundle.js.sfx.dev'], function() { | ||||
|   return bundler.modify(JS_DEV_DEPS.concat(['dist/build/angular2.sfx.dev.js']), | ||||
|                         'angular2.sfx.dev.js') | ||||
|       .pipe(insert.append('\nzone = zone.fork(Zone.longStackTraceZone);\n')) | ||||
|       .pipe(gulp.dest('dist/bundle')); | ||||
| }); | ||||
| 
 | ||||
|  | ||||
| @ -1,4 +1,10 @@ | ||||
| import * as angular from './angular2'; | ||||
| // the router should have its own SFX bundle  | ||||
| // But currently the module arithemtic 'angular2/router_sfx - angular2/angular2', | ||||
| // is not support by system builder. | ||||
| import * as router from './router'; | ||||
| 
 | ||||
| angular.router = router; | ||||
| 
 | ||||
| var _prevAngular = window.angular; | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										3
									
								
								modules/angular2/router.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								modules/angular2/router.js
									
									
									
									
										vendored
									
									
								
							| @ -10,7 +10,8 @@ export {Router} from './src/router/router'; | ||||
| export {RouterOutlet} from './src/router/router_outlet'; | ||||
| export {RouterLink} from './src/router/router_link'; | ||||
| export {RouteParams} from './src/router/instruction'; | ||||
| export {RouteConfig} from './src/router/route_config_annotation'; | ||||
| export * from './src/router/route_config_annotation'; | ||||
| export * from './src/router/route_config_decorator'; | ||||
| 
 | ||||
| import {Router, RootRouter} from './src/router/router'; | ||||
| import {RouteRegistry} from './src/router/route_registry'; | ||||
|  | ||||
| @ -1,5 +1 @@ | ||||
| export {RouteConfig as RouteConfigAnnotation} from './route_config_impl'; | ||||
| 
 | ||||
| import {makeDecorator} from 'angular2/src/util/decorators'; | ||||
| 
 | ||||
| export var RouteConfig = makeDecorator(RouteConfig); | ||||
|  | ||||
							
								
								
									
										3
									
								
								modules/angular2/src/router/route_config_decorator.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								modules/angular2/src/router/route_config_decorator.dart
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| library angular2.router.route_config_decorator; | ||||
| 
 | ||||
| /** This file is intentionally empty, as Dart does not have decorators */ | ||||
							
								
								
									
										5
									
								
								modules/angular2/src/router/route_config_decorator.es6
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								modules/angular2/src/router/route_config_decorator.es6
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | ||||
| import {RouteConfig as RouteConfigAnnotation} from './route_config_impl'; | ||||
| import {makeDecorator} from 'angular2/src/util/decorators'; | ||||
| 
 | ||||
| export var RouteConfig = makeDecorator(RouteConfigAnnotation); | ||||
| 
 | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user