Skip to content

Commit 7de964a

Browse files
docs: translate resumeToPipeableStream.md to Português (Brasil) (#1235)
Co-authored-by: translate-react-bot[bot] <251169733+translate-react-bot[bot]@users.noreply.github.com>
1 parent 38ffd0b commit 7de964a

1 file changed

Lines changed: 27 additions & 27 deletions

File tree

src/content/reference/react-dom/server/resumeToPipeableStream.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: resumeToPipeableStream
44

55
<Intro>
66

7-
`resumeToPipeableStream` streams a pre-rendered React tree to a pipeable [Node.js Stream.](https://nodejs.org/api/stream.html)
7+
`resumeToPipeableStream` transmite uma árvore React pré-renderizada para um [Stream do Node.js](https://nodejs.org/api/stream.html) "pipeable".
88

99
```js
1010
const {pipe, abort} = await resumeToPipeableStream(reactNode, postponedState, options?)
@@ -16,17 +16,17 @@ const {pipe, abort} = await resumeToPipeableStream(reactNode, postponedState, op
1616
1717
<Note>
1818
19-
This API is specific to Node.js. Environments with [Web Streams,](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) like Deno and modern edge runtimes, should use [`resume`](/reference/react-dom/server/renderToReadableStream) instead.
19+
Esta API é específica para o Node.js. Ambientes com [Web Streams,](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) como Deno e runtimes de edge modernos, devem usar [`resume`](/reference/react-dom/server/renderToReadableStream) em vez disso.
2020
2121
</Note>
2222
2323
---
2424
25-
## Reference {/*reference*/}
25+
## Referência {/*reference*/}
2626
2727
### `resumeToPipeableStream(node, postponed, options?)` {/*resume-to-pipeable-stream*/}
2828
29-
Call `resume` to resume rendering a pre-rendered React tree as HTML into a [Node.js Stream.](https://nodejs.org/api/stream.html#writable-streams)
29+
Chame `resume` para retomar a renderização de uma árvore React pré-renderizada como HTML em um [Stream do Node.js.](https://nodejs.org/api/stream.html#writable-streams)
3030
3131
```js
3232
import { resume } from 'react-dom/server';
@@ -42,37 +42,37 @@ async function handler(request, response) {
4242
}
4343
```
4444
45-
[See more examples below.](#usage)
45+
[Veja mais exemplos abaixo.](#usage)
4646
47-
#### Parameters {/*parameters*/}
47+
#### Parâmetros {/*parameters*/}
4848
49-
* `reactNode`: The React node you called `prerender` with. For example, a JSX element like `<App />`. It is expected to represent the entire document, so the `App` component should render the `<html>` tag.
50-
* `postponedState`: The opaque `postpone` object returned from a [prerender API](/reference/react-dom/static/index), loaded from wherever you stored it (e.g. redis, a file, or S3).
51-
* **optional** `options`: An object with streaming options.
52-
* **optional** `nonce`: A [`nonce`](http://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#nonce) string to allow scripts for [`script-src` Content-Security-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src).
53-
* **optional** `signal`: An [abort signal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that lets you [abort server rendering](#aborting-server-rendering) and render the rest on the client.
54-
* **optional** `onError`: A callback that fires whenever there is a server error, whether [recoverable](/reference/react-dom/server/renderToReadableStream#recovering-from-errors-outside-the-shell) or [not.](/reference/react-dom/server/renderToReadableStream#recovering-from-errors-inside-the-shell) By default, this only calls `console.error`. If you override it to [log crash reports,](/reference/react-dom/server/renderToReadableStream#logging-crashes-on-the-server) make sure that you still call `console.error`.
55-
* **optional** `onShellReady`: A callback that fires right after the [shell](#specifying-what-goes-into-the-shell) has finished. You can call `pipe` here to start streaming. React will [stream the additional content](#streaming-more-content-as-it-loads) after the shell along with the inline `<script>` tags that replace the HTML loading fallbacks with the content.
56-
* **optional** `onShellError`: A callback that fires if there was an error rendering the shell. It receives the error as an argument. No bytes were emitted from the stream yet, and neither `onShellReady` nor `onAllReady` will get called, so you can [output a fallback HTML shell](#recovering-from-errors-inside-the-shell) or use the prelude.
49+
* `reactNode`: O nó React com o qual você chamou `prerender`. Por exemplo, um elemento JSX como `<App />`. Espera-se que ele represente o documento inteiro, então o componente `App` deve renderizar a tag `<html>`.
50+
* `postponedState`: O objeto opaco `postpone` retornado por uma [API de prerender](/reference/react-dom/static/index), carregado de onde quer que você o tenha armazenado (por exemplo, redis, um arquivo ou S3).
51+
* **opcional** `options`: Um objeto com opções de streaming.
52+
* **opcional** `nonce`: Uma string [`nonce`](http://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#nonce) para permitir scripts para [`script-src` Content-Security-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src).
53+
* **opcional** `signal`: Um [sinal abortar](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) que permite [abortar a renderização do servidor](#aborting-server-rendering) e renderizar o restante no cliente.
54+
* **opcional** `onError`: Um callback que é acionado sempre que ocorre um erro no servidor, seja [recuperável](/reference/react-dom/server/renderToReadableStream#recovering-from-errors-outside-the-shell) ou [não.](/reference/react-dom/server/renderToReadableStream#recovering-from-errors-inside-the-shell) Por padrão, isso apenas chama `console.error`. Se você o substituir para [registrar relatórios de falha,](/reference/react-dom/server/renderToReadableStream#logging-crashes-on-the-server) certifique-se de ainda chamar `console.error`.
55+
* **opcional** `onShellReady`: Um callback que é acionado logo após a [shell](#specifying-what-goes-into-the-shell) ter terminado. Você pode chamar `pipe` aqui para começar a transmitir. O React [transmitirá o conteúdo adicional](#streaming-more-content-as-it-loads) após a shell, juntamente com as tags `<script>` inline que substituem os fallbacks de carregamento HTML pelo conteúdo.
56+
* **opcional** `onShellError`: Um callback que é acionado se ocorrer um erro ao renderizar a shell. Ele recebe o erro como argumento. Nenhum byte foi emitido do stream ainda, e nem `onShellReady` nem `onAllReady` serão chamados, então você pode [gerar uma shell HTML de fallback](#recovering-from-errors-inside-the-shell) ou usar o prelúdio.
5757
5858
59-
#### Returns {/*returns*/}
59+
#### Retorna {/*returns*/}
6060
61-
`resume` returns an object with two methods:
61+
`resume` retorna um objeto com dois métodos:
6262
63-
* `pipe` outputs the HTML into the provided [Writable Node.js Stream.](https://nodejs.org/api/stream.html#writable-streams) Call `pipe` in `onShellReady` if you want to enable streaming, or in `onAllReady` for crawlers and static generation.
64-
* `abort` lets you [abort server rendering](#aborting-server-rendering) and render the rest on the client.
63+
* `pipe` gera o HTML no [Stream do Node.js Gravável](https://nodejs.org/api/stream.html#writable-streams) fornecido. Chame `pipe` em `onShellReady` se quiser habilitar o streaming, ou em `onAllReady` para crawlers e geração estática.
64+
* `abort` permite [abortar a renderização do servidor](#aborting-server-rendering) e renderizar o restante no cliente.
6565
66-
#### Caveats {/*caveats*/}
66+
#### Ressalvas {/*caveats*/}
6767
68-
- `resumeToPipeableStream` does not accept options for `bootstrapScripts`, `bootstrapScriptContent`, or `bootstrapModules`. Instead, you need to pass these options to the `prerender` call that generates the `postponedState`. You can also inject bootstrap content into the writable stream manually.
69-
- `resumeToPipeableStream` does not accept `identifierPrefix` since the prefix needs to be the same in both `prerender` and `resumeToPipeableStream`.
70-
- Since `nonce` cannot be provided to prerender, you should only provide `nonce` to `resumeToPipeableStream` if you're not providing scripts to prerender.
71-
- `resumeToPipeableStream` re-renders from the root until it finds a component that was not fully pre-rendered. Only fully prerendered Components (the Component and its children finished prerendering) are skipped entirely.
68+
- `resumeToPipeableStream` não aceita opções para `bootstrapScripts`, `bootstrapScriptContent` ou `bootstrapModules`. Em vez disso, você precisa passar essas opções para a chamada `prerender` que gera o `postponedState`. Você também pode injetar conteúdo bootstrap no stream gravável manualmente.
69+
- `resumeToPipeableStream` não aceita `identifierPrefix`, pois o prefixo precisa ser o mesmo em `prerender` e `resumeToPipeableStream`.
70+
- Como `nonce` não pode ser fornecido ao prerender, você só deve fornecer `nonce` a `resumeToPipeableStream` se não estiver fornecendo scripts ao prerender.
71+
- `resumeToPipeableStream` re-renderiza da raiz até encontrar um componente que não foi totalmente pré-renderizado. Apenas Componentes totalmente pré-renderizados (o Componente e seus filhos terminaram de pré-renderizar) são pulados inteiramente.
7272
73-
## Usage {/*usage*/}
73+
## Uso {/*usage*/}
7474
75-
### Further reading {/*further-reading*/}
75+
### Leitura adicional {/*further-reading*/}
7676
77-
Resuming behaves like `renderToReadableStream`. For more examples, check out the [usage section of `renderToReadableStream`](/reference/react-dom/server/renderToReadableStream#usage).
78-
The [usage section of `prerender`](/reference/react-dom/static/prerender#usage) includes examples of how to use `prerenderToNodeStream` specifically.
77+
O resumo se comporta como `renderToReadableStream`. Para mais exemplos, confira a [seção de uso de `renderToReadableStream`](/reference/react-dom/server/renderToReadableStream#usage).
78+
A [seção de uso de `prerender`](/reference/react-dom/static/prerender#usage) inclui exemplos de como usar `prerenderToNodeStream` especificamente.

0 commit comments

Comments
 (0)