Skip to content

Commit 83bdc56

Browse files
author
Brian Vaughn
authored
Remove @octokit/rest dependency from DevTools (#21317)
1 parent b9c6a2b commit 83bdc56

File tree

3 files changed

+11
-130
lines changed

3 files changed

+11
-130
lines changed

packages/react-devtools-shared/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
},
99
"dependencies": {
1010
"@babel/runtime": "^7.11.2",
11-
"@octokit/rest": "^18.5.2",
1211
"@reach/menu-button": "^0.1.17",
1312
"@reach/tooltip": "^0.2.2",
1413
"clipboard-js": "^0.3.6",

packages/react-devtools-shared/src/devtools/views/ErrorBoundary/githubAPI.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
* @flow
88
*/
99

10-
import {Octokit} from '@octokit/rest';
11-
1210
export type GitHubIssue = {|
1311
title: string,
1412
url: string,
1513
|};
1614

15+
const GITHUB_ISSUES_API = 'https://api.github.com/search/issues';
16+
1717
export async function searchGitHubIssues(
1818
message: string,
1919
): Promise<GitHubIssue | null> {
@@ -29,11 +29,14 @@ export async function searchGitHubIssues(
2929
'repo:facebook/react',
3030
];
3131

32-
const octokit = new Octokit();
33-
const {data} = await octokit.search.issuesAndPullRequests({
34-
q: message + ' ' + filters.join(' '),
35-
});
36-
32+
const response = await fetch(
33+
GITHUB_ISSUES_API +
34+
'?q=' +
35+
encodeURIComponent(message) +
36+
'%20' +
37+
filters.map(encodeURIComponent).join('%20'),
38+
);
39+
const data = await response.json();
3740
if (data.items.length > 0) {
3841
const item = data.items[0];
3942
return {

yarn.lock

Lines changed: 1 addition & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,26 +1814,6 @@
18141814
read-package-json-fast "^1.1.1"
18151815
readdir-scoped-modules "^1.1.0"
18161816

1817-
"@octokit/auth-token@^2.4.4":
1818-
version "2.4.5"
1819-
resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.4.5.tgz#568ccfb8cb46f36441fac094ce34f7a875b197f3"
1820-
integrity sha512-BpGYsPgJt05M7/L/5FoE1PiAbdxXFZkX/3kDYcsvd1v6UhlnE5e96dTDr0ezX/EFwciQxf3cNV0loipsURU+WA==
1821-
dependencies:
1822-
"@octokit/types" "^6.0.3"
1823-
1824-
"@octokit/core@^3.2.3":
1825-
version "3.4.0"
1826-
resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.4.0.tgz#b48aa27d755b339fe7550548b340dcc2b513b742"
1827-
integrity sha512-6/vlKPP8NF17cgYXqucdshWqmMZGXkuvtcrWCgU5NOI0Pl2GjlmZyWgBMrU8zJ3v2MJlM6++CiB45VKYmhiWWg==
1828-
dependencies:
1829-
"@octokit/auth-token" "^2.4.4"
1830-
"@octokit/graphql" "^4.5.8"
1831-
"@octokit/request" "^5.4.12"
1832-
"@octokit/request-error" "^2.0.5"
1833-
"@octokit/types" "^6.0.3"
1834-
before-after-hook "^2.2.0"
1835-
universal-user-agent "^6.0.0"
1836-
18371817
"@octokit/endpoint@^5.1.0":
18381818
version "5.3.2"
18391819
resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-5.3.2.tgz#2deda2d869cac9ba7f370287d55667be2a808d4b"
@@ -1844,49 +1824,6 @@
18441824
universal-user-agent "^3.0.0"
18451825
url-template "^2.0.8"
18461826

1847-
"@octokit/endpoint@^6.0.1":
1848-
version "6.0.11"
1849-
resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.11.tgz#082adc2aebca6dcefa1fb383f5efb3ed081949d1"
1850-
integrity sha512-fUIPpx+pZyoLW4GCs3yMnlj2LfoXTWDUVPTC4V3MUEKZm48W+XYpeWSZCv+vYF1ZABUm2CqnDVf1sFtIYrj7KQ==
1851-
dependencies:
1852-
"@octokit/types" "^6.0.3"
1853-
is-plain-object "^5.0.0"
1854-
universal-user-agent "^6.0.0"
1855-
1856-
"@octokit/graphql@^4.5.8":
1857-
version "4.6.1"
1858-
resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.6.1.tgz#f975486a46c94b7dbe58a0ca751935edc7e32cc9"
1859-
integrity sha512-2lYlvf4YTDgZCTXTW4+OX+9WTLFtEUc6hGm4qM1nlZjzxj+arizM4aHWzBVBCxY9glh7GIs0WEuiSgbVzv8cmA==
1860-
dependencies:
1861-
"@octokit/request" "^5.3.0"
1862-
"@octokit/types" "^6.0.3"
1863-
universal-user-agent "^6.0.0"
1864-
1865-
"@octokit/openapi-types@^6.0.0":
1866-
version "6.0.0"
1867-
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-6.0.0.tgz#7da8d7d5a72d3282c1a3ff9f951c8133a707480d"
1868-
integrity sha512-CnDdK7ivHkBtJYzWzZm7gEkanA7gKH6a09Eguz7flHw//GacPJLmkHA3f3N++MJmlxD1Fl+mB7B32EEpSCwztQ==
1869-
1870-
"@octokit/plugin-paginate-rest@^2.6.2":
1871-
version "2.13.3"
1872-
resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.13.3.tgz#f0f1792230805108762d87906fb02d573b9e070a"
1873-
integrity sha512-46lptzM9lTeSmIBt/sVP/FLSTPGx6DCzAdSX3PfeJ3mTf4h9sGC26WpaQzMEq/Z44cOcmx8VsOhO+uEgE3cjYg==
1874-
dependencies:
1875-
"@octokit/types" "^6.11.0"
1876-
1877-
"@octokit/plugin-request-log@^1.0.2":
1878-
version "1.0.3"
1879-
resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.3.tgz#70a62be213e1edc04bb8897ee48c311482f9700d"
1880-
integrity sha512-4RFU4li238jMJAzLgAwkBAw+4Loile5haQMQr+uhFq27BmyJXcXSKvoQKqh0agsZEiUlW6iSv3FAgvmGkur7OQ==
1881-
1882-
"@octokit/plugin-rest-endpoint-methods@5.0.0":
1883-
version "5.0.0"
1884-
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.0.0.tgz#cf2cdeb24ea829c31688216a5b165010b61f9a98"
1885-
integrity sha512-Jc7CLNUueIshXT+HWt6T+M0sySPjF32mSFQAK7UfAg8qGeRI6OM1GSBxDLwbXjkqy2NVdnqCedJcP1nC785JYg==
1886-
dependencies:
1887-
"@octokit/types" "^6.13.0"
1888-
deprecation "^2.3.1"
1889-
18901827
"@octokit/request-error@^1.0.1", "@octokit/request-error@^1.0.2":
18911828
version "1.0.4"
18921829
resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-1.0.4.tgz#15e1dc22123ba4a9a4391914d80ec1e5303a23be"
@@ -1895,15 +1832,6 @@
18951832
deprecation "^2.0.0"
18961833
once "^1.4.0"
18971834

1898-
"@octokit/request-error@^2.0.0", "@octokit/request-error@^2.0.5":
1899-
version "2.0.5"
1900-
resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.0.5.tgz#72cc91edc870281ad583a42619256b380c600143"
1901-
integrity sha512-T/2wcCFyM7SkXzNoyVNWjyVlUwBvW3igM3Btr/eKYiPmucXTtkxt2RBsf6gn3LTzaLSLTQtNmvg+dGsOxQrjZg==
1902-
dependencies:
1903-
"@octokit/types" "^6.0.3"
1904-
deprecation "^2.0.0"
1905-
once "^1.4.0"
1906-
19071835
"@octokit/request@^5.0.0":
19081836
version "5.0.2"
19091837
resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.0.2.tgz#59a920451f24811c016ddc507adcc41aafb2dca5"
@@ -1917,18 +1845,6 @@
19171845
once "^1.4.0"
19181846
universal-user-agent "^3.0.0"
19191847

1920-
"@octokit/request@^5.3.0", "@octokit/request@^5.4.12":
1921-
version "5.4.15"
1922-
resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.4.15.tgz#829da413dc7dd3aa5e2cdbb1c7d0ebe1f146a128"
1923-
integrity sha512-6UnZfZzLwNhdLRreOtTkT9n57ZwulCve8q3IT/Z477vThu6snfdkBuhxnChpOKNGxcQ71ow561Qoa6uqLdPtag==
1924-
dependencies:
1925-
"@octokit/endpoint" "^6.0.1"
1926-
"@octokit/request-error" "^2.0.0"
1927-
"@octokit/types" "^6.7.1"
1928-
is-plain-object "^5.0.0"
1929-
node-fetch "^2.6.1"
1930-
universal-user-agent "^6.0.0"
1931-
19321848
"@octokit/rest@^16.14.1":
19331849
version "16.28.7"
19341850
resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-16.28.7.tgz#a2c2db5b318da84144beba82d19c1a9dbdb1a1fa"
@@ -1948,23 +1864,6 @@
19481864
universal-user-agent "^3.0.0"
19491865
url-template "^2.0.8"
19501866

1951-
"@octokit/rest@^18.5.2":
1952-
version "18.5.2"
1953-
resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.5.2.tgz#0369e554b7076e3749005147be94c661c7a5a74b"
1954-
integrity sha512-Kz03XYfKS0yYdi61BkL9/aJ0pP2A/WK5vF/syhu9/kY30J8He3P68hv9GRpn8bULFx2K0A9MEErn4v3QEdbZcw==
1955-
dependencies:
1956-
"@octokit/core" "^3.2.3"
1957-
"@octokit/plugin-paginate-rest" "^2.6.2"
1958-
"@octokit/plugin-request-log" "^1.0.2"
1959-
"@octokit/plugin-rest-endpoint-methods" "5.0.0"
1960-
1961-
"@octokit/types@^6.0.3", "@octokit/types@^6.11.0", "@octokit/types@^6.13.0", "@octokit/types@^6.7.1":
1962-
version "6.13.0"
1963-
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.13.0.tgz#779e5b7566c8dde68f2f6273861dd2f0409480d0"
1964-
integrity sha512-W2J9qlVIU11jMwKHUp5/rbVUeErqelCsO5vW5PKNb7wAXQVUz87Rc+imjlEvpvbH8yUb+KHmv8NEjVZdsdpyxA==
1965-
dependencies:
1966-
"@octokit/openapi-types" "^6.0.0"
1967-
19681867
"@pmmmwh/react-refresh-webpack-plugin@^0.4.1":
19691868
version "0.4.1"
19701869
resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.4.1.tgz#a4db0ed8e58c2f8566161c9a8cdf1d095c9a891b"
@@ -3579,11 +3478,6 @@ before-after-hook@^2.0.0:
35793478
resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.1.0.tgz#b6c03487f44e24200dd30ca5e6a1979c5d2fb635"
35803479
integrity sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==
35813480

3582-
before-after-hook@^2.2.0:
3583-
version "2.2.1"
3584-
resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.1.tgz#73540563558687586b52ed217dad6a802ab1549c"
3585-
integrity sha512-/6FKxSTWoJdbsLDF8tdIjaRiFXiE6UHsEHE3OPI/cwPURCVi1ukP0gmLn7XWEiFk5TcwQjjY5PWsU+j+tgXgmw==
3586-
35873481
big.js@^5.2.2:
35883482
version "5.2.2"
35893483
resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328"
@@ -5246,7 +5140,7 @@ depd@^1.1.2, depd@~1.1.2:
52465140
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"
52475141
integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=
52485142

5249-
deprecation@^2.0.0, deprecation@^2.3.1:
5143+
deprecation@^2.0.0:
52505144
version "2.3.1"
52515145
resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919"
52525146
integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==
@@ -8234,11 +8128,6 @@ is-plain-object@^3.0.0:
82348128
dependencies:
82358129
isobject "^4.0.0"
82368130

8237-
is-plain-object@^5.0.0:
8238-
version "5.0.0"
8239-
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344"
8240-
integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==
8241-
82428131
is-posix-bracket@^0.1.0:
82438132
version "0.1.1"
82448133
resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4"
@@ -10153,11 +10042,6 @@ node-fetch@^2.3.0, node-fetch@^2.6.0:
1015310042
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd"
1015410043
integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==
1015510044

10156-
node-fetch@^2.6.1:
10157-
version "2.6.1"
10158-
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
10159-
integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==
10160-
1016110045
node-forge@0.9.0:
1016210046
version "0.9.0"
1016310047
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.9.0.tgz#d624050edbb44874adca12bb9a52ec63cb782579"
@@ -13917,11 +13801,6 @@ universal-user-agent@^3.0.0:
1391713801
dependencies:
1391813802
os-name "^3.0.0"
1391913803

13920-
universal-user-agent@^6.0.0:
13921-
version "6.0.0"
13922-
resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee"
13923-
integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==
13924-
1392513804
universalify@^0.1.0:
1392613805
version "0.1.2"
1392713806
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"

0 commit comments

Comments
 (0)