Skip to content

Commit 4b12bb6

Browse files
docs: translate compiling-libraries.md to Português (Brasil) (#1226)
Co-authored-by: translate-react-bot[bot] <251169733+translate-react-bot[bot]@users.noreply.github.com>
1 parent ecd68da commit 4b12bb6

1 file changed

Lines changed: 39 additions & 39 deletions

File tree

src/content/reference/react-compiler/compiling-libraries.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,46 @@ title: Compiling Libraries
33
---
44

55
<Intro>
6-
This guide helps library authors understand how to use React Compiler to ship optimized library code to their users.
6+
Este guia ajuda os autores de bibliotecas a entender como usar o React Compiler para enviar código de biblioteca otimizado para seus usuários.
77
</Intro>
88

99
<InlineToc />
1010

11-
## Why Ship Compiled Code? {/*why-ship-compiled-code*/}
11+
## Por que Enviar Código Compilado? {/*why-ship-compiled-code*/}
1212

13-
As a library author, you can compile your library code before publishing to npm. This provides several benefits:
13+
Como autor de uma biblioteca, você pode compilar o código da sua biblioteca antes de publicá-lo no npm. Isso oferece vários benefícios:
1414

15-
- **Performance improvements for all users** - Your library users get optimized code even if they aren't using React Compiler yet
16-
- **No configuration required by users** - The optimizations work out of the box
17-
- **Consistent behavior** - All users get the same optimized version regardless of their build setup
15+
- **Melhorias de performance para todos os usuários** - Seus usuários da biblioteca recebem código otimizado, mesmo que ainda não estejam usando o React Compiler.
16+
- **Nenhuma configuração exigida pelos usuários** - As otimizações funcionam "out of the box".
17+
- **Comportamento consistente** - Todos os usuários recebem a mesma versão otimizada, independentemente da configuração de build.
1818

19-
## Setting Up Compilation {/*setting-up-compilation*/}
19+
## Configurando a Compilação {/*setting-up-compilation*/}
2020

21-
Add React Compiler to your library's build process:
21+
Adicione o React Compiler ao processo de build da sua biblioteca:
2222

2323
<TerminalBlock>
2424
npm install -D babel-plugin-react-compiler@latest
2525
</TerminalBlock>
2626

27-
Configure your build tool to compile your library. For example, with Babel:
27+
Configure sua ferramenta de build para compilar sua biblioteca. Por exemplo, com Babel:
2828

2929
```js
3030
// babel.config.js
3131
module.exports = {
3232
plugins: [
3333
'babel-plugin-react-compiler',
3434
],
35-
// ... other config
35+
// ... outra configuração
3636
};
3737
```
3838

39-
## Backwards Compatibility {/*backwards-compatibility*/}
39+
## Compatibilidade com Versões Anteriores {/*backwards-compatibility*/}
4040

41-
If your library supports React versions below 19, you'll need additional configuration:
41+
Se sua biblioteca suporta versões do React anteriores à 19, você precisará de configuração adicional:
4242

43-
### 1. Install the runtime package {/*install-runtime-package*/}
43+
### 1. Instale o pacote de runtime {/*install-runtime-package*/}
4444

45-
We recommend installing react-compiler-runtime as a direct dependency:
45+
Recomendamos instalar o `react-compiler-runtime` como uma dependência direta:
4646

4747
<TerminalBlock>
4848
npm install react-compiler-runtime@latest
@@ -59,48 +59,48 @@ npm install react-compiler-runtime@latest
5959
}
6060
```
6161

62-
### 2. Configure the target version {/*configure-target-version*/}
62+
### 2. Configure a versão de destino {/*configure-target-version*/}
6363

64-
Set the minimum React version your library supports:
64+
Defina a versão mínima do React que sua biblioteca suporta:
6565

6666
```js
6767
{
68-
target: '17', // Minimum supported React version
68+
target: '17', // Versão mínima suportada do React
6969
}
7070
```
7171

72-
## Testing Strategy {/*testing-strategy*/}
72+
## Estratégia de Testes {/*testing-strategy*/}
7373

74-
Test your library both with and without compilation to ensure compatibility. Run your existing test suite against the compiled code, and also create a separate test configuration that bypasses the compiler. This helps catch any issues that might arise from the compilation process and ensures your library works correctly in all scenarios.
74+
Teste sua biblioteca com e sem compilação para garantir a compatibilidade. Execute sua suíte de testes existente contra o código compilado e também crie uma configuração de teste separada que ignore o compilador. Isso ajuda a capturar quaisquer problemas que possam surgir do processo de compilação e garante que sua biblioteca funcione corretamente em todos os cenários.
7575

76-
## Troubleshooting {/*troubleshooting*/}
76+
## Solução de Problemas {/*troubleshooting*/}
7777

78-
### Library doesn't work with older React versions {/*library-doesnt-work-with-older-react-versions*/}
78+
### A biblioteca não funciona com versões mais antigas do React {/*library-doesnt-work-with-older-react-versions*/}
7979

80-
If your compiled library throws errors in React 17 or 18:
80+
Se sua biblioteca compilada gerar erros no React 17 ou 18:
8181

82-
1. Verify you've installed `react-compiler-runtime` as a dependency
83-
2. Check that your `target` configuration matches your minimum supported React version
84-
3. Ensure the runtime package is included in your published bundle
82+
1. Verifique se você instalou `react-compiler-runtime` como uma dependência.
83+
2. Verifique se sua configuração `target` corresponde à sua versão mínima suportada do React.
84+
3. Certifique-se de que o pacote de runtime esteja incluído no seu bundle publicado.
8585

86-
### Compilation conflicts with other Babel plugins {/*compilation-conflicts-with-other-babel-plugins*/}
86+
### Conflitos de compilação com outros plugins do Babel {/*compilation-conflicts-with-other-babel-plugins*/}
8787

88-
Some Babel plugins may conflict with React Compiler:
88+
Alguns plugins do Babel podem entrar em conflito com o React Compiler:
8989

90-
1. Place `babel-plugin-react-compiler` early in your plugin list
91-
2. Disable conflicting optimizations in other plugins
92-
3. Test your build output thoroughly
90+
1. Coloque `babel-plugin-react-compiler` no início da sua lista de plugins.
91+
2. Desative otimizações conflitantes em outros plugins.
92+
3. Teste minuciosamente a saída do seu build.
9393

94-
### Runtime module not found {/*runtime-module-not-found*/}
94+
### Módulo de runtime não encontrado {/*runtime-module-not-found*/}
9595

96-
If users see "Cannot find module 'react-compiler-runtime'":
96+
Se os usuários virem "Cannot find module 'react-compiler-runtime'":
9797

98-
1. Ensure the runtime is listed in `dependencies`, not `devDependencies`
99-
2. Check that your bundler includes the runtime in the output
100-
3. Verify the package is published to npm with your library
98+
1. Certifique-se de que o runtime esteja listado em `dependencies`, não em `devDependencies`.
99+
2. Verifique se seu bundler inclui o runtime na saída.
100+
3. Verifique se o pacote foi publicado no npm junto com sua biblioteca.
101101

102-
## Next Steps {/*next-steps*/}
102+
## Próximos Passos {/*next-steps*/}
103103

104-
- Learn about [debugging techniques](/learn/react-compiler/debugging) for compiled code
105-
- Check the [configuration options](/reference/react-compiler/configuration) for all compiler options
106-
- Explore [compilation modes](/reference/react-compiler/compilationMode) for selective optimization
104+
- Saiba mais sobre [técnicas de depuração](/learn/react-compiler/debugging) para código compilado.
105+
- Verifique as [opções de configuração](/reference/react-compiler/configuration) para todas as opções do compilador.
106+
- Explore [modos de compilação](/reference/react-compiler/compilationMode) para otimização seletiva.

0 commit comments

Comments
 (0)