Skip to content
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

vow promises -> native Promise #11

Merged
merged 1 commit into from
Oct 18, 2017
Merged

vow promises -> native Promise #11

merged 1 commit into from
Oct 18, 2017

Conversation

jifeon
Copy link
Contributor

@jifeon jifeon commented Oct 9, 2017

Also:

  • async/await instead of .then
  • eslint errors fixed
  • using more popular mkdirp

Required before merge

  • update goose parser
  • check existent parsers
  • update versions in package.json and publish on npm

closes #6
ref #1

@jifeon jifeon requested a review from maZahaca October 9, 2017 18:28
@jifeon jifeon changed the title vow promises -> native Promise [WIP] vow promises -> native Promise Oct 9, 2017
Copy link
Member

@maZahaca maZahaca left a comment

Choose a reason for hiding this comment

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

Fuf, long one

* @returns {string}
* @private
*/
function getRedirectUrl(currentUrl, redirectUri) {
Copy link
Member

Choose a reason for hiding this comment

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

Why second param ends with i and first with l. Shall it be the same Url ending?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

signature was not changed, PR is about promises at most. It initially was written by you, so the question to you lol 🐗

const deferred = vow.defer(),
page = this._page,
args = Array.prototype.slice.call(arguments, 0);
evaluateJs(...args) {
Copy link
Member

Choose a reason for hiding this comment

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

Would be very helpful if you can state here JSDoc with an example how to call this function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it was not changed, but I agree jsdoc is needed. I added a point into #1 since I think docs should be fixed in separate PR


this._requestingActions.push({
pattern: uri,
fn(err, results) {
Copy link
Member

Choose a reason for hiding this comment

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

Just in case you can clarify this line: don't see any fn defined in surrounding (in the old code as well)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But it's the declaration itself. Strange that it's not an arrow function. But still PR is not about refactoring everything, so I would prefer to fix it in next PRs.

const a = {
  fn: function() {}
}

is the same as

const a = {
  fn() {}
};

Copy link
Member

Choose a reason for hiding this comment

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

I see

}

injectBrowserEnv() {
if (this._browserEnvInjected) {
return vow.resolve();
return Promise.resolve();
}

debug('.inject()-ing browser env libs');
Copy link
Member

Choose a reason for hiding this comment

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

Here injects browser.bundle.js before it was build via webpack. But now - not, I think this is a browser build of goose-parser. We need to inject it in different way (for example by passing from the point where we define parser and env). Also starting from that _browserEnvInjected meaningless.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, it's broken now by moving env into repo (not by this PR). I will create a separate issue for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done #12

async/await instead of .then
eslint errors fixed
using more popular mkdirp
closes #6
ref #1
@jifeon jifeon merged commit d094e93 into master Oct 18, 2017
@jifeon jifeon deleted the remove-vow branch October 18, 2017 22:54
@jifeon jifeon changed the title [WIP] vow promises -> native Promise vow promises -> native Promise Oct 18, 2017
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.

Replace vow and vow-node with native Promise
2 participants