Skip to content

Commit a395b1a

Browse files
committed
fix fmt and devtools config
1 parent 8b7b544 commit a395b1a

File tree

5 files changed

+47
-34
lines changed

5 files changed

+47
-34
lines changed

components/Footer.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ const LINKS = [
1616
];
1717

1818
export default function Footer() {
19-
const footer = tw`w-full border(t-1 gray-200) h-32 flex flex-col gap-4 justify-center`;
20-
const inner = tw`mx-auto max-w-screen-lg flex items-center justify-center gap-4`;
19+
const footer = tw
20+
`w-full border(t-1 gray-200) h-32 flex flex-col gap-4 justify-center`;
21+
const inner = tw
22+
`mx-auto max-w-screen-lg flex items-center justify-center gap-4`;
2123
const linkStyle = tw`text-gray-800 hover:underline`;
2224
const copyright = tw`text(gray-800 center)`;
2325
return (

docs/wrp/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ WRP provides these advantages.
55

66
- Ready-to-use, platform-dependent implementations (TypeScript, Swift, Kotlin)
77
- Predefine your rpcs and messages to use with protocol buffers.
8-
- Supports all 4 rpc call types (Unary, Server Streaming, Client Streaming,
9-
Bidirectional Streaming)
8+
- Supports all 4 rpc call types (Unary, Server/Client Streaming, Bidirectional
9+
Streaming)
1010

1111
Here is a running example (implemented between parent and iframe window):
1212
[iframe example](https://pbkit.dev/wrp-iframe-host)

islands/WrpExampleGuest.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,13 @@ function useWrpExampleServiceClient() {
7878
const channel = useMemo(() => socket && createWrpChannel(socket), [socket]);
7979
const wrpClientImpl = useWrpClientImpl(channel);
8080
const [serviceClient, setServiceClient] = useState<Service | undefined>(
81-
undefined,
81+
undefined
8282
);
8383
useEffect(() => {
8484
if (!wrpClientImpl) return;
85-
setServiceClient(createServiceClient(wrpClientImpl, { devtools: true }));
85+
setServiceClient(
86+
createServiceClient(wrpClientImpl, { devtools: { tags: ["WrpClient"] } })
87+
);
8688
}, [wrpClientImpl]);
8789
return serviceClient;
8890
}

islands/WrpIframeHost.tsx

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ export default function WrpIframeHost() {
2626
res.header({});
2727
const value = getState().sliderValue;
2828
res.send({ value });
29-
const off = stateChanges.on(
30-
"sliderValue",
31-
(value) => res.send({ value }),
29+
const off = stateChanges.on("sliderValue", (value) =>
30+
res.send({ value })
3231
);
3332
req.metadata?.on("cancel-response", teardown);
3433
req.metadata?.on("close", teardown);
@@ -83,22 +82,7 @@ export default function WrpIframeHost() {
8382
isFold ? `hidden` : ""
8483
}`}
8584
>
86-
{`syntax = "proto3";
87-
package pbkit.wrp.example;
88-
89-
service WrpExampleService {
90-
rpc GetTextValue(GetTextValueRequest) returns (GetTextValueResponse);
91-
rpc GetSliderValue(GetSliderValueRequest) returns (stream GetSliderValueResponse);
92-
}
93-
94-
message GetTextValueRequest {}
95-
message GetTextValueResponse {
96-
string text = 1;
97-
}
98-
message GetSliderValueRequest {}
99-
message GetSliderValueResponse {
100-
int32 value = 1;
101-
}`}
85+
{proto}
10286
</code>
10387
<div class={tw`flex flex-col gap-4`}>
10488
<label class={styles.label("blue")}>
@@ -148,3 +132,20 @@ message GetSliderValueResponse {
148132
</>
149133
);
150134
}
135+
136+
const proto = `syntax = "proto3";
137+
package pbkit.wrp.example;
138+
139+
service WrpExampleService {
140+
rpc GetTextValue(GetTextValueRequest) returns (GetTextValueResponse);
141+
rpc GetSliderValue(GetSliderValueRequest) returns (stream GetSliderValueResponse);
142+
}
143+
144+
message GetTextValueRequest {}
145+
message GetTextValueResponse {
146+
string text = 1;
147+
}
148+
message GetSliderValueRequest {}
149+
message GetSliderValueResponse {
150+
int32 value = 1;
151+
}`;

routes/index.tsx

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export default function MainPage() {
2828
}
2929

3030
function Hero() {
31-
const container = tw`max-w-screen-lg mx-auto w-full h(48 sm:64) flex items-center tracking-tight`;
31+
const container = tw
32+
`max-w-screen-lg mx-auto w-full h(48 sm:64) flex items-center tracking-tight`;
3233
const title = tw`text(4xl sm:5xl lg:6xl gray-900) font-extrabold`;
3334
const subtitle = tw`mt-4 text(xl sm:2xl gray-800) `;
3435

@@ -45,16 +46,19 @@ function Hero() {
4546
function Intro() {
4647
return (
4748
<section
48-
class={tw`max-w-screen-lg mx-auto mb-16 px(4 sm:6 md:8) space-y-4 tracking-tight`}
49+
class={tw
50+
`max-w-screen-lg mx-auto mb-16 px(4 sm:6 md:8) space-y-4 tracking-tight`}
4951
>
5052
<p class={tw`text(xl gray-800)`}>
51-
<b>pbkit</b> is a collection of tools for modern web development with
52-
protocol buffers.
53+
<b>pbkit</b>{" "}
54+
is a collection of tools for modern web development with protocol
55+
buffers.
5356
</p>
5457
<div class={tw`grid sm:grid-cols-2 gap-4`}>
5558
<a
5659
href="/docs/introduction"
57-
class={tw`bg(white) shadow-lg hover:shadow-2xl active:shadow-xl transition-shadow p-4 rounded-md relative overflow-hidden`}
60+
class={tw
61+
`bg(white) shadow-lg hover:shadow-2xl active:shadow-xl transition-shadow p-4 rounded-md relative overflow-hidden`}
5862
>
5963
<h1 class={tw`text(2xl) font-bold`}>pb - Protobuf compiler</h1>
6064
<p class={tw`mt-4`}>
@@ -67,7 +71,8 @@ function Intro() {
6771
</a>
6872
<a
6973
href="/docs/introduction"
70-
class={tw`bg(white) shadow-lg hover:shadow-2xl active:shadow-xl transition-shadow p-4 rounded-md relative overflow-hidden`}
74+
class={tw
75+
`bg(white) shadow-lg hover:shadow-2xl active:shadow-xl transition-shadow p-4 rounded-md relative overflow-hidden`}
7176
>
7277
<h1 class={tw`text(2xl) font-bold`}>pollapo - Package manager</h1>
7378
<p class={tw`mt-4`}>
@@ -80,7 +85,8 @@ function Intro() {
8085
</a>
8186
<a
8287
href="/docs/wrp"
83-
class={tw`bg(white) shadow-lg hover:shadow-2xl active:shadow-xl transition-shadow p-4 rounded-md relative overflow-hidden`}
88+
class={tw
89+
`bg(white) shadow-lg hover:shadow-2xl active:shadow-xl transition-shadow p-4 rounded-md relative overflow-hidden`}
8490
>
8591
<h1 class={tw`text(2xl) font-bold`}>
8692
wrp - RPC protocol for WebView
@@ -97,7 +103,8 @@ function Intro() {
97103
<a
98104
target="_blank"
99105
href="https://marketplace.visualstudio.com/items?itemName=pbkit.vscode-pbkit"
100-
class={tw`bg(white) shadow-lg hover:shadow-2xl active:shadow-xl transition-shadow p-4 rounded-md relative overflow-hidden`}
106+
class={tw
107+
`bg(white) shadow-lg hover:shadow-2xl active:shadow-xl transition-shadow p-4 rounded-md relative overflow-hidden`}
101108
>
102109
<h1 class={tw`text(2xl) font-bold`}>Editor extension</h1>
103110
<h2 class={tw`text(lg)`}>VSCode extension with language server</h2>
@@ -111,7 +118,8 @@ function Intro() {
111118
<a
112119
target="_blank"
113120
href="https://chrome.google.com/webstore/detail/pbkit-devtools/fjacmiijeihblfhobghceofniolonhca"
114-
class={tw`bg(white) shadow-lg hover:shadow-2xl active:shadow-xl transition-shadow p-4 rounded-md relative overflow-hidden`}
121+
class={tw
122+
`bg(white) shadow-lg hover:shadow-2xl active:shadow-xl transition-shadow p-4 rounded-md relative overflow-hidden`}
115123
>
116124
<h1 class={tw`text(2xl) font-bold`}>Chrome DevTools</h1>
117125
<h2 class={tw`text(lg)`}>Chrome DevTools for pbkit</h2>

0 commit comments

Comments
 (0)