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

feat: split openExternal into sync and async #16176

Merged
merged 3 commits into from Jan 15, 2019

Conversation

Projects
None yet
5 participants
@codebytere
Copy link
Member

commented Dec 21, 2018

Description of Change

This API can't be promisified in the same way as previous apis, as its callback is optional.

This therefore follows Node's conventions and splits shell.openExternal(url[, options, callback]) into shell.openExternalSync(url[, options]) and shell.openExternal(url[, options]).
shell.openExternal(url[, options]) now returns a promise.

This PR also adds specs for previously-untested shell.openExternal() and also for shell.openExternalSync().

/cc @miniak @ckerr

Checklist

  • PR description included and stakeholders cc'd
  • npm test passes
  • relevant documentation is changed or added
  • PR title follows semantic commit guidelines
  • PR release notes describe the change in a way relevant to app-developers

Release Notes

Notes: promisify shell.openExternal() by splitting it into a sync and async method

@codebytere codebytere requested review from as code owners Dec 21, 2018

@ckerr

ckerr approved these changes Dec 21, 2018

Show resolved Hide resolved docs/api/shell.md Outdated
Show resolved Hide resolved docs/api/shell.md Outdated

@codebytere codebytere force-pushed the promise-open-external branch 3 times, most recently from 4ae0b27 to feeda28 Dec 22, 2018

@codebytere codebytere force-pushed the promise-open-external branch from 7de2451 to 25ab6bd Jan 11, 2019

@codebytere codebytere changed the title [wip] feat: split openExternal into sync and async feat: split openExternal into sync and async Jan 11, 2019

@codebytere codebytere force-pushed the promise-open-external branch from b8fc5a5 to b7df504 Jan 11, 2019

codebytere added some commits Jan 11, 2019

@codebytere codebytere force-pushed the promise-open-external branch from b7df504 to 451738f Jan 15, 2019

@zcbenz

zcbenz approved these changes Jan 15, 2019

void OnOpenExternalFinished(const v8::Global<v8::Context>& context,
scoped_refptr<atom::util::Promise> promise,
const std::string& error) {
v8::Isolate* isolate = promise->isolate();

This comment has been minimized.

Copy link
@MarshallOfSound

MarshallOfSound Jan 15, 2019

Member

Should this be done in the promise helper to reduce this boilerplate being duplicated for all promises?

This comment has been minimized.

Copy link
@zcbenz

zcbenz Jan 15, 2019

Member

I agree moving the code to promise helper. But I would prefer doing it in a separate PR since it is a refactoring that modifies multiple files.

@codebytere codebytere merged commit 0881fd6 into master Jan 15, 2019

25 of 27 checks passed

electron-arm64-testing Build #20190115.3 has test failures
Details
Artifact Comparison Changes Detected
Details
Absolute Zero
Semantic Pull Request ready to be squashed
Details
WIP Ready for review
Details
appveyor: win-ia32-debug AppVeyor build succeeded
Details
appveyor: win-ia32-testing AppVeyor build succeeded
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-x64-debug AppVeyor build succeeded
Details
appveyor: win-x64-testing AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
ci/circleci: linux-arm-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-arm-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-arm64-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-arm64-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-checkout Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-testing-tests Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-testing-tests Your tests passed on CircleCI!
Details
electron-arm-testing Build #20190115.4 succeeded
Details
electron-lint Build #20190115.3 succeeded
Details
electron-mas-testing Build #20190115.2 succeeded
Details
electron-osx-testing Build #20190115.2 succeeded
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

commented Jan 15, 2019

Release Notes Persisted

promisify shell.openExternal() by splitting it into a sync and async method

@codebytere codebytere deleted the promise-open-external branch Jan 15, 2019

andrewkisliakov-citrix added a commit to andrewkisliakov-citrix/electron that referenced this pull request Jan 22, 2019

feat: split openExternal into sync and async (electron#16176)
* feat: split openExternal into sync and async

* v8::Locker => mate::Locker

* fix: enter js env when resolving promise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.