Repository navigation
chore: remove promisification deprecation callbacks - #17907
Merged
Merged
Conversation
miniak
suggested changes
Apr 23, 2019
Contributor
There was a problem hiding this comment.
the following changes are missing:
diff --git a/lib/browser/api/app.ts b/lib/browser/api/app.ts
index 0d6110e4c..625581e1b 100644
--- a/lib/browser/api/app.ts
+++ b/lib/browser/api/app.ts
@@ -89,9 +89,6 @@ for (const name of events) {
})
}
-// Function Deprecations
-app.getFileIcon = deprecate.promisify(app.getFileIcon)
-
// Property Deprecations
deprecate.fnToProperty(app, 'accessibilitySupportEnabled', '_isAccessibilitySupportEnabled', '_setAccessibilitySupportEnabled')
diff --git a/lib/renderer/api/web-frame.ts b/lib/renderer/api/web-frame.ts
index ca640c30a..4d3b06489 100644
--- a/lib/renderer/api/web-frame.ts
+++ b/lib/renderer/api/web-frame.ts
@@ -85,15 +85,6 @@ function getWebFrame (context: Window) {
return context ? new WebFrame(context) : null
}
-const promisifiedMethods = new Set<string>([
- 'executeJavaScript',
- 'executeJavaScriptInIsolatedWorld'
-])
-
-for (const method of promisifiedMethods) {
- (WebFrame as any).prototype[method] = deprecate.promisify((WebFrame as any).prototype[method])
-}
-
const _webFrame = new WebFrame(window)
export default _webFrame
diff --git a/lib/renderer/web-view/web-view-impl.ts b/lib/renderer/web-view/web-view-impl.ts
index 6849f3061..94e8f32b4 100644
--- a/lib/renderer/web-view/web-view-impl.ts
+++ b/lib/renderer/web-view/web-view-impl.ts
@@ -1,4 +1,4 @@
-import { deprecate, remote, webFrame } from 'electron'
+import { remote, webFrame } from 'electron'
import * as ipcRendererUtils from '@electron/internal/renderer/ipc-renderer-internal-utils'
import * as guestViewInternal from '@electron/internal/renderer/web-view/guest-view-internal'
@@ -273,7 +273,7 @@ export const setupMethods = (WebViewElement: typeof ElectronInternal.WebViewElem
}
for (const method of asyncPromiseMethods) {
- (WebViewElement.prototype as Record<string, any>)[method] = deprecate.promisify(createPromiseHandler(method))
+ (WebViewElement.prototype as Record<string, any>)[method] = createPromiseHandler(method)
}
}
Contributor
|
@codebytere shouldn't we also remove the documentation for the callback versions? |
miniak
suggested changes
Apr 23, 2019
miniak
left a comment
Contributor
There was a problem hiding this comment.
desktopCapturer tests will be fixed by
diff --git a/lib/renderer/api/desktop-capturer.js b/lib/renderer/api/desktop-capturer.js
index 08b6f5b0f..13f89f875 100644
--- a/lib/renderer/api/desktop-capturer.js
+++ b/lib/renderer/api/desktop-capturer.js
@@ -19,7 +19,7 @@ function mapSources (sources) {
}))
}
-const getSources = (options) => {
+exports.getSources = (options) => {
return new Promise((resolve, reject) => {
if (!isValid(options)) throw new Error('Invalid options')
Member
Author
|
I need to fix the smoke tests here 👇 |
Contributor
yeah, when I tried locally what happens when the docs are updated, I could see a lot of those blowing up :) |
Member
Author
|
Fixed now pending a issue with |
miniak
reviewed
Apr 24, 2019
miniak
approved these changes
Apr 24, 2019
miniak
approved these changes
Apr 29, 2019
jkleinsc
approved these changes
Apr 30, 2019
|
Release Notes Persisted
|
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Remove promisification deprecations and tests verifying callback versions. I think i got everything but please let me know if i missed any of them!
cc @miniak @MarshallOfSound
Checklist
npm testpassesRelease Notes
Notes: Removed deprecations for asynchronous functions to force use of promises.