Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

feat(bluebird): patch bluebird promise and treat it as microtask - #655

Merged
mhevery merged 1 commit into
angular:masterfrom
JiaLiPassion:bluebird
Mar 7, 2017
Merged

feat(bluebird): patch bluebird promise and treat it as microtask#655
mhevery merged 1 commit into
angular:masterfrom
JiaLiPassion:bluebird

Conversation

@JiaLiPassion

@JiaLiPassionJiaLiPassion commented Mar 2, 2017

Copy link
Copy Markdown
Collaborator

fix#455.

patch bluebird promise in zone and treat it as microTask,
add testcases for all bluebird APIs.

-usage, node

require('zone-node.js');
const Bluebird = require('bluebird');
require('zone-bluebird.js');
Zone[Zone['__symbol__']('bluebird')](Bluebird);
  • usage, browser
 <script src="zone.js"></script>
<script src="bluebird.js"></script>
<script src="zone-bluebird.js"></script>
<script>
Zone[Zone['__symbol__']('bluebird')](Promise);
</script>

We can simplify those steps to automatically patch Bluebird Promise, if global.Promise is Bluebird, but Bluebird maybe used just as a library (such as by sequelize), so I think patch it explicitly will be much safer.

@JiaLiPassion
JiaLiPassionforce-pushed the bluebird branch 3 times, most recently from ad37464 to 3bd9daaCompareMarch 2, 2017 16:03
@mhevery
mheveryforce-pushed the master branch 12 times, most recently from b55b4ad to f3b8885CompareMarch 7, 2017 18:05
@@ -0,0 +1 @@
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o():"function"==typeof define&&define.amd?define(o):o()}(this,function(){"use strict";!function(e){var o=Zone.__symbol__;Zone[o("bluebird")]=function(e){e.setScheduler(function(e){Zone.current.scheduleMicroTask("bluebird",e)})}}("object"==typeof window&&window||"object"==typeof self&&self||global)}); No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't include dist folder when you create a PR. I will update the dist folder during the release.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

OK, got it, I will remove it.

@mhevery
mhevery merged commit e783bfa into angular:masterMar 7, 2017
@JiaLiPassion
JiaLiPassion deleted the bluebird branch March 17, 2017 03:45
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zone.js conflicts with Bluebird

3 participants

@JiaLiPassion@mhevery@googlebot