Skip to content

Commit 0cf9a88

Browse files
authored
Merge branch 'main' into leduc1901/fragment
2 parents c125f00 + 1335e38 commit 0cf9a88

File tree

12 files changed

+185
-169
lines changed

12 files changed

+185
-169
lines changed

.github/workflows/analyze.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
# Here's the first place where next-bundle-analysis' own script is used
3939
# This step pulls the raw bundle stats for the current bundle
4040
- name: Analyze bundle
41-
run: npx -p nextjs-bundle-analysis report
41+
run: npx -p nextjs-bundle-analysis@0.5.0 report
4242

4343
- name: Upload bundle
4444
uses: actions/upload-artifact@v2

.github/workflows/analyze_comment.yml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,9 @@ jobs:
4747
pr_number=$(cat pr_number/pr_number)
4848
echo "pr-number=$pr_number" >> $GITHUB_OUTPUT
4949
50-
- name: Find Comment
51-
uses: peter-evans/find-comment@v1
52-
if: success()
53-
id: fc
54-
with:
55-
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
56-
body-includes: "<!-- __NEXTJS_BUNDLE -->"
57-
58-
- name: Create Comment
59-
uses: peter-evans/create-or-update-comment@v1.4.4
60-
if: success() && steps.fc.outputs.comment-id == 0
61-
with:
62-
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
63-
body: ${{ steps.get-comment-body.outputs.body }}
64-
65-
- name: Update Comment
66-
uses: peter-evans/create-or-update-comment@v1.4.4
67-
if: success() && steps.fc.outputs.comment-id != 0
50+
- name: Comment
51+
uses: marocchino/sticky-pull-request-comment@v2
6852
with:
69-
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
70-
body: ${{ steps.get-comment-body.outputs.body }}
71-
comment-id: ${{ steps.fc.outputs.comment-id }}
72-
edit-mode: replace
53+
header: next-bundle-analysis
54+
number: ${{ steps.get-comment-body.outputs.pr-number }}
55+
message: ${{ steps.get-comment-body.outputs.body }}

src/components/Layout/HomeContent.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,10 @@ function VideoList({videos, emptyHeading}) {
14631463
function SearchInput({value, onChange}) {
14641464
const id = useId();
14651465
return (
1466-
<form className="mb-3 py-1" data-hover="SearchInput">
1466+
<form
1467+
className="mb-3 py-1"
1468+
data-hover="SearchInput"
1469+
onSubmit={(e) => e.preventDefault()}>
14671470
<label htmlFor={id} className="sr-only">
14681471
Search
14691472
</label>

src/content/community/conferences.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ Bạn có biết về hội nghị React.js ở địa phương hay khu vực c
1010

1111
## Upcoming Conferences {/*upcoming-conferences*/}
1212

13-
### React Miami 2023 {/*react-miami-2023*/}
14-
April 20 - 21, 2023. Miami, FL, USA
15-
16-
[Website](https://www.reactmiami.com/) - [Twitter](https://twitter.com/ReactMiamiConf)
17-
1813
### Reactathon 2023 {/*reactathon-2023*/}
1914
May 2 - 3, 2023. San Francisco, CA, USA
2015

@@ -92,6 +87,11 @@ December 8 & 12, 2023. In-person in Berlin, Germany + remote first interactivity
9287

9388
## Past Conferences {/*past-conferences*/}
9489

90+
### React Miami 2023 {/*react-miami-2023*/}
91+
April 20 - 21, 2023. Miami, FL, USA
92+
93+
[Website](https://www.reactmiami.com/) - [Twitter](https://twitter.com/ReactMiamiConf)
94+
9595
### React Day Berlin 2022 {/*react-day-berlin-2022*/}
9696
December 2, 2022. In-person in Berlin, Germany + remote (hybrid event)
9797

src/content/learn/editor-setup.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
11
---
2-
title: Editor Setup
2+
title: Cài đặt trình soạn thảo văn bản
33
---
44

55
<Intro>
66

7-
A properly configured editor can make code clearer to read and faster to write. It can even help you catch bugs as you write them! If this is your first time setting up an editor or you're looking to tune up your current editor, we have a few recommendations.
7+
Một trình soạn thảo văn bản được cấu hình đúng cách có thể làm cho mã nguồn dễ đọc hơn và tốc độ viết code nhanh hơn. Nó còn có thể giúp bạn phát hiện lỗi khi bạn đang viết code! Nếu đây là lần đầu tiên bạn cài đặt một trình soạn thảo văn bản hoặc bạn đang muốn tinh chỉnh trình soạn thảo văn bản hiện tại của mình, chúng tôi có vài đề xuất.
88

99
</Intro>
1010

1111
<YouWillLearn>
1212

13-
* What the most popular editors are
14-
* How to format your code automatically
13+
* Các trình soạn thảo phổ biến nhất
14+
* Làm sao để định dạng code một cách tự động
1515

1616
</YouWillLearn>
1717

18-
## Your editor {/*your-editor*/}
18+
## Trình soạn thảo văn bản của bạn {/*trình-soạn-thảo-văn-bản-của-bạn*/}
1919

20-
[VS Code](https://code.visualstudio.com/) is one of the most popular editors in use today. It has a large marketplace of extensions and integrates well with popular services like GitHub. Most of the features listed below can be added to VS Code as extensions as well, making it highly configurable!
20+
[VS Code](https://code.visualstudio.com/) là một trong những trình soạn thảo phổ biến nhất hiện nay. VS Code có một cửa hàng ứng dụng mở rộng khổng lồ và tích hợp tốt với các dịch vụ phổ biến như GitHub. Hầu hết các tính năng được liệt kê dưới đây có thể được thêm vào VS Code dưới dạng các tiện ích mở rộng, làm cho nó có khả năng tùy chỉnh cao!
2121

22-
Other popular text editors used in the React community include:
22+
Các trình soạn thảo phổ biến khác được sử dụng trong cộng đồng React bao gồm:
2323

24-
* [WebStorm](https://www.jetbrains.com/webstorm/) is an integrated development environment designed specifically for JavaScript.
25-
* [Sublime Text](https://www.sublimetext.com/) has support for JSX and TypeScript, [syntax highlighting](https://stackoverflow.com/a/70960574/458193) and autocomplete built in.
26-
* [Vim](https://www.vim.org/) is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as "vi" with most UNIX systems and with Apple OS X.
24+
* [WebStorm](https://www.jetbrains.com/webstorm/) là một môi trường phát triển tích hợp được thiết kế đặc biệt cho JavaScript.
25+
* [Sublime Text](https://www.sublimetext.com/) có hỗ trợ cho JSX TypeScript, [làm nổi bật cú pháp](https://stackoverflow.com/a/70960574/458193) và tự động hoàn thiện code được tích hợp sẵn.
26+
* [Vim](https://www.vim.org/) là một trình soạn thảo có khả năng tùy chỉnh cao, được xây dựng để tạo và thay đổi bất kỳ loại văn bản nào một cách hiệu quả. Nó được bao gồm dưới dạng "vi" với hầu hết các hệ thống UNIX và trên Apple OS X.
2727

28-
## Recommended text editor features {/*recommended-text-editor-features*/}
28+
## Những tính năng của trình soạn thảo văn bản được đề xuất {/*những-tính-năng-của-trình-soạn-thảo-văn-bản-được-đề-xuất*/}
2929

30-
Some editors come with these features built in, but others might require adding an extension. Check to see what support your editor of choice provides to be sure!
30+
Một số trình soạn thảo đi kèm với các tính năng này được tích hợp sẵn, nhưng một số khác có thể yêu cầu thêm tiện ích mở rộng. Để chắc chắn thì hãy kiểm tra xem trình soạn thảo của bạn có hỗ trợ chúng không!
3131

3232
### Linting {/*linting*/}
3333

34-
Code linters find problems in your code as you write, helping you fix them early. [ESLint](https://eslint.org/) is a popular, open source linter for JavaScript.
34+
Các trình kiểm tra lỗi code (linters) giúp phát hiện các vấn đề trong code của bạn khi bạn viết nó, giúp bạn sửa chúng sớm. [ESLint](https://eslint.org/) là một linter mã nguồn mở rất phổ biến.
3535

36-
* [Install ESLint with the recommended configuration for React](https://www.npmjs.com/package/eslint-config-react-app) (be sure you have [Node installed!](https://nodejs.org/en/download/current/))
37-
* [Integrate ESLint in VSCode with the official extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
36+
* [Cài đặt ESLint với cấu hình khuyến nghị cho React](https://www.npmjs.com/package/eslint-config-react-app) (hãy chắc chắn bạn đã [cài đặt Node!](https://nodejs.org/en/download/current/))
37+
* [Tích hợp ESLint vào VSCode với tiện ích mở rộng chính thức](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
3838

39-
**Make sure that you've enabled all the [`eslint-plugin-react-hooks`](https://www.npmjs.com/package/eslint-plugin-react-hooks) rules for your project.** They are essential and catch the most severe bugs early. The recommended [`eslint-config-react-app`](https://www.npmjs.com/package/eslint-config-react-app) preset already includes them.
39+
**Hãy đảm bảo rằng bạn đã kích hoạt tất cả các quy tắc của [`eslint-plugin-react-hooks`](https://www.npmjs.com/package/eslint-plugin-react-hooks) cho dự án của mình.** Vì chúng là cực kỳ quan trọng và giúp phát hiện các lỗi nghiêm trọng nhất sớm nhất có thể. Bộ cài đặt mặc định [`eslint-config-react-app`](https://www.npmjs.com/package/eslint-config-react-app) đã bao gồm chúng.
4040

41-
### Formatting {/*formatting*/}
41+
### Định dạng code {/*định-dạng-code*/}
4242

43-
The last thing you want to do when sharing your code with another contributor is get into an discussion about [tabs vs spaces](https://www.google.com/search?q=tabs+vs+spaces)! Fortunately, [Prettier](https://prettier.io/) will clean up your code by reformatting it to conform to preset, configurable rules. Run Prettier, and all your tabs will be converted to spaces—and your indentation, quotes, etc will also all be changed to conform to the configuration. In the ideal setup, Prettier will run when you save your file, quickly making these edits for you.
43+
Điều cuối cùng mà bạn muốn làm khi chia sẻ code của mình cho người khác chính là tranh cãi với họ về việc sử dụng [tabs spaces](https://www.google.com/search?q=tabs+vs+spaces)! May mắn thay, [Prettier](https://prettier.io/) sẽ giúp bạn làm sạch code của mình bằng cách định dạng lại theo các quy tắc được thiết lập sẵn và có thể cấu hình được. Chạy Prettier và tất cả các tab của bạn sẽ được chuyển đổi thành dấu cách - và các thụt đầu dòng, dấu ngoặc kép, v.v. cũng sẽ được thay đổi để phù hợp với cấu hình. Trong cài đặt lý tưởng, Prettier sẽ chạy khi bạn lưu tệp của mình, nhanh chóng thực hiện các chỉnh sửa này cho bạn.
4444

45-
You can install the [Prettier extension in VSCode](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) by following these steps:
45+
Bạn có thể cài đặt [tiện ích Prettier trong VSCode](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) bằng những bước sau đây:
4646

47-
1. Launch VS Code
48-
2. Use Quick Open (press Ctrl/Cmd+P)
49-
3. Paste in `ext install esbenp.prettier-vscode`
50-
4. Press Enter
47+
1. Mở VS Code
48+
2. Sử dụng Quick Open (bấm Ctrl/Cmd+P)
49+
3. Dán dòng chữ `ext install esbenp.prettier-vscode`
50+
4. Bấm Enter
5151

52-
#### Formatting on save {/*formatting-on-save*/}
52+
#### Định dạng code khi lưu {/*định-dạng-code-khi-lưu*/}
5353

54-
Ideally, you should format your code on every save. VS Code has settings for this!
54+
Lý tưởng hơn, bạn muốn định dạng code của bạn mỗi khi lưu chúng. VS Code đã có các thiết lập sẵn cho điều này!
5555

56-
1. In VS Code, press `CTRL/CMD + SHIFT + P`.
57-
2. Type "settings"
58-
3. Hit Enter
59-
4. In the search bar, type "format on save"
60-
5. Be sure the "format on save" option is ticked!
56+
1. Trong VS Code, bấm `CTRL/CMD + SHIFT + P`.
57+
2. "settings"
58+
3. Bấm Enter
59+
4. Trong thanh tìm kiếm, gõ "format on save"
60+
5. Hãy chắc chắn rằng lựa chọn "format on save" đã được chọn!
6161

62-
> If your ESLint preset has formatting rules, they may conflict with Prettier. We recommend disabling all formatting rules in your ESLint preset using [`eslint-config-prettier`](https://github.com/prettier/eslint-config-prettier) so that ESLint is *only* used for catching logical mistakes. If you want to enforce that files are formatted before a pull request is merged, use [`prettier --check`](https://prettier.io/docs/en/cli.html#--check) for your continuous integration.
62+
> Nếu bộ cấu hình ESLint của bạn có các quy tắc định dạng, chúng có thể xung đột với Prettier. Chúng tôi khuyến khích bạn tắt tất cả các quy tắc định dạng trong bộ cấu hình ESLint của mình bằng cách sử dụng [`eslint-config-prettier`](https://github.com/prettier/eslint-config-prettier) để ESLint *chỉ có thể* được sử dụng để bắt các lỗi về logic. Nếu bạn muốn bắt buộc các tệp phải được định dạng trước khi thực hiện hợp nhất một pull request, hãy sử dụng [`prettier --check`](https://prettier.io/docs/en/cli.html#--check) cho CI của bạn ( CI - Continuous Integration - Tích hợp liên tục ).

src/content/learn/installation.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
---
2-
title: Installation
2+
title: Cài đặt
33
---
44

55
<Intro>
66

7-
React has been designed from the start for gradual adoption. You can use as little or as much React as you need. Whether you want to get a taste of React, add some interactivity to an HTML page, or start a complex React-powered app, this section will help you get started.
7+
React được thiết kế từ đầu với khả năng áp dụng vào dự án một cách từ từ. Bạn có thể sử dụng càng ít hoặc càng nhiều React theo nhu cầu. Dù là bạn muốn trải nghiệm React, thêm một số tính năng tương tác vào một trang HTML, hay bắt đầu một ứng dụng phức tạp được xây dựng bằng React, phần này sẽ giúp bạn bắt đầu.
88

99
</Intro>
1010

1111
<YouWillLearn isChapter={true}>
1212

13-
* [How to start a new React project](/learn/start-a-new-react-project)
14-
* [How to add React to an existing project](/learn/add-react-to-an-existing-project)
15-
* [How to set up your editor](/learn/editor-setup)
16-
* [How to install React Developer Tools](/learn/react-developer-tools)
13+
* [Cách để bắt đầu một dự án sử dụng React](/learn/start-a-new-react-project)
14+
* [Cách để thêm React vào dự án đang có sẵn](/learn/add-react-to-an-existing-project)
15+
* [Cách để thiết lập trình soạn thảo](/learn/editor-setup)
16+
* [Cách để cài đặt React Developer Tools](/learn/react-developer-tools)
1717

1818
</YouWillLearn>
1919

20-
## Try React {/*try-react*/}
20+
## Thử dùng React {/*try-react*/}
2121

22-
You don't need to install anything to play with React. Try editing this sandbox!
22+
Bạn không phải cài đặt bất cứ thứ gì để trải nghiệm React. Hãy thử chỉnh sửa sandbox này!
2323

2424
<Sandpack>
2525

@@ -35,23 +35,23 @@ export default function App() {
3535

3636
</Sandpack>
3737

38-
You can edit it directly or open it in a new tab by pressing the "Fork" button in the upper right corner.
38+
Bạn có thể chỉnh sửa trực tiếp hoặc mở nó trong một tab mới bằng cách ấn vào nút "Fork" ở góc trên bên phải.
3939

40-
Most pages in the React documentation contain sandboxes like this. Outside of the React documentation, there are many online sandboxes that support React: for example, [CodeSandbox](https://codesandbox.io/s/new), [StackBlitz](https://stackblitz.com/fork/react), or [CodePen.](https://codepen.io/pen?&editors=0010&layout=left&prefill_data_id=3f4569d1-1b11-4bce-bd46-89090eed5ddb)
40+
Hầu hết các trang trong tài liệu React chứa các sandbox như thế này. Ngoài trang tài liệu React, có rất nhiều các online sandbox hỗ trợ React: ví dụ, [CodeSandbox](https://codesandbox.io/s/new), [StackBlitz](https://stackblitz.com/fork/react), or [CodePen.](https://codepen.io/pen?&editors=0010&layout=left&prefill_data_id=3f4569d1-1b11-4bce-bd46-89090eed5ddb)
4141

42-
### Try React locally {/*try-react-locally*/}
42+
### Thử dùng React trên máy tính của bạn {/*try-react-locally*/}
4343

44-
To try React locally on your computer, [download this HTML page.](https://gist.githubusercontent.com/gaearon/0275b1e1518599bbeafcde4722e79ed1/raw/db72dcbf3384ee1708c4a07d3be79860db04bff0/example.html) Open it in your editor and in your browser!
44+
Để thử sử dụng React trên máy tính của bạn, [tải về trang HTML này.](https://gist.githubusercontent.com/gaearon/0275b1e1518599bbeafcde4722e79ed1/raw/db72dcbf3384ee1708c4a07d3be79860db04bff0/example.html) Mở nó trong trình soạn thảo và trình duyệt của bạn!
4545

46-
## Start a new React project {/*start-a-new-react-project*/}
46+
## Bắt đầu một dự án React mới {/*start-a-new-react-project*/}
4747

48-
If you want to build an app or a website fully with React, [start a new React project.](/learn/start-a-new-react-project)
48+
Nếu bạn muốn xây dựng một ứng dụng hoặc một website một cách đầy đủ với React, [bắt đầu một dự án React mới.](/learn/start-a-new-react-project)
4949

50-
## Add React to an existing project {/*add-react-to-an-existing-project*/}
50+
## Thêm React vào một dự án có sẵn {/*add-react-to-an-existing-project*/}
5151

52-
If want to try using React in your existing app or a website, [add React to an existing project.](/learn/add-react-to-an-existing-project)
52+
Nếu bạn muốn thử sử dụng React cho ứng dụng đang có sẵn của bạn hoặc một website, [thêm React vào một dự án có sẵn.](/learn/add-react-to-an-existing-project)
5353

54-
## Next steps {/*next-steps*/}
54+
## Các bước tiếp theo {/*next-steps*/}
5555

56-
Head to the [Quick Start](/learn) guide for a tour of the most important React concepts you will encounter every day.
56+
Ghé thăm phần [Bắt đầu](/learn) để thăm quan các khái niệm quan trọng nhất của React mà bạn sẽ gặp phải hàng ngày.
5757

0 commit comments

Comments
 (0)