Skip to content

Commit 41339fe

Browse files
authored
docs: Improved conciseness and readability (QwikDev#6404)
* docs: Improved conciseness and readability Rewrote the server$() section to be more concise and easier to read. * Linted codebase with pnpm fmt
1 parent 6238394 commit 41339fe

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

packages/create-qwik/src/helpers/jokes.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,4 @@
166166
["Man said: I changed my Mind, Machine replied: I changed my CPU"],
167167
["Man said: I dreamed of God, Machine replied: I dreamed of Rust"],
168168
["Person: give me just a second, Programmer: give me just a 100 milliseconds"]
169-
170169
]

packages/docs/src/routes/docs/(qwikcity)/server$/index.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ created_at: '2023-03-29T02:35:29Z'
2020

2121
# `server$()`
2222

23-
`server$()` allows you to create a function that always execute on the server, making it a great place to access the DB or perform server-only actions.
24-
25-
`server$` is a form of RPC (Remote Procedure Call) mechanism between the client and server, just like a traditional HTTP endpoint but strongly typed thanks to Typescript, and easier to maintain.
23+
`server$()` allows you to define functions that execute exclusively on the server, making it ideal for server-only operations and database access. It functions as an RPC (Remote Procedure Call) mechanism between the client and server, similar to a traditional HTTP endpoint, but strongly typed with TypeScript and easier to maintain.
2624

2725
Your new function will have the following signature:
2826
`([AbortSignal, ] ...): Promise<T>`
@@ -145,7 +143,7 @@ This API is actually used to implement QwikGPT streaming responses in our docs s
145143

146144
## How does `server$()` work?
147145

148-
A `server$()` wraps a function and returns an async proxy to the function. On the server, the proxy function directly calls the wrapped function, and a HTTP endpoint is automatically created by the `server$()` function.
146+
`server$()` wraps a function and returns an async proxy to the function. On the server, the proxy function directly calls the wrapped function, and a HTTP endpoint is automatically created by the `server$()` function.
149147

150148
On the client, the proxy function invokes the wrapped function via an HTTP request, using `fetch()`.
151149

0 commit comments

Comments
 (0)