This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: split zone.js into CJS modules, add zone-microtask.js
BREAKING CHANGES: zone.js as well as *-zone.js files are moved from / to dist/
- Loading branch information
Showing
37 changed files
with
4,438 additions
and
426 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
'use strict'; | ||
|
||
var gulp = require('gulp'); | ||
var browserify = require('browserify'); | ||
var source = require('vinyl-source-stream'); | ||
var rename = require('gulp-rename'); | ||
var uglify = require('gulp-uglify'); | ||
var buffer = require('vinyl-buffer'); | ||
|
||
var distFolder = './dist'; | ||
|
||
function generateBrowserScript(inFile, outFile) { | ||
var b = browserify({ | ||
entries: inFile, | ||
debug: false | ||
}); | ||
|
||
return b | ||
.bundle() | ||
.pipe(source(outFile)) | ||
.pipe(buffer()) | ||
.pipe(gulp.dest(distFolder)) | ||
.pipe(uglify()) | ||
.pipe(rename({ extname: '.min.js' })) | ||
.pipe(gulp.dest(distFolder)); | ||
; | ||
} | ||
|
||
gulp.task('build/zone.js', function() { | ||
return generateBrowserScript('./lib/browser/zone.js', 'zone.js'); | ||
}); | ||
|
||
gulp.task('build/zone-microtask.js', function() { | ||
return generateBrowserScript('./lib/browser/zone-microtask.js', 'zone-microtask.js'); | ||
}); | ||
|
||
gulp.task('build', ['build/zone.js', 'build/zone-microtask.js']); | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict'; | ||
|
||
var core = require('../core'); | ||
var microtask = require('../microtask'); | ||
var browserPatch = require('../patch/browser'); | ||
var es6Promise = require('../ext/es6-promise.js'); | ||
|
||
if (global.Zone) { | ||
console.warn('Zone already exported on window the object!'); | ||
} | ||
|
||
global.Zone = microtask.addMicrotaskSupport(core.Zone); | ||
global.zone = new global.Zone(); | ||
|
||
// Monkey path ẗhe Promise implementation to add support for microtasks | ||
global.Promise = es6Promise.Promise; | ||
|
||
browserPatch.apply(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
var core = require('../core'); | ||
var browserPatch = require('../patch/browser'); | ||
|
||
if (global.Zone) { | ||
console.warn('Zone already exported on window the object!'); | ||
} | ||
|
||
global.Zone = core.Zone; | ||
global.zone = new global.Zone(); | ||
|
||
browserPatch.apply(); |
Oops, something went wrong.