Skip to content

Commit a6ea941

Browse files
authored
feat: translate React Compiler incremental adoption page to Portuguese (#1099)
1 parent 8bceaaa commit a6ea941

File tree

1 file changed

+63
-63
lines changed

1 file changed

+63
-63
lines changed
Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
11
---
2-
title: Incremental Adoption
2+
title: Adoção Incremental
33
---
44

55
<Intro>
6-
React Compiler can be adopted incrementally, allowing you to try it on specific parts of your codebase first. This guide shows you how to gradually roll out the compiler in existing projects.
6+
O React Compiler pode ser adotado incrementalmente, permitindo que você o teste em partes específicas do seu código primeiro. Este guia mostra como implementar gradualmente o compilador em projetos existentes.
77
</Intro>
88

99
<YouWillLearn>
1010

11-
* Why incremental adoption is recommended
12-
* Using Babel overrides for directory-based adoption
13-
* Using the "use memo" directive for opt-in compilation
14-
* Using the "use no memo" directive to exclude components
15-
* Runtime feature flags with gating
16-
* Monitoring your adoption progress
11+
* Por que a adoção incremental é recomendada
12+
* Usando overrides do Babel para adoção baseada em diretório
13+
* Usando a diretiva "use memo" para compilação opt-in
14+
* Usando a diretiva "use no memo" para excluir componentes
15+
* Flags de recurso em tempo de execução com gating
16+
* Monitorando seu progresso de adoção
1717

1818
</YouWillLearn>
1919

20-
## Why Incremental Adoption? {/*why-incremental-adoption*/}
20+
## Por que Adoção Incremental? {/*why-incremental-adoption*/}
2121

22-
React Compiler is designed to optimize your entire codebase automatically, but you don't have to adopt it all at once. Incremental adoption gives you control over the rollout process, letting you test the compiler on small parts of your app before expanding to the rest.
22+
O React Compiler é projetado para otimizar automaticamente todo o seu código, mas você não precisa adotá-lo de uma vez. A adoção incremental dá a você controle sobre o processo de implementação, permitindo que você teste o compilador em pequenas partes do seu app antes de expandir para o resto.
2323

24-
Starting small helps you build confidence in the compiler's optimizations. You can verify that your app behaves correctly with compiled code, measure performance improvements, and identify any edge cases specific to your codebase. This approach is especially valuable for production applications where stability is critical.
24+
Começar pequeno ajuda você a construir confiança nas otimizações do compilador. Você pode verificar que seu app se comporta corretamente com código compilado, medir melhorias de performance e identificar casos extremos específicos do seu código. Esta abordagem é especialmente valiosa para aplicações em produção onde a estabilidade é crítica.
2525

26-
Incremental adoption also makes it easier to address any Rules of React violations the compiler might find. Instead of fixing violations across your entire codebase at once, you can tackle them systematically as you expand compiler coverage. This keeps the migration manageable and reduces the risk of introducing bugs.
26+
A adoção incremental também facilita a correção de violações das Regras do React que o compilador pode encontrar. Em vez de corrigir violações em todo o seu código de uma vez, você pode abordá-las sistematicamente conforme expande a cobertura do compilador. Isso mantém a migração gerenciável e reduz o risco de introduzir bugs.
2727

28-
By controlling which parts of your code get compiled, you can also run A/B tests to measure the real-world impact of the compiler's optimizations. This data helps you make informed decisions about full adoption and demonstrates the value to your team.
28+
Ao controlar quais partes do seu código são compiladas, você também pode executar testes A/B para medir o impacto real das otimizações do compilador. Esses dados ajudam você a tomar decisões informadas sobre a adoção completa e demonstram o valor para sua equipe.
2929

30-
## Approaches to Incremental Adoption {/*approaches-to-incremental-adoption*/}
30+
## Abordagens para Adoção Incremental {/*approaches-to-incremental-adoption*/}
3131

32-
There are three main approaches to adopt React Compiler incrementally:
32+
Existem três abordagens principais para adotar o React Compiler incrementalmente:
3333

34-
1. **Babel overrides** - Apply the compiler to specific directories
35-
2. **Opt-in with "use memo"** - Only compile components that explicitly opt in
36-
3. **Runtime gating** - Control compilation with feature flags
34+
1. **Overrides do Babel** - Aplicar o compilador a diretórios específicos
35+
2. **Opt-in com "use memo"** - Apenas compilar componentes que explicitamente optam por participar
36+
3. **Gating em tempo de execução** - Controlar compilação com flags de recurso
3737

38-
All approaches allow you to test the compiler on specific parts of your application before full rollout.
38+
Todas as abordagens permitem que você teste o compilador em partes específicas da sua aplicação antes da implementação completa.
3939

40-
## Directory-Based Adoption with Babel Overrides {/*directory-based-adoption*/}
40+
## Adoção Baseada em Diretório com Overrides do Babel {/*directory-based-adoption*/}
4141

42-
Babel's `overrides` option lets you apply different plugins to different parts of your codebase. This is ideal for gradually adopting React Compiler directory by directory.
42+
A opção `overrides` do Babel permite que você aplique plugins diferentes a diferentes partes do seu código. Isso é ideal para adotar gradualmente o React Compiler diretório por diretório.
4343

44-
### Basic Configuration {/*basic-configuration*/}
44+
### Configuração Básica {/*basic-configuration*/}
4545

46-
Start by applying the compiler to a specific directory:
46+
Comece aplicando o compilador a um diretório específico:
4747

4848
```js
4949
// babel.config.js
5050
module.exports = {
5151
plugins: [
52-
// Global plugins that apply to all files
52+
// Plugins globais que se aplicam a todos os arquivos
5353
],
5454
overrides: [
5555
{
@@ -62,15 +62,15 @@ module.exports = {
6262
};
6363
```
6464

65-
### Expanding Coverage {/*expanding-coverage*/}
65+
### Expandindo a Cobertura {/*expanding-coverage*/}
6666

67-
As you gain confidence, add more directories:
67+
Conforme você ganha confiança, adicione mais diretórios:
6868

6969
```js
7070
// babel.config.js
7171
module.exports = {
7272
plugins: [
73-
// Global plugins
73+
// Plugins globais
7474
],
7575
overrides: [
7676
{
@@ -82,16 +82,16 @@ module.exports = {
8282
{
8383
test: './src/legacy/**/*.{js,jsx,ts,tsx}',
8484
plugins: [
85-
// Different plugins for legacy code
85+
// Plugins diferentes para código legado
8686
]
8787
}
8888
]
8989
};
9090
```
9191

92-
### With Compiler Options {/*with-compiler-options*/}
92+
### Com Opções do Compilador {/*with-compiler-options*/}
9393

94-
You can also configure compiler options per override:
94+
Você também pode configurar opções do compilador por override:
9595

9696
```js
9797
// babel.config.js
@@ -102,15 +102,15 @@ module.exports = {
102102
test: './src/experimental/**/*.{js,jsx,ts,tsx}',
103103
plugins: [
104104
['babel-plugin-react-compiler', {
105-
// options ...
105+
// opções ...
106106
}]
107107
]
108108
},
109109
{
110110
test: './src/production/**/*.{js,jsx,ts,tsx}',
111111
plugins: [
112112
['babel-plugin-react-compiler', {
113-
// options ...
113+
// opções ...
114114
}]
115115
]
116116
}
@@ -119,15 +119,15 @@ module.exports = {
119119
```
120120

121121

122-
## Opt-in Mode with "use memo" {/*opt-in-mode-with-use-memo*/}
122+
## Modo Opt-in com "use memo" {/*opt-in-mode-with-use-memo*/}
123123

124-
For maximum control, you can use `compilationMode: 'annotation'` to only compile components and hooks that explicitly opt in with the `"use memo"` directive.
124+
Para controle máximo, você pode usar `compilationMode: 'annotation'` para apenas compilar componentes e hooks que explicitamente optam por participar com a diretiva `"use memo"`.
125125

126126
<Note>
127-
This approach gives you fine-grained control over individual components and hooks. It's useful when you want to test the compiler on specific components without affecting entire directories.
127+
Esta abordagem dá a você controle refinado sobre componentes e hooks individuais. É útil quando você quer testar o compilador em componentes específicos sem afetar diretórios inteiros.
128128
</Note>
129129

130-
### Annotation Mode Configuration {/*annotation-mode-configuration*/}
130+
### Configuração do Modo Annotation {/*annotation-mode-configuration*/}
131131

132132
```js
133133
// babel.config.js
@@ -140,13 +140,13 @@ module.exports = {
140140
};
141141
```
142142

143-
### Using the Directive {/*using-the-directive*/}
143+
### Usando a Diretiva {/*using-the-directive*/}
144144

145-
Add `"use memo"` at the beginning of functions you want to compile:
145+
Adicione `"use memo"` no início das funções que você quer compilar:
146146

147147
```js
148148
function TodoList({ todos }) {
149-
"use memo"; // Opt this component into compilation
149+
"use memo"; // Opta este componente para compilação
150150

151151
const sortedTodos = todos.slice().sort();
152152

@@ -160,28 +160,28 @@ function TodoList({ todos }) {
160160
}
161161

162162
function useSortedData(data) {
163-
"use memo"; // Opt this hook into compilation
163+
"use memo"; // Opta este hook para compilação
164164

165165
return data.slice().sort();
166166
}
167167
```
168168

169-
With `compilationMode: 'annotation'`, you must:
170-
- Add `"use memo"` to every component you want optimized
171-
- Add `"use memo"` to every custom hook
172-
- Remember to add it to new components
169+
Com `compilationMode: 'annotation'`, você deve:
170+
- Adicionar `"use memo"` a cada componente que você quer otimizado
171+
- Adicionar `"use memo"` a cada hook customizado
172+
- Lembrar de adicioná-lo a novos componentes
173173

174-
This gives you precise control over which components are compiled while you evaluate the compiler's impact.
174+
Isso dá a você controle preciso sobre quais componentes são compilados enquanto você avalia o impacto do compilador.
175175

176-
## Runtime Feature Flags with Gating {/*runtime-feature-flags-with-gating*/}
176+
## Flags de Recurso em Tempo de Execução com Gating {/*runtime-feature-flags-with-gating*/}
177177

178-
The `gating` option enables you to control compilation at runtime using feature flags. This is useful for running A/B tests or gradually rolling out the compiler based on user segments.
178+
A opção `gating` permite que você controle a compilação em tempo de execução usando flags de recurso. Isso é útil para executar testes A/B ou implementar gradualmente o compilador baseado em segmentos de usuário.
179179

180-
### How Gating Works {/*how-gating-works*/}
180+
### Como o Gating Funciona {/*how-gating-works*/}
181181

182-
The compiler wraps optimized code in a runtime check. If the gate returns `true`, the optimized version runs. Otherwise, the original code runs.
182+
O compilador envolve código otimizado em uma verificação em tempo de execução. Se o gate retorna `true`, a versão otimizada executa. Caso contrário, o código original executa.
183183

184-
### Gating Configuration {/*gating-configuration*/}
184+
### Configuração do Gating {/*gating-configuration*/}
185185

186186
```js
187187
// babel.config.js
@@ -197,29 +197,29 @@ module.exports = {
197197
};
198198
```
199199

200-
### Implementing the Feature Flag {/*implementing-the-feature-flag*/}
200+
### Implementando a Flag de Recurso {/*implementing-the-feature-flag*/}
201201

202-
Create a module that exports your gating function:
202+
Crie um módulo que exporta sua função de gating:
203203

204204
```js
205205
// ReactCompilerFeatureFlags.js
206206
export function isCompilerEnabled() {
207-
// Use your feature flag system
207+
// Use seu sistema de flag de recurso
208208
return getFeatureFlag('react-compiler-enabled');
209209
}
210210
```
211211

212-
## Troubleshooting Adoption {/*troubleshooting-adoption*/}
212+
## Solução de Problemas na Adoção {/*troubleshooting-adoption*/}
213213

214-
If you encounter issues during adoption:
214+
Se você encontrar problemas durante a adoção:
215215

216-
1. Use `"use no memo"` to temporarily exclude problematic components
217-
2. Check the [debugging guide](/learn/react-compiler/debugging) for common issues
218-
3. Fix Rules of React violations identified by the ESLint plugin
219-
4. Consider using `compilationMode: 'annotation'` for more gradual adoption
216+
1. Use `"use no memo"` para temporariamente excluir componentes problemáticos
217+
2. Verifique o [guia de depuração](/learn/react-compiler/debugging) para problemas comuns
218+
3. Corrija violações das Regras do React identificadas pelo plugin ESLint
219+
4. Considere usar `compilationMode: 'annotation'` para adoção mais gradual
220220

221-
## Next Steps {/*next-steps*/}
221+
## Próximos Passos {/*next-steps*/}
222222

223-
- Read the [configuration guide](/reference/react-compiler/configuration) for more options
224-
- Learn about [debugging techniques](/learn/react-compiler/debugging)
225-
- Check the [API reference](/reference/react-compiler/configuration) for all compiler options
223+
- Leia o [guia de configuração](/reference/react-compiler/configuration) para mais opções
224+
- Aprenda sobre [técnicas de depuração](/learn/react-compiler/debugging)
225+
- Verifique a [referência da API](/reference/react-compiler/configuration) para todas as opções do compilador

0 commit comments

Comments
 (0)