Skip to content

Sync with react.dev @ 341c3129 #775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"@radix-ui/react-context-menu": "^2.1.5",
"body-scroll-lock": "^3.1.3",
"classnames": "^2.2.6",
"date-fns": "^2.16.1",
"debounce": "^1.2.1",
"github-slugger": "^1.3.0",
"next": "15.1.0",
Expand Down
4 changes: 4 additions & 0 deletions src/content/learn/scaling-up-with-reducer-and-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,11 @@ Sekarang Anda tidak perlu lagi meneruskan daftar tugas atau *event handler* ke b
</TasksContext>
```

<<<<<<< HEAD
Sebaliknya, komponen mana pun yang memerlukan daftar tugas dapat membacanya dari `TaskContext`:
=======
Instead, any component that needs the task list can read it from the `TasksContext`:
>>>>>>> 341c312916e1b657262bbe14b134a6f1779fecf1

```js {2}
export default function TaskList() {
Expand Down
4 changes: 4 additions & 0 deletions src/content/reference/rsc/directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ Direktif digunakan di [Komponen Server React](/reference/rsc/server-components).

<Intro>

<<<<<<< HEAD
Direktif memberikan instruksi kepada [bundler yang kompatibel dengan React Server Components](/learn/start-a-new-react-project#bleeding-edge-react-frameworks).
=======
Directives provide instructions to [bundlers compatible with React Server Components](/learn/start-a-new-react-project#full-stack-frameworks).
>>>>>>> 341c312916e1b657262bbe14b134a6f1779fecf1

</Intro>

Expand Down
21 changes: 17 additions & 4 deletions src/content/reference/rsc/server-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ title: "Komponen Server"

<RSC>

<<<<<<< HEAD
Komponen Server digunakan di [Komponen Server React](/learn/start-a-new-react-project#bleeding-edge-react-frameworks).
=======
Server Components are for use in [React Server Components](/learn/start-a-new-react-project#full-stack-frameworks).
>>>>>>> 341c312916e1b657262bbe14b134a6f1779fecf1

</RSC>

Expand All @@ -22,7 +26,11 @@ Lingkungan terpisah ini adalah "server" dalam Komponen Server React. Komponen Se
<Note>


<<<<<<< HEAD
#### Bagaimana cara membangun dukungan untuk Komponen Server? {/*how-do-i-build-support-for-server-components*/}
=======
While React Server Components in React 19 are stable and will not break between minor versions, the underlying APIs used to implement a React Server Components bundler or framework do not follow semver and may break between minors in React 19.x.
>>>>>>> 341c312916e1b657262bbe14b134a6f1779fecf1

Meskipun Komponen Server React di React 19 sudah stabil dan tidak akan rusak antar versi mayor, API dasar yang digunakan untuk mengimplementasikan bundler atau framework Komponen Server React tidak mengikuti semver dan dapat berubah antar versi minor di React 19.x.

Expand All @@ -47,7 +55,7 @@ function Page({page}) {
setContent(data.content);
});
}, [page]);

return <div>{sanitizeHtml(marked(content))}</div>;
}
```
Expand All @@ -71,7 +79,7 @@ import sanitizeHtml from 'sanitize-html'; // Tidak termasuk dalam bundel
async function Page({page}) {
// CATATAN: dimuat *saat* render, ketika aplikasi dibangun.
const content = await file.readFile(`${page}.md`);

return <div>{sanitizeHtml(marked(content))}</div>;
}
```
Expand Down Expand Up @@ -115,7 +123,7 @@ function Note({id}) {
setNote(data.note);
});
}, [id]);

return (
<div>
<Author id={note.authorId} />
Expand Down Expand Up @@ -255,7 +263,7 @@ Ini bekerja dengan pertama-tama merender `Notes` sebagai Komponen Server, dan ke
<p>this is the second note</p>
</Expandable>
<!--...-->
</div>
</div>
</body>
```

Expand All @@ -272,8 +280,13 @@ import db from './database';
async function Page({id}) {
// Akan suspend Komponen Server.
const note = await db.notes.get(id);
<<<<<<< HEAD

// CATATAN: tidak ditunggu, akan mulai di sini dan menunggu di klien.
=======

// NOTE: not awaited, will start here and await on the client.
>>>>>>> 341c312916e1b657262bbe14b134a6f1779fecf1
const commentsPromise = db.comments.get(note.id);
return (
<div>
Expand Down
4 changes: 4 additions & 0 deletions src/content/reference/rsc/use-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ export default function RichTextEditor({ timestamp, text }) {
}
```

<<<<<<< HEAD
Saat file yang ditandai dengan `'use client'` diimpor dari Komponen Server, [bundler yang kompatibel](/learn/start-a-new-react-project#bleeding-edge-react-frameworks) akan memperlakukan impor modul sebagai batas antara kode yang dijalankan server dan kode yang dijalankan klien.
=======
When a file marked with `'use client'` is imported from a Server Component, [compatible bundlers](/learn/start-a-new-react-project#full-stack-frameworks) will treat the module import as a boundary between server-run and client-run code.
>>>>>>> 341c312916e1b657262bbe14b134a6f1779fecf1

Sebagai dependensi `RichTextEditor`, `formatDate` dan `Button` juga akan dievaluasi pada klien terlepas dari apakah modulnya berisi direktif `'use client'`. Perhatikan bahwa satu modul dapat dievaluasi pada server saat diimpor dari kode server dan pada klien saat diimpor dari kode klien.

Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2799,11 +2799,6 @@ data-view-byte-offset@^1.0.0:
es-errors "^1.3.0"
is-data-view "^1.0.1"

date-fns@^2.16.1:
version "2.28.0"
resolved "https://registry.npmjs.org/date-fns/-/date-fns-2.28.0.tgz"
integrity sha512-8d35hViGYx/QH0icHYCeLmsLmMUheMmTyV9Fcm6gvNwdw31yXXH+O85sOBJ+OLnLQMKZowvpKb6FgMIQjcpvQw==

debounce@^1.2.1:
version "1.2.1"
resolved "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz"
Expand Down
Loading