Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
Merged
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
8 changes: 8 additions & 0 deletions example/profiling.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
<meta charset="utf-8">
<title>Zones Profiling</title>
<link rel="stylesheet" href="css/style.css">
<script>
__Zone_disable_Error = true;
__Zone_disable_on_property = true;
__Zone_disable_geolocation = true;
__Zone_disable_toString = true;
__Zone_disable_blocking = true;
__Zone_disable_PromiseRejectionEvent = true;
</script>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mhevery , will we use those flags to decide which modules to load?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is the idea for now. Do you have thoughts or concerns?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mhevery , only the names, should we named those flags as __zone_symbol__disable_toString?

<script src="../dist/zone.js"></script>
<script src="../dist/long-stack-trace-zone.js"></script>
</head>
Expand Down
12 changes: 11 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ gulp.task('build/zone.min.js', ['compile-esm'], function(cb) {
return generateScript('./lib/browser/rollup-main.ts', 'zone.min.js', true, cb);
});

gulp.task('build/zone-error.js', ['compile-esm'], function(cb) {
return generateScript('./lib/common/error-rewrite.ts', 'zone-error.js', false, cb);
});

gulp.task('build/zone-error.min.js', ['compile-esm'], function(cb) {
return generateScript('./lib/common/error-rewrite.ts', 'zone-error.min.js', true, cb);
});

gulp.task('build/webapis-media-query.js', ['compile-esm'], function(cb) {
return generateScript('./lib/browser/webapis-media-query.ts', 'webapis-media-query.js', false, cb);
});
Expand Down Expand Up @@ -179,6 +187,8 @@ gulp.task('build', [
'build/zone.js',
'build/zone.js.d.ts',
'build/zone.min.js',
'build/zone-error.js',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mhevery , got it, I agree that to separate the error-rewrite to a stand alone module!
I will modify the document to decribe how to load zone.js and other stand alone modules(now we have error-rewrite and other non-standard api modules). Just like the flags in add in profiling.html, we may have other stand alone modules (toString, geolocation...).

If we have too many small modules, should we provide some predefined module collections for users to load?
such as standard browser set, standard node set, standard electron set, basic set and so on...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that is my thinking, but i am not sure we should do this just yet. Perhaps disabling things may be good enough for now?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mhevery , got it!

'build/zone-error.min.js',
'build/zone-node.js',
'build/webapis-media-query.js',
'build/webapis-media-query.min.js',
Expand Down Expand Up @@ -293,4 +303,4 @@ gulp.task('promisetest', ['build/zone-node.js'], (cb) => {
cb(err);
}
});
});
});
1 change: 0 additions & 1 deletion lib/browser/rollup-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@

import '../zone';
import '../common/promise';
import '../common/error-rewrite';
import './browser';
1 change: 0 additions & 1 deletion lib/node/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import '../zone';
import '../common/promise';
import '../common/error-rewrite';
import '../common/to-string';
import './events';
import './fs';
Expand Down