You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/learn/rsc-sandbox-test.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: RSC Sandbox Test
3
3
---
4
4
5
-
## Basic Server Component {/*basic-server-component*/}
5
+
## Componente de Servidor Básico {/*basic-server-component*/}
6
6
7
7
<SandpackRSC>
8
8
@@ -14,7 +14,7 @@ export default function App() {
14
14
15
15
</SandpackRSC>
16
16
17
-
## Server + Client Components {/*server-client*/}
17
+
## Componentes de Servidor + Cliente {/*server-client*/}
18
18
19
19
<SandpackRSC>
20
20
@@ -48,7 +48,7 @@ export default function Counter() {
48
48
49
49
</SandpackRSC>
50
50
51
-
## Async Server Component with Suspense {/*async-suspense*/}
51
+
## Componente de Servidor Assíncrono com Suspense {/*async-suspense*/}
52
52
53
53
<SandpackRSC>
54
54
@@ -88,9 +88,9 @@ export default async function Albums() {
88
88
89
89
</SandpackRSC>
90
90
91
-
## Streaming Proof {/*streaming-proof*/}
91
+
## Prova de Streaming {/*streaming-proof*/}
92
92
93
-
This demo proves streaming is incremental. The shell renders instantly with a `<Suspense>` fallback. After 2 seconds the async component streams in and replaces it — without re-rendering the outer content. The timestamps show the gap.
93
+
Esta demonstração prova que o streaming é incremental. A estrutura (shell) é renderizada instantaneamente com um fallback do `<Suspense>`. Após 2 segundos, o componente assíncrono é transmitido e o substitui — sem re-renderizar o conteúdo externo. Os timestamps mostram a diferença.
94
94
95
95
<SandpackRSC>
96
96
@@ -145,9 +145,9 @@ export default function Timestamp() {
145
145
146
146
</SandpackRSC>
147
147
148
-
## Flight Data Types {/*flight-data-types*/}
148
+
## Tipos de Dados do Flight {/*flight-data-types*/}
149
149
150
-
This demo passes Map, Set, Date, and BigInt from a server component through the Flight stream to a client component, proving the full Flight protocol type system works end-to-end.
150
+
Esta demonstração passa Map, Set, Date e BigInt de um componente de servidor através do stream Flight para um componente cliente, provando que o sistema de tipos completo do protocolo Flight funciona de ponta a ponta.
151
151
152
152
<SandpackRSC>
153
153
@@ -206,9 +206,9 @@ export default function DataViewer({ map, set, date, big }) {
206
206
207
207
</SandpackRSC>
208
208
209
-
## Promise Streaming with use() {/*promise-streaming-use*/}
209
+
## Streaming de Promise com use() {/*promise-streaming-use*/}
210
210
211
-
The server creates a promise (resolves in 2s) and passes it as a prop through a parent async component that suspends for 3s. When the parent reveals at ~3s, the promise is already resolved — so`use()`returns instantly with no inner fallback. The elapsed time should be ~3000ms (the parent's delay), not~5000ms (which would mean the promise restarted on the client).
211
+
O servidor cria uma promise (resolve em 2s) e a passa como prop através de um componente pai assíncrono que suspende por 3s. Quando o pai é revelado em ~3s, a promise já está resolvida — então`use()`retorna instantaneamente sem um fallback interno. O tempo decorrido deve ser de ~3000ms (o atraso do pai), não~5000ms (o que significaria que a promise reiniciou no cliente).
## Flight Data Types in Server Actions {/*flight-data-types-actions*/}
287
+
## Tipos de Dados do Flight em Ações de Servidor {/*flight-data-types-actions*/}
288
288
289
-
This demo sends Map, Set, Date, and BigInt from a client component *to* a server action via `encodeReply`/`decodeReply`, then verifies the types survived the round trip.
289
+
Esta demonstração envia Map, Set, Date e BigInt de um componente cliente *para* uma ação de servidor via `encodeReply`/`decodeReply`, e então verifica se os tipos sobreviveram à viagem de ida e volta.
## Server Action Mutation + Re-render {/*action-mutation-rerender*/}
391
+
## Mutação de Ação de Servidor + Re-renderização {/*action-mutation-rerender*/}
392
392
393
-
The server action mutates server-side data and returns a confirmation string. The updated list is only visible because the framework automatically re-renders the entire server component tree after the action completes — the server component re-reads the data and streams the new UI to the client.
393
+
A ação de servidor modifica dados no lado do servidor e retorna uma string de confirmação. A lista atualizada só é visível porque o framework re-renderiza automaticamente toda a árvore de componentes do servidor após a conclusão da ação — o componente do servidor relê os dados e transmite a nova UI para o cliente.
## Inline Server Actions {/*inline-server-actions*/}
488
+
## Ações de Servidor Inline {/*inline-server-actions*/}
489
489
490
-
Server actions defined inline inside a server component with `'use server'`on the function body. The action closes over module-level state and is passed as a prop — no separate`actions.js`file needed.
490
+
Ações de servidor definidas inline dentro de um componente de servidor com `'use server'`no corpo da função. A ação fecha sobre o estado do nível do módulo e é passada como prop — nenhum arquivo`actions.js`separado é necessário.
0 commit comments