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/reference/react-dom/server/renderToReadableStream.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,7 +115,7 @@ export default function App() {
115
115
}
116
116
```
117
117
118
-
React will inject the [doctype](https://developer.mozilla.org/en-US/docs/Glossary/Doctype) and your <CodeStep step={2}>bootstrap `<script>`tags</CodeStep> into the resulting HTML stream:
118
+
React, [doctype](https://developer.mozilla.org/en-US/docs/Glossary/Doctype) ve <CodeStep step={2}>bootstrap `<script>`etiketlerini</CodeStep> oluşan HTML stream’ine enjekte edecektir:
119
119
120
120
```html [[2, 5, "/main.js"]]
121
121
<!DOCTYPE html>
@@ -125,7 +125,7 @@ React will inject the [doctype](https://developer.mozilla.org/en-US/docs/Glossar
125
125
<script src="/main.js"async=""></script>
126
126
```
127
127
128
-
On the client, your bootstrap script should [hydrate the entire `document` with a call to `hydrateRoot`:](/reference/react-dom/client/hydrateRoot#hydrating-an-entire-document)
This will attach event listeners to the server-generated HTML and make it interactive.
137
+
Bu server tarafından oluşturulan HTML’e event listener’lar ekleyecek ve HTML’i interaktif hale getirecektir.
138
138
139
139
<DeepDive>
140
140
141
-
#### Reading CSS and JS asset paths from the build output {/*reading-css-and-js-asset-paths-from-the-build-output*/}
141
+
#### Build çıktısından CSS ve JS asset yollarını okumak {/*reading-css-and-js-asset-paths-from-the-build-output*/}
142
142
143
-
The final asset URLs (like JavaScript and CSS files) are often hashed after the build. For example, instead of `styles.css`you might end up with `styles.123456.css`. Hashing static asset filenames guarantees that every distinct build of the same asset will have a different filename. This is useful because it lets you safely enable long-term caching for static assets: a file with a certain name would never change content.
143
+
Final asset URL’leri (JavaScript ve CSS dosyaları gibi) genellikle build sonrası hash’lenir. Örneğin, `styles.css`yerine `styles.123456.css` gibi bir dosya ile karşılaşabilirsiniz. Statik asset dosya adlarını hash’lemek, aynı asset’in her farklı build’inin farklı bir dosya adına sahip olmasını garanti eder. Bu faydalıdır çünkü statik assetler için uzun süreli caching’i güvenle etkinleştirmenizi sağlar: belli bir isimdeki dosyanın içeriği hiçbir zaman değişmez.
144
144
145
-
However, if you don't know the asset URLs until after the build, there's no way for you to put them in the source code. For example, hardcoding `"/styles.css"`into JSX like earlier wouldn't work. To keep them out of your source code, your root component can read the real filenames from a map passed as a prop:
145
+
Ancak, asset URL’lerini build sonrası öğreniyorsanız, bunları kaynak kodunuza koymanın bir yolu yoktur. Örneğin, daha önce JSX içine hardcode edilmiş `"/styles.css"`çalışmaz. Bunları kaynak kodunuzdan çıkarmak için, root component’iniz gerçek dosya adlarını bir prop olarak geçirilen bir map’ten okuyabilir:
On the server, render `<App assetMap={assetMap} />`and pass your `assetMap` with the asset URLs:
161
+
Server tarafında, `<App assetMap={assetMap} />`render edin ve asset URL’lerini içeren `assetMap`’inizi geçin:
162
162
163
163
```js {1-5,8,9}
164
-
//You'd need to get this JSON from your build tooling, e.g. read it from the build output.
164
+
//Bu JSON’u build aracınızdan almanız gerekir, örneğin build çıktısından okuyabilirsiniz.
165
165
constassetMap= {
166
166
'styles.css':'/styles.123456.css',
167
167
'main.js':'/main.123456.js'
@@ -177,18 +177,18 @@ async function handler(request) {
177
177
}
178
178
```
179
179
180
-
Since your server is now rendering `<App assetMap={assetMap} />`, you need to render it with`assetMap`on the client too to avoid hydration errors. You can serialize and pass `assetMap` to the client like this:
180
+
Server artık `<App assetMap={assetMap} />` render ettiği için, client tarafında da`assetMap`ile render etmeniz gerekir; aksi takdirde hydration hataları oluşur. `assetMap`’i serialize edip client’a şöyle geçirebilirsiniz:
181
181
182
182
```js {9-10}
183
-
//You'd need to get this JSON from your build tooling.
0 commit comments