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
merged 1 commit into from
Mar 7, 2017

Conversation

JiaLiPassion
Copy link
Collaborator

@JiaLiPassion JiaLiPassion commented Mar 2, 2017

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 JiaLiPassion force-pushed the bluebird branch 3 times, most recently from ad37464 to 3bd9daa Compare March 2, 2017 16:03
@mhevery mhevery force-pushed the master branch 12 times, most recently from b55b4ad to f3b8885 Compare March 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)});
Copy link
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
Collaborator Author

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:master Mar 7, 2017
@JiaLiPassion JiaLiPassion deleted the bluebird branch March 17, 2017 03:45
Sign up for free to 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