Skip to content

Do not use a promise polyfill on modern setups #815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

alubbe
Copy link
Member

@alubbe alubbe commented May 14, 2019

To make the most of async/await (performance & stack traces), we need to use the native Promises. This PR does not change that the default export uses promish, but it does add two new exports that allow access to the modern codebase and native promises. I've also fixed a couple of eslint failures in the affected files.

const Excel = require('exceljs/modern.nodejs');
import Excel from 'exceljs/modern.browser';

Copy link
Contributor

@defshift defshift left a comment

Choose a reason for hiding this comment

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

👍

@alubbe alubbe force-pushed the no-promise-polyfill-on-modern-setups branch from 274a84e to 791292a Compare May 14, 2019 09:54
@@ -121,7 +121,7 @@ CSV.prototype = {
}
if (value instanceof Date) {
if (dateFormat) {
dateUTC ? moment.utc(value).format(dateFormat) : moment(value).format(dateFormat);
return dateUTC ? moment.utc(value).format(dateFormat) : moment(value).format(dateFormat);
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm pretty sure the missing return here was a bug

Copy link
Collaborator

@guyonroche guyonroche left a comment

Choose a reason for hiding this comment

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

LGTM

@guyonroche guyonroche merged commit ea2b1d2 into exceljs:master May 15, 2019
@alubbe alubbe deleted the no-promise-polyfill-on-modern-setups branch May 15, 2019 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants