Electron API History Migration Guide
This document demonstrates how to add API History blocks to existing APIs.
API history information
Here are some resources you can use to find information on the history of an API:
Критические изменения
Additions
git blame
- Release notes
electron-api-historian
Пример
информация
The associated API is already removed, we will ignore that for the purpose of this example.
If we search through breaking-changes.md
we can find
a function that was deprecated in Electron 25.0
.
<!-- docs/breaking-changes.md -->
### Deprecated: `BrowserWindow.getTrafficLightPosition()`
`BrowserWindow.getTrafficLightPosition()` has been deprecated, the
`BrowserWindow.getWindowButtonPosition()` API should be used instead
which returns `null` instead of `{ x: 0, y: 0 }` when there is no custom
position.
<!-- docs/api/browser-window.md -->
#### `win.getTrafficLightPosition()` _macOS_ _Deprecated_
Returns `Point` - The custom position for the traffic light buttons in
frameless window, `{ x: 0, y: 0 }` will be returned when there is no custom
position.
We can then use git blame
to find the Pull Request associated with that entry:
$ grep -n "BrowserWindow.getTrafficLightPosition" docs/breaking-changes.md
523:### Deprecated: `BrowserWindow.getTrafficLightPosition()`
525:`BrowserWindow.getTrafficLightPosition()` has been deprecated, the
$ git blame -L523,524 -- docs/breaking-changes.md
1e206deec3e (Keeley Hammond 2023-04-06 21:23:29 -0700 523) ### Deprecated: `BrowserWindow.getTrafficLightPosition()`
1e206deec3e (Keeley Hammond 2023-04-06 21:23:29 -0700 524)
$ git log -1 1e206deec3e
commit 1e206deec3ef142460c780307752a84782f9baed (tag: v26.0.0-nightly.20230407)
Author: Keeley Hammond <vertedinde@electronjs.org>
Date: Thu Apr 6 21:23:29 2023 -0700
docs: update E24/E25 breaking changes (#37878) <-- This is the associated Pull Request