Skip to content

Commit

Permalink
docs: document modernization initiative more clearly (#17376)
Browse files Browse the repository at this point in the history
* docs: document modernization initiative more clearly
  • Loading branch information
codebytere committed Mar 19, 2019
1 parent 53f4af7 commit 879462a
Show file tree
Hide file tree
Showing 18 changed files with 102 additions and 34 deletions.
2 changes: 1 addition & 1 deletion docs/api/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ On _Windows_, there are 2 kinds of icons:

On _Linux_ and _macOS_, icons depend on the application associated with file mime type.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

### `app.getFileIcon(path[, options])`

Expand Down
2 changes: 1 addition & 1 deletion docs/api/browser-window.md
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ Captures a snapshot of the page within `rect`. Upon completion `callback` will
be called with `callback(image)`. The `image` is an instance of [NativeImage](native-image.md)
that stores data of the snapshot. Omitting `rect` will capture the whole visible page.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

#### `win.capturePage([rect])`

Expand Down
8 changes: 4 additions & 4 deletions docs/api/content-tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Get a set of category groups. The category groups can change as new code paths a

Once all child processes have acknowledged the `getCategories` request the `callback` is invoked with an array of category groups.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

### `contentTracing.getCategories()`

Expand All @@ -66,7 +66,7 @@ Recording begins immediately locally and asynchronously on child processes
as soon as they receive the EnableRecording request. The `callback` will be
called once all child processes have acknowledged the `startRecording` request.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

### `contentTracing.startRecording(options)`

Expand Down Expand Up @@ -100,7 +100,7 @@ Trace data will be written into `resultFilePath` if it is not empty or into a
temporary file. The actual file path will be passed to `callback` if it's not
`null`.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

### `contentTracing.stopRecording(resultFilePath)`

Expand Down Expand Up @@ -130,7 +130,7 @@ Get the maximum usage across processes of trace buffer as a percentage of the
full state. When the TraceBufferUsage value is determined the `callback` is
called.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

### `contentTracing.getTraceBufferUsage()`

Expand Down
8 changes: 4 additions & 4 deletions docs/api/cookies.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ the response.
Sends a request to get all cookies matching `filter`, `callback` will be called
with `callback(error, cookies)` on complete.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

#### `cookies.set(details)`

Expand Down Expand Up @@ -142,7 +142,7 @@ Sets a cookie with `details`.
Sets a cookie with `details`, `callback` will be called with `callback(error)`
on complete.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

#### `cookies.remove(url, name)`

Expand All @@ -162,7 +162,7 @@ Removes the cookies matching `url` and `name`
Removes the cookies matching `url` and `name`, `callback` will called with
`callback()` on complete.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

#### `cookies.flushStore()`

Expand All @@ -176,4 +176,4 @@ Writes any unwritten cookies data to disk.

Writes any unwritten cookies data to disk.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**
2 changes: 1 addition & 1 deletion docs/api/debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Detaches the debugger from the `webContents`.

Send given command to the debugging target.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

#### `debugger.sendCommand(method[, commandParams])`

Expand Down
2 changes: 1 addition & 1 deletion docs/api/desktop-capturer.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ captured.

[`navigator.mediaDevices.getUserMedia`]: https://developer.mozilla.org/en/docs/Web/API/MediaDevices/getUserMedia

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

### `desktopCapturer.getSources(options)`

Expand Down
2 changes: 1 addition & 1 deletion docs/api/dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ On Windows the options are more limited, due to the Win32 APIs used:
* The `browserWindow` argument is ignored since it is not possible to make
this confirmation dialog modal.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

### `dialog.showCertificateTrustDialog([browserWindow, ]options)` _macOS_ _Windows_

Expand Down
4 changes: 2 additions & 2 deletions docs/api/in-app-purchase.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The `inAppPurchase` module has the following methods:

You should listen for the `transactions-updated` event as soon as possible and certainly before you call `purchaseProduct`.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

### `inAppPurchase.purchaseProduct(productID, quantity)`

Expand All @@ -49,7 +49,7 @@ You should listen for the `transactions-updated` event as soon as possible and c

Retrieves the product descriptions.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

### `inAppPurchase.getProducts(productIDs)`

Expand Down
10 changes: 10 additions & 0 deletions docs/api/modernization/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Modernization

The Electron team is currently undergoing an initiative to modernize our API in a few concrete ways. These include: updating our modules to use idiomatic JS properties instead of separate `getPropertyX` and `setpropertyX`, converting callbacks to promises, and removing some other anti-patterns present in our APIs. The current status of the Promise intiative can be tracked in the [promisification](promisification.md) tracking file.

As we work to perform these updates, we seek to create the least disruptive amount of change at any given time, so as many changes as possible will be introduced in a backward compatible manner and deprecated after enough time has passed to give users a chance to upgrade their API calls.

This document and its child documents will be updated to reflect the latest status of our API changes.

* [Promisification](promisification.md)
* [Property Updates](property-updates.md)
File renamed without changes.
58 changes: 58 additions & 0 deletions docs/api/modernization/property-updates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## Property Updates

The Electron team is currently undergoing an initiative to convert separate getter and setter functions in Electron to bespoke properties with `get` and `set` functionality. During this transition period, both the new properties and old getters and setters of these functions will work correctly and be documented.

## Candidates

* `app` module
* `accessibilitySupport`
* `badgeCount`
* `applicationMenu`
* `name`
* `dock`
* `badge`
* `autoUpdater` module
* `feedUrl`
* `BrowserWindow`
* `fullscreen`
* `simpleFullscreen`
* `movable`
* `resizable`
* `maximizable`
* `minimizable`
* `fullscreenable`
* `closable`
* `alwaysOnTop`
* `title`
* `documentEdited`
* `hasShadow`
* `autohideMenuBar`
* `menubarVisible`
* `visibleOnAllWorkspaces`
* `crashReporter` module
* `uploadToServer`
* `DownloadItem` class
* `savePath`
* `paused`
* `NativeImage`
* `templateImage`
* `Session` module
* `preloads`
* `SystemPreferences` module
* `appLevelAppearance`
* `webContents` module
* `zoomFactor`
* `zoomLevel`
* `audioMuted`
* `userAgent`
* `frameRate`
* `webFrame` modules
* `zoomFactor`
* `zoomLevel`
* `audioMuted`
* `<webview>`
* `zoomFactor`
* `zoomLevel`
* `audioMuted`

## Converted Properties
2 changes: 1 addition & 1 deletion docs/api/net-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Starts recording network events to `path`.

Stops recording network events. If not called, net logging will automatically end when app quits.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

### `netLog.stopLogging()`

Expand Down
2 changes: 1 addition & 1 deletion docs/api/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ Unregisters the custom protocol of `scheme`.
The `callback` will be called with a boolean that indicates whether there is
already a handler for `scheme`.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

### `protocol.isProtocolHandled(scheme)`

Expand Down
16 changes: 8 additions & 8 deletions docs/api/session.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ The following methods are available on instances of `Session`:

Callback is invoked with the session's current cache size.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

#### `ses.getCacheSize()`

Expand All @@ -114,7 +114,7 @@ Returns `Promise<Integer>` - the session's current cache size, in bytes.

Clears the session’s HTTP cache.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

#### `ses.clearCache()`

Expand All @@ -136,7 +136,7 @@ Clears the session’s HTTP cache.

Clears the storage data for the current session.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

#### `ses.clearStorageData([options])`

Expand Down Expand Up @@ -231,7 +231,7 @@ The `proxyBypassRules` is a comma separated list of rules described below:
Match local addresses. The meaning of `<local>` is whether the
host matches one of: "127.0.0.1", "::1", "localhost".

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

#### `ses.setProxy(config)`

Expand Down Expand Up @@ -319,7 +319,7 @@ The `proxyBypassRules` is a comma separated list of rules described below:
Resolves the proxy information for `url`. The `callback` will be called with
`callback(proxy)` when the request is performed.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

#### `ses.resolveProxy(url)`

Expand Down Expand Up @@ -463,7 +463,7 @@ session.fromPartition('some-partition').setPermissionCheckHandler((webContents,

Clears the host resolver cache.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

#### `ses.clearHostResolverCache()`

Expand Down Expand Up @@ -512,7 +512,7 @@ Returns `String` - The user agent for this session.
* `callback` Function
* `result` Buffer - Blob data.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

#### `ses.getBlobData(identifier)`

Expand Down Expand Up @@ -546,7 +546,7 @@ the initial state will be `interrupted`. The download will start only when the

Clears the session’s HTTP authentication cache.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

#### `ses.clearAuthCache(options)`

Expand Down
6 changes: 3 additions & 3 deletions docs/api/web-contents.md
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ contents.executeJavaScript('fetch("https://jsonplaceholder.typicode.com/users/1"
})
```

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

#### `contents.executeJavaScript(code[, userGesture])`

Expand Down Expand Up @@ -1179,7 +1179,7 @@ Captures a snapshot of the page within `rect`. Upon completion `callback` will
be called with `callback(image)`. The `image` is an instance of [NativeImage](native-image.md)
that stores data of the snapshot. Omitting `rect` will capture the whole visible page.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

#### `contents.capturePage([rect])`

Expand Down Expand Up @@ -1235,7 +1235,7 @@ settings.
The `callback` will be called with `callback(error, data)` on completion. The
`data` is a `Buffer` that contains the generated PDF data.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

#### `contents.printToPDF(options)`

Expand Down
4 changes: 2 additions & 2 deletions docs/api/web-frame.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ In the browser window some HTML APIs like `requestFullScreen` can only be
invoked by a gesture from the user. Setting `userGesture` to `true` will remove
this limitation.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

### `webFrame.executeJavaScript(code[, userGesture])`

Expand Down Expand Up @@ -152,7 +152,7 @@ or is rejected if the result of the code is a rejected promise.

Works like `executeJavaScript` but evaluates `scripts` in an isolated context.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

### `webFrame.executeJavaScriptInIsolatedWorld(worldId, scripts[, userGesture])`

Expand Down
6 changes: 3 additions & 3 deletions docs/api/webview-tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ Evaluates `code` in page. If `userGesture` is set, it will create the user
gesture context in the page. HTML APIs like `requestFullScreen`, which require
user action, can take advantage of this option for automation.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

### `<webview>.executeJavaScript(code[, userGesture])`

Expand Down Expand Up @@ -563,7 +563,7 @@ Prints `webview`'s web page. Same as `webContents.print([options])`.

Prints `webview`'s web page as PDF, Same as `webContents.printToPDF(options, callback)`.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

### `<webview>.printToPDF(options)`

Expand Down Expand Up @@ -591,7 +591,7 @@ Captures a snapshot of the page within `rect`. Upon completion `callback` will
be called with `callback(image)`. The `image` is an instance of [NativeImage](native-image.md)
that stores data of the snapshot. Omitting `rect` will capture the whole visible page.

**[Deprecated Soon](promisification.md)**
**[Deprecated Soon](modernization/promisification.md)**

### `<webview>.capturePage([rect])`

Expand Down
2 changes: 1 addition & 1 deletion filenames.auto.gni
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ auto_filenames = {
"docs/api/locales.md",
"docs/api/menu-item.md",
"docs/api/menu.md",
"docs/api/modernization",
"docs/api/native-image.md",
"docs/api/net-log.md",
"docs/api/net.md",
"docs/api/notification.md",
"docs/api/power-monitor.md",
"docs/api/power-save-blocker.md",
"docs/api/process.md",
"docs/api/promisification.md",
"docs/api/protocol.md",
"docs/api/remote.md",
"docs/api/sandbox-option.md",
Expand Down

0 comments on commit 879462a

Please sign in to comment.