Skip to content

Commit 555bdff

Browse files
authored
Merge pull request #15 from motiz88/scrape-hermes-cdpagent
Scrape modern Hermes implementation (CDPAgent) instead of CDPHandler, enable `@cdp` comments
2 parents 4c3717a + 26994ba commit 555bdff

17 files changed

Lines changed: 436 additions & 21 deletions

app/devtools-protocol/[version]/ImplementationLink.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,29 @@ export async function ImplementationLink({
2828
width={20}
2929
height={20}
3030
alt=""
31-
title="Hermes CDPHandler"
31+
title="Hermes CDPAgent"
3232
className="inline-block mb-1"
3333
/>
3434
</>
3535
);
3636
break;
3737

38+
case 'hermes-legacy':
39+
linkContents = (
40+
<>
41+
Hermes (legacy){' '}
42+
<Image
43+
src="/images/hermes-logo.svg"
44+
width={20}
45+
height={20}
46+
alt=""
47+
title="Hermes CDPHandler"
48+
className="inline-block mb-1 grayscale"
49+
/>
50+
</>
51+
);
52+
break;
53+
3854
case 'react-native':
3955
linkContents = (
4056
<>

app/devtools-protocol/[version]/[domain]/DomainEventsCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function DomainEventsCard({
2828
domain.events != null &&
2929
domain.events?.length !== 0 && (
3030
<>
31-
<h2 className="font-bold text-lg mt-4 mb-2 max-w-4xl mx-auto">
31+
<h2 className="font-bold text-lg mt-4 mb-2 max-w-5xl mx-auto">
3232
Events
3333
</h2>
3434
<Card>

app/devtools-protocol/[version]/[domain]/DomainMemberExternalComments.tsx

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,21 @@ function CommentImplementationIcon({
2828
width={20}
2929
height={20}
3030
alt=""
31-
title="Hermes CDPHandler"
31+
title="Hermes CDPAgent"
3232
className="inline-block mb-1"
3333
/>
3434
);
35+
case 'hermes-legacy':
36+
return (
37+
<Image
38+
src="/images/hermes-logo.svg"
39+
width={20}
40+
height={20}
41+
alt=""
42+
title="Hermes CDPHandler"
43+
className="inline-block mb-1 grayscale"
44+
/>
45+
);
3546
case 'react-native':
3647
return (
3748
<Image
@@ -168,6 +179,20 @@ export function DomainMemberExternalComments({
168179
memberKey={memberKey}
169180
protocolImplementationData={protocolImplementationData}
170181
/>
182+
<DomainMemberExternalCommentsForImplementation
183+
domain={domain}
184+
implementationId="hermes"
185+
kind={kind}
186+
memberKey={memberKey}
187+
protocolImplementationData={protocolImplementationData}
188+
/>
189+
<DomainMemberExternalCommentsForImplementation
190+
domain={domain}
191+
implementationId="hermes-legacy"
192+
kind={kind}
193+
memberKey={memberKey}
194+
protocolImplementationData={protocolImplementationData}
195+
/>
171196
</div>
172197
);
173198
}

app/devtools-protocol/[version]/[domain]/DomainMemberExternalLinks.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ export function DomainMemberExternalLinks({
4242
memberKey={memberKey}
4343
protocolImplementationData={protocolImplementationData}
4444
/>
45+
<DomainMemberImplementationLink
46+
domain={domain}
47+
implementationId="hermes-legacy"
48+
kind={kind}
49+
memberKey={memberKey}
50+
protocolImplementationData={protocolImplementationData}
51+
/>
4552
<DomainMemberImplementationLink
4653
domain={domain}
4754
implementationId="react-native"

app/devtools-protocol/[version]/[domain]/DomainMemberHeading.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function DomainMemberHeading({
4040
protocolMetadata={protocolMetadata}
4141
/>
4242
<h3
43-
className="font-bold text-lg mt-4 mb-2 max-w-4xl mx-auto font-mono"
43+
className="font-bold text-lg mt-4 mb-2 max-w-5xl mx-auto font-mono"
4444
id={`${kind}-${encodeURIComponent(key)}`}
4545
>
4646
<DimText>{domain}.</DimText>

app/devtools-protocol/[version]/[domain]/DomainMemberImplementationLink.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function DomainMemberImplementationLink({
1818
protocolImplementationData,
1919
small,
2020
}: {
21-
implementationId: 'hermes' | 'react-native' | 'react-native-hermes';
21+
implementationId: 'hermes' | 'hermes-legacy' | 'react-native' | 'react-native-hermes';
2222
kind: 'method' | 'event' | 'type';
2323
domain: string;
2424
memberKey: string;
@@ -42,12 +42,25 @@ export function DomainMemberImplementationLink({
4242
width={small ? 20 : 24}
4343
height={small ? 20 : 24}
4444
alt="Hermes"
45-
title="Referenced in Hermes CDPHandler"
45+
title="Referenced in Hermes CDPAgent"
4646
className="inline-block"
4747
/>
4848
);
4949
break;
5050
}
51+
case 'hermes-legacy': {
52+
linkContents = (
53+
<Image
54+
src="/images/hermes-logo.svg"
55+
width={small ? 20 : 24}
56+
height={small ? 20 : 24}
57+
alt="Hermes (Legacy)"
58+
title="Referenced in Hermes CDPHandler"
59+
className="inline-block grayscale"
60+
/>
61+
);
62+
break;
63+
}
5164
case 'react-native': {
5265
linkContents = (
5366
<Image

app/devtools-protocol/[version]/[domain]/DomainMethodsCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function DomainMethodsCard({
2929
domain.commands != null &&
3030
domain.commands?.length !== 0 && (
3131
<>
32-
<h2 className="font-bold text-lg mt-4 mb-2 max-w-4xl mx-auto">
32+
<h2 className="font-bold text-lg mt-4 mb-2 max-w-5xl mx-auto">
3333
Methods
3434
</h2>
3535
<Card>

app/devtools-protocol/[version]/[domain]/DomainTocSection.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ export function DomainTocSection({
5858
protocolImplementationData={protocolImplementationData}
5959
small
6060
/>
61+
<DomainMemberImplementationLink
62+
domain={domain}
63+
implementationId="hermes-legacy"
64+
kind={kind}
65+
memberKey={key}
66+
protocolImplementationData={protocolImplementationData}
67+
small
68+
/>
6169
<DomainMemberImplementationLink
6270
domain={domain}
6371
implementationId="react-native"

app/devtools-protocol/[version]/[domain]/DomainTypesCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function DomainTypesCard({
3030
domain.types != null &&
3131
domain.types.length !== 0 && (
3232
<>
33-
<h2 className="font-bold text-lg mt-4 mb-2 max-w-4xl mx-auto">Types</h2>
33+
<h2 className="font-bold text-lg mt-4 mb-2 max-w-5xl mx-auto">Types</h2>
3434
<Card>
3535
{domain.types.map((type, index) => (
3636
<div key={type.id} className="group">

app/devtools-protocol/[version]/page.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ export default async function ProtocolVersionPage({
6060
protocol={protocol.protocol}
6161
protocolImplementationData={protocolImplementationData}
6262
/>
63+
<ImplementationStats
64+
implementationId="hermes-legacy"
65+
implementation={implementationModelsById.get('hermes-legacy')!}
66+
protocol={protocol.protocol}
67+
protocolImplementationData={protocolImplementationData}
68+
/>
6369
<ImplementationStats
6470
implementationId="react-native-hermes"
6571
implementation={implementationModelsById.get('react-native-hermes')!}

0 commit comments

Comments
 (0)