airbnb / hypernova

A service for server-side rendering your JavaScript views
MIT License
5.82k stars 208 forks source link

Fix promise global pollution #183

Open kmsheng opened 4 years ago

kmsheng commented 4 years ago

hypernova pollutes the global.Promise with bluebird's. This will cause unwanted behaviors for application which uses other libraries that also use native Promise object.

This PR intends to remove direct assignment to global.Promise and keeps hypernova run as before by the followings:

  1. Copy Promise related declaration code from environment.js to promise.js
  2. Add import Promise statements to files which invoke Promise which will feed them with bluebird's Promise as before
  3. remove Promise related code and global assignment from environment.js
espretto commented 1 year ago

Related issues: #201 , #135