Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't patch Promise.all, Promise.race, etc.
This commit fails for 2 tests representing apps that imports Promise from a promise polyfill instead of just using the global Promise. Many apps and libs are still importing Promise from a polyfill to make them work on IE11. If these apps are doing Promise.resolve() or similar using the imported Promise constructor, we will not be able to track the ongoing transaction or liveQuery context if this commit is released. Those apps will need to drag down the promise polyfill in a plain script tag instead of importing from the polyfill. The webpacked code must use the global Promise and not an imported one at any time within Dexie transactions and liveQuery querier functions. This commit should be released in a new major version of Dexie with clear instrutions of how to migrate Promise polyfill dependent code. We could also make an intermediate fix that is backward compliant but warns in console if they are using import polyfill-pattern (not part of this commit). The upsides with this commit are: * Optimization: We only switch self.Promise between zones. * Simplicity: Less code * Unobtrusiveness
- Loading branch information