PageSourceSearch

https://www.electronjs.org/assets/js/0d880500.d8492978.js

js electronjs.org collected 2026-09-24 07:03:09 UTC 11,292 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkelectronjs=self.webpackChunkelectronjs||[]).push([["17779"],{96710(e,n,t){t.r(n),t.d(n,{metadata:()=>i,default:()=>h,frontMatter:()=>s,contentTitle:()=>a,toc:()=>d,assets:()=>c});var i=JSON.parse('{"id":"latest/development/api-history-migration-guide","title":"Electron API History Migration Guide","description":"This document demonstrates how to add API History blocks to existing APIs.","source":"@site/docs/latest/development/api-history-migration-guide.md","sourceDirName":"latest/development","slug":"/latest/development/api-history-migration-guide","permalink":"/docs/latest/development/api-history-migration-guide","draft":false,"unlisted":false,"editUrl":"https://github.com/electron/electron/edit/main/docs/development/api-history-migration-guide.md","tags":[],"version":"current","frontMatter":{"title":"Electron API History Migration Guide","description":"This document demonstrates how to add API History blocks to existing APIs.","slug":"api-history-migration-guide","hide_title":false},"sidebar":"docs","previous":{"title":"Setting Up Symbol Server in Debugger","permalink":"/docs/latest/development/debugging-with-symbol-server"},"next":{"title":"Using clang-tidy on C++ Code","permalink":"/docs/latest/development/clang-tidy"}}'),o=t(74848),r=t(28453);let s={title:"Electron API History Migration Guide",description:"This document demonstrates how to add API History blocks to existing APIs.",slug:"api-history-migration-guide",hide_title:!1},a="Electron API History Migration Guide",c={},d=[{value:"API history information",id:"api-history-information",level:2},{value:"Breaking Changes",id:"breaking-changes",level:3},{value:"Additions",id:"additions",level:3},{value:"Example",id:"example",level:2}];function l(e){let n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"electron-api-history-migration-guide",children:"Electron API History Migration Guide"})}),"\n",(0,o.jsx)(n.p,{children:"This document demonstrates how to add API History blocks to existing APIs."}),"\n",(0,o.jsx)(n.h2,{id:"api-history-information",children:"API history information"}),"\n",(0,o.jsx)(n.p,{children:"Here are some resources you can use to find information on the history of an API:"}),"\n",(0,o.jsx)(n.h3,{id:"breaking-changes",children:"Breaking Changes"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/docs/latest/breaking-changes",children:(0,o.jsx)(n.code,{children:"breaking-changes.md"})})}),"\n"]}),"\n",(0,o.jsx)(n.h3,{id:"additions",children:"Additions"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.code,{children:"git blame"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://github.com/electron/electron/releases/",children:"Release notes"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://github.com/electron/electron-api-historian",children:(0,o.jsx)(n.code,{children:"electron-api-historian"})})}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,o.jsx)(n.admonition,{type:"note",children:(0,o.jsx)(n.p,{children:"The associated API is already removed, we will ignore that for the purpose of\nthis example."})}),"\n",(0,o.jsxs)(n.p,{children:["If we search through ",(0,o.jsx)(n.a,{href:"/docs/latest/breaking-changes",children:(0,o.jsx)(n.code,{children:"breaking-changes.md"})})," we can find\n",(0,o.jsxs)(n.a,{href:"/docs/latest/breaking-changes#deprecated-browserwindowsettrafficlightpositionposition",children:["a function that was deprecated in Electron ",(0,o.jsx)(n.code,{children:"25.0"})]}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-markdown",children:"\x3c!-- docs/breaking-changes.md --\x3e\n### Deprecated: `BrowserWindow.getTrafficLightPosition()`\n\n`BrowserWindow.getTrafficLightPosition()` has been deprecated, the\n`BrowserWindow.getWindowButtonPosition()` API should be used instead\nwhich returns `null` instead of `{ x: 0, y: 0 }` when there is no custom\nposition.\n\n\x3c!-- docs/api/browser-window.md  --\x3e\n#### `win.getTrafficLightPosition()` _macOS_ _Deprecated_\n\nReturns `Point` - The custom position for the traffic light buttons in\nframeless window, `{ x: 0, y: 0 }` will be returned when there is no custom\nposition.\n"})}),"\n",(0,o.jsxs)(n.p,{children:["We can then use ",(0,o.jsx)(n.code,{children:"git blame"})," to find the Pull Request associated with that entry:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:'$ grep -n "BrowserWindow.getTrafficLightPosition" docs/breaking-changes.md \n523:### Deprecated: `BrowserWindow.getTrafficLightPosition()`\n525:`BrowserWindow.getTrafficLightPosition()` has been deprecated, the\n\n$ git blame -L523,524 -- docs/breaking-changes.md\n1e206deec3e (Keeley Hammond 2023-04-06 21:23:29 -0700 523) ### Deprecated: `BrowserWindow.getTrafficLightPosition()`\n1e206deec3e (Keeley Hammond 2023-04-06 21:23:29 -0700 524)\n\n$ git log -1 1e206deec3e\ncommit 1e206deec3ef142460c780307752a84782f9baed (tag: v26.0.0-nightly.20230407)\nAuthor: Keeley Hammond <[email protected]>\nDate:   Thu Apr 6 21:23:29 2023 -0700\n\n    docs: update E24/E25 breaking changes (#37878) <-- This is the associated Pull Request\n'})}),"\n",(0,o.jsx)(n.p,{children:"Verify that the Pull Request is correct and make a corresponding entry in the\nAPI History:"}),"\n",(0,o.jsx)(n.admonition,{type:"note",children:(0,o.jsxs)(n.p,{children:["Refer to the ",(0,o.jsxs)(n.a,{href:"/docs/latest/development/style-guide#api-history",children:["API History section of ",(0,o.jsx)(n.code,{children:"style-guide.md"})]}),"\nfor information on how to create API History blocks."]})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-markdown",children:"#### `win.getTrafficLightPosition()` _macOS_ _Deprecated_\n\n\x3c!--\n```YAML history\ndeprecated:\n  - pr-url: https://github.com/electron/electron/pull/37878\n    breaking-changes-header: deprecated-browserwindowgettrafficlightposition\n```\n--\x3e\n\nReturns `Point` - The custom position for the traffic light buttons in\nframeless window, `{ x: 0, y: 0 }` will be returned when there is no custom\nposition.\n"})}),"\n",(0,o.jsxs)(n.p,{children:["You can keep looking through ",(0,o.jsx)(n.code,{children:"breaking-changes.md"})," to find other breaking changes\nand add those in."]}),"\n",(0,o.jsxs)(n.p,{children:["You can also use ",(0,o.jsx)(n.a,{href:"https://git-scm.com/docs/git-log#Documentation/git-log.txt--Lltfuncnamegtltfilegt",children:(0,o.jsx)(n.code,{children:"git log -L :<funcname>:<file>"})}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"$ git log --reverse -L :GetTrafficLightPosition:shell/browser/native_window_mac.mm\ncommit e01b1831d96d5d68f54af879b00c617358df5372\nAuthor: Cheng Zhao <[email protected]>\nDate:   Wed Dec 16 14:30:39 2020 +0900\n\n    feat: make trafficLightPosition work for customButtonOnHover (#26789)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Verify that the Pull Request is correct and make a corresponding entry in the\nAPI History:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-markdown",children:'#### `win.getTrafficLightPosition()` _macOS_ _Deprecated_\n\n\x3c!--\n```YAML history\nadded:\n  - pr-url: https://github.com/electron/electron/pull/22533\nchanges:\n  - pr-url: https://github.com/electron/electron/pull/26789\n    description: "Made `trafficLightPosition` option work for `customButtonOnHover` window."\n    breaking-changes-header: behavior-changed-draggable-regions-on-macos\n```\n--\x3e\n\nReturns `Point` - The custom position for the traffic light buttons in\nframeless window, `{ x: 0, y: 0 }` will be returned when there is no custom\nposition.\n'})}),"\n",(0,o.jsx)(n.p,{children:"We will then look for when the API was originally added:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"$ git log --reverse -L :GetTrafficLightPosition:shell/browser/native_window_mac.mm\ncommit 3e2cec83d927b991855e21cc311ca9046e332601\nAuthor: Samuel Attard <[email protected]>\nDate:   Thu Mar 5 14:22:12 2020 -0800\n\n    feat: programmatically modify traffic light positioning (#22533)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Alternatively, you can use ",(0,o.jsx)(n.code,{children:"git blame"}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:'$ git checkout 1e206deec3e^\nHEAD is now at e8c87859c4 fix: showAboutPanel also on linux (#37828)\n\n$ grep -n "getTrafficLightPosition" docs/api/browser-window.md\n1867:#### `win.getTrafficLightPosition()` _macOS_ _Deprecated_\n\n$ git blame -L1867,1868 -- docs/api/browser-window.md\n0de1012280e (Cheng Zhao    2023-02-17 19:06:32 +0900 1867) #### `win.getTrafficLightPosition()` _macOS_ _Deprecated_\n3e2cec83d92 (Samuel Attard 2020-03-05 14:22:12 -0800 1868) \n\n$ git checkout 0de1012280e^\nHEAD is now at 0a5e634736 test: rename & split internal module tests (#37318)\n\n$ grep -n "getTrafficLightPosition" docs/api/browser-window.md \n1851:#### `win.getTrafficLightPosition()` _macOS_\n\n$ git blame -L1851,1852 -- docs/api/browser-window.md\n3e2cec83d92 (Samuel Attard 2020-03-05 14:22:12 -0800 1851) #### `win.getTrafficLightPosition()` _macOS_\n3e2cec83d92 (Samuel Attard 2020-03-05 14:22:12 -0800 1852)\n\n$ git checkout 3e2cec83d92^\nHEAD is now at 1811751c6c docs: clean up dark mode related docs (#22489)\n\n$ grep -n "getTrafficLightPosition" docs/api/browser-window.md\n(Nothing)\n\n$ git checkout 3e2cec83d92\nHEAD is now at 3e2cec83d9 feat: programmatically modify traffic light positioning (#22533)\n'})}),"\n",(0,o.jsx)(n.p,{children:"Verify that the Pull Request is correct and make a corresponding entry in the\nAPI History:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-markdown",children:'#### `win.getTrafficLightPosition()` _macOS_ _Deprecated_\n\n\x3c!--\n```YAML history\nadded:\n  - pr-url: https://github.com/electron/electron/pull/22533\nchanges:\n  - pr-url: https://github.com/electron/electron/pull/26789\n    description: "Made `trafficLightPosition` option work for `customButtonOnHover` window."\n    breaking-changes-header: behavior-changed-draggable-regions-on-macos\ndeprecated:\n  - pr-url: https://github.com/electron/electron/pull/37878\n    breaking-changes-header: deprecated-browserwindowgettrafficlightposition\n```\n--\x3e\n\nReturns `Point` - The custom position for the traffic light buttons in\nframeless window, `{ x: 0, y: 0 }` will be returned when there is no custom\nposition.\n'})})]})}function h(e={}){let{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},28453(e,n,t){t.d(n,{R:()=>s,x:()=>a});var i=t(96540);let o={},r=i.createContext(o);function s(e){let n=i.useContext(r);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.