Skip to main content

Electron API History Migration 가이드

이 문서는 기존 API에 API History 블록을 추가하는 방법을 설명한다.

API 기록 정보 확인 방법

API의 이력을 확인할 때 활용할 수 있는 주요 리소스는 다음과 같다:

주요 변경 사항

예제

info

관련 API는 이미 제거되었으므로, 이 예제에서는 이를 무시한다.

breaking-changes.md 파일을 검색하면 Electron 25.0에서 사용 중단된 함수를 찾을 수 있다.

<!-- docs/breaking-changes.md -->
### 사용 중단: `BrowserWindow.getTrafficLightPosition()`

`BrowserWindow.getTrafficLightPosition()`은 더 이상 사용되지 않으며, 대신 `BrowserWindow.getWindowButtonPosition()` API를 사용해야 한다. 이 API는 사용자 정의 위치가 없을 때 `{ x: 0, y: 0 }` 대신 `null`을 반환한다.

<!-- docs/api/browser-window.md -->
#### `win.getTrafficLightPosition()` _macOS_ _사용 중단_

`Point`를 반환한다. 프레임리스 윈도우에서 트래픽 라이트 버튼의 사용자 정의 위치를 나타낸다. 사용자 정의 위치가 없을 경우 `{ x: 0, y: 0 }`을 반환한다.

이어서 git blame을 사용해 해당 항목과 관련된 Pull Request를 찾을 수 있다:

$ grep -n "BrowserWindow.getTrafficLightPosition" docs/breaking-changes.md 
523:### 사용 중단: `BrowserWindow.getTrafficLightPosition()`
525:`BrowserWindow.getTrafficLightPosition()`은 더 이상 사용되지 않으며,

$ git blame -L523,524 -- docs/breaking-changes.md
1e206deec3e (Keeley Hammond 2023-04-06 21:23:29 -0700 523) ### 사용 중단: `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) <-- 관련 Pull Request

Pull Request가 정확한지 확인하고, API History에 해당 항목을 추가한다:

info

API History 블록을 생성하는 방법은 styleguide.md의 API History 섹션을 참고한다.

#### `win.getTrafficLightPosition()` _macOS_ _사용 중단_

<!--
```YAML history
deprecated:
- pr-url: https://github.com/electron/electron/pull/37878
breaking-changes-header: deprecated-browserwindowgettrafficlightposition
```
-->

`Point`를 반환한다. 프레임리스 윈도우에서 트래픽 라이트 버튼의 사용자 정의 위치를 나타낸다. 사용자 정의 위치가 없을 경우 `{ x: 0, y: 0 }`을 반환한다.

breaking-changes.md 파일을 계속 검토해 다른 주요 변경 사항을 찾고, 이를 추가할 수 있다.

또한 git log -L :<funcname>:<file>을 사용할 수 있다:

$ git log --reverse -L :GetTrafficLightPosition:shell/browser/native_window_mac.mm
commit e01b1831d96d5d68f54af879b00c617358df5372
Author: Cheng Zhao <zcbenz@gmail.com>
Date: Wed Dec 16 14:30:39 2020 +0900

feat: make trafficLightPosition work for customButtonOnHover (#26789)

Pull Request가 정확한지 확인하고, API History에 해당 항목을 추가한다:

#### `win.getTrafficLightPosition()` _macOS_ _사용 중단_

<!--
```YAML history
added:
- pr-url: https://github.com/electron/electron/pull/22533
changes:
- pr-url: https://github.com/electron/electron/pull/26789
description: "`trafficLightPosition` 옵션이 `customButtonOnHover` 윈도우에서 작동하도록 변경됨."
breaking-changes-header: behavior-changed-draggable-regions-on-macos
```
-->

`Point`를 반환한다. 프레임리스 윈도우에서 트래픽 라이트 버튼의 사용자 정의 위치를 나타낸다. 사용자 정의 위치가 없을 경우 `{ x: 0, y: 0 }`을 반환한다.

API가 처음 추가된 시점을 찾기 위해 다음 명령어를 사용할 수 있다:

$ git log --reverse -L :GetTrafficLightPosition:shell/browser/native_window_mac.mm
commit 3e2cec83d927b991855e21cc311ca9046e332601
Author: Samuel Attard <sattard@slack-corp.com>
Date: Thu Mar 5 14:22:12 2020 -0800

feat: programmatically modify traffic light positioning (#22533)

또는 git blame을 사용할 수도 있다:

$ git checkout 1e206deec3e^
HEAD is now at e8c87859c4 fix: showAboutPanel also on linux (#37828)

$ grep -n "getTrafficLightPosition" docs/api/browser-window.md
1867:#### `win.getTrafficLightPosition()` _macOS_ _사용 중단_

$ git blame -L1867,1868 -- docs/api/browser-window.md
0de1012280e (Cheng Zhao 2023-02-17 19:06:32 +0900 1867) #### `win.getTrafficLightPosition()` _macOS_ _사용 중단_
3e2cec83d92 (Samuel Attard 2020-03-05 14:22:12 -0800 1868)

$ git checkout 0de1012280e^
HEAD is now at 0a5e634736 test: rename & split internal module tests (#37318)

$ grep -n "getTrafficLightPosition" docs/api/browser-window.md
1851:#### `win.getTrafficLightPosition()` _macOS_

$ git blame -L1851,1852 -- docs/api/browser-window.md
3e2cec83d92 (Samuel Attard 2020-03-05 14:22:12 -0800 1851) #### `win.getTrafficLightPosition()` _macOS_
3e2cec83d92 (Samuel Attard 2020-03-05 14:22:12 -0800 1852)

$ git checkout 3e2cec83d92^
HEAD is now at 1811751c6c docs: clean up dark mode related docs (#22489)

$ grep -n "getTrafficLightPosition" docs/api/browser-window.md
(Nothing)

$ git checkout 3e2cec83d92
HEAD is now at 3e2cec83d9 feat: programmatically modify traffic light positioning (#22533)

Pull Request가 정확한지 확인하고, API History에 해당 항목을 추가한다:

#### `win.getTrafficLightPosition()` _macOS_ _사용 중단_

<!--
```YAML history
added:
- pr-url: https://github.com/electron/electron/pull/22533
changes:
- pr-url: https://github.com/electron/electron/pull/26789
description: "`trafficLightPosition` 옵션이 `customButtonOnHover` 윈도우에서 작동하도록 변경됨."
breaking-changes-header: behavior-changed-draggable-regions-on-macos
deprecated:
- pr-url: https://github.com/electron/electron/pull/37878
breaking-changes-header: deprecated-browserwindowgettrafficlightposition
```
-->

`Point`를 반환한다. 프레임리스 윈도우에서 트래픽 라이트 버튼의 사용자 정의 위치를 나타낸다. 사용자 정의 위치가 없을 경우 `{ x: 0, y: 0 }`을 반환한다.