Skip to content

Commit 7c1b289

Browse files
authored
Merge pull request #167 from reactjs/sync-de497e25
Sync with reactjs.org @ de497e2
2 parents 2ba4487 + c26ccde commit 7c1b289

14 files changed

+100
-63
lines changed

content/blog/2015-09-02-new-react-developer-tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ It contains a handful of new features, including:
2020

2121
## Installation {#installation}
2222

23-
Download the new devtools from the [Chrome Web Store](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) and on [Mozilla Add-ons](https://addons.mozilla.org/en-US/firefox/addon/react-devtools/) for Firefox. If you're developing using React, we highly recommend installing these devtools.
23+
Download the new devtools from the [Chrome Web Store](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) and on [Firefox Add-ons](https://addons.mozilla.org/en-US/firefox/addon/react-devtools/) for Firefox. If you're developing using React, we highly recommend installing these devtools.
2424

2525
If you already have the Chrome extension installed, it should autoupdate within the next week. You can also head to `chrome://extensions` and click "Update extensions now" if you'd like to get the new version today. If you installed the devtools beta, please remove it and switch back to the version from the store to make sure you always get the latest updates and bug fixes.
2626

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: "Introducing the New React DevTools"
3+
author: [bvaughn]
4+
---
5+
We are excited to announce a new release of the React Developer Tools, available today in Chrome, Firefox, and (Chromium) Edge!
6+
7+
## What's changed?
8+
9+
A lot has changed in version 4!
10+
At a high level, this new version should offer significant performance gains and an improved navigation experience.
11+
It also offers full support for React Hooks, including inspecting nested objects.
12+
13+
![DevTools version 4 screenshot](../images/blog/devtools-v4-screenshot.png)
14+
15+
[Visit the interactive tutorial](https://react-devtools-tutorial.now.sh/) to try out the new version or [see the changelog](https://github.com/facebook/react/blob/master/packages/react-devtools/CHANGELOG.md#400-august-15-2019) for demo videos and more details.
16+
17+
## Which versions of React are supported?
18+
19+
**`react-dom`**
20+
21+
* `0`-`14.x`: Not supported
22+
* `15.x`: Supported (except for the new component filters feature)
23+
* `16.x`: Supported
24+
25+
**`react-native`**
26+
* `0`-`0.61`: Not supported
27+
* `0.62`: Will be supported (when 0.62 is released)
28+
29+
## How do I get the new DevTools?
30+
31+
React DevTools is available as an extension for [Chrome](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en) and [Firefox](https://addons.mozilla.org/en-US/firefox/addon/react-devtools/).
32+
If you have already installed the extension, it should update automatically within the next couple of hours.
33+
34+
If you use the standalone shell (e.g. in React Native or Safari), you can install the new version [from NPM](https://www.npmjs.com/package/react-devtools):
35+
36+
```shell
37+
npm install -g react-devtools@^4
38+
```
39+
40+
## Where did all of the DOM elements go?
41+
42+
The new DevTools provides a way to filter components from the tree to make it easier to navigate deeply nested hierarchies.
43+
Host nodes (e.g. HTML `<div>`, React Native `<View>`) are *hidden by default*, but this filter can be disabled:
44+
45+
![DevTools component filters](../images/blog/devtools-component-filters.gif)
46+
47+
## How do I get the old version back?
48+
49+
If you are working with React Native version 60 (or older) you can install the previous release of DevTools from NPM:
50+
51+
```shell
52+
npm install --dev react-devtools@^3
53+
```
54+
55+
For older versions of React DOM (v0.14 or earlier) you will need to build the extension from source:
56+
57+
```shell
58+
# Checkout the extension source
59+
git clone https://github.com/facebook/react-devtools
60+
61+
cd react-devtools
62+
63+
# Install dependencies and build the unpacked extension
64+
yarn install
65+
yarn build:extension
66+
67+
# Follow the on-screen instructions to complete installation
68+
```
69+
70+
## Thank you!
71+
72+
We'd like to thank everyone who tested the early release of DevTools version 4.
73+
Your feedback helped improve this initial release significantly.
74+
75+
We still have many exciting features planned and feedback is always welcome!
76+
Please feel free to open a [GitHub issue](https://github.com/facebook/react/issues/new?labels=Component:%20Developer%20Tools) or tag [@reactjs on Twitter](https://twitter.com/reactjs).

content/community/articles.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ sectionid: community
66
permalink: community/articles.html
77
---
88

9-
109
- [كيف React](https://github.com/petehunt/react-howto) - دليل Pete Hunt لنظام React.
1110
- [9 أشياء يجب أن يعرفها كل مبتدئ في React.js](https://camjackson.net/post/9-things-every-reactjs-beginner-should-know) - دليل كام جاكسون للمبتدئين.
1211
- [React لحظات الإدراك](https://tylermcginnis.com/react-aha-moments/) - مقالة تايلر مكجينيس حول مجموعته من لحظات الإدراك مع React.
1312
- [تنقصك نقطة React](https://medium.com/@dan_abramov/youre-missing-the-point-of-react-a20e34a51e1a) - مقالة دان أبراموف حول أفضل أجزاء React.
1413
- [الجدول الزمني لتعلم React](https://daveceddia.com/timeline-for-learning-react/) - الجدول الزمني الموصى به من قِبل ديف سيديا لتعلم React ونظامه.
1514
- [تطوير بسيط بـ React في 2017](https://hackernoon.com/simple-react-development-in-2017-113bd563691f) - دليل جوشوا كومو لعرض مدى سهولة بدء التطوير بـ React.
1615
- [دليل مرئي للحالة في React](https://daveceddia.com/visual-guide-to-state-in-react/) - دليل ديف سيديا المرئي للحالة في React.
17-
- [التدريب العملي على لتعلم React Hooks](https://www.telerik.com/kendo-react-ui/react-hooks-guide/)
16+
- [التدريب العملي على لتعلم React Hooks](https://www.telerik.com/kendo-react-ui/react-hooks-guide/) دليل Eric Bishard خطوة بخطوة لتعلم الخطافات

content/community/conferences.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ August 29, 2019. Tehran, Iran.
8181
4-6 مايو ، 2020. أتلانتا ، جورجيا ، الولايات المتحدة.80
8282
[موقع الويب](https://renderatl.com)
8383

84+
### React Next 2020 {#react-next-2020}
85+
يونيو 15, 2020. تل أبيب، إسرائيل.
86+
87+
[موقع الويب](https://react-next.com/) - [تويتر](https://twitter.com/reactnext) - [فيس بوك](https://www.facebook.com/ReactNext2016/)
88+
8489
## المؤتمرات السابقة {#past-conferences}
8590

8691
### React.js Conf 2015 {#reactjs-conf-2015}

content/community/meetups.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ permalink: community/meetups.html
1616
* [بريزبان](https://www.meetup.com/reactbris/)
1717
* [سيدني](https://www.meetup.com/React-Sydney/)
1818
* [ملبورن](https://www.meetup.com/React-Melbourne/)
19+
*
1920

2021
<!-- 404 NOT FOUND ! -->
2122

@@ -59,6 +60,7 @@ permalink: community/meetups.html
5960

6061
## الهند {#india}
6162
* [بنغالور](https://www.meetup.com/ReactJS-Bangalore/)
63+
* [شانديغار](https://www.meetup.com/Chandigarh-React-Developers/)
6264
* [تشيناي](https://www.meetup.com/React-Chennai/)
6365
* [دلهي](https://www.meetup.com/React-Delhi-NCR/)
6466
* [جايبور](https://www.meetup.com/JaipurJS-Developer-Meetup/)
@@ -159,3 +161,7 @@ permalink: community/meetups.html
159161

160162
## سنغافورة {#singapore}
161163
* [سنغافورة - React Knowledgeable](https://reactknowledgeable.org/)
164+
165+
## ماليزيا {#malaysia}
166+
* [بينانغ](https://www.facebook.com/groups/reactpenang/)
167+
*

content/docs/hooks-faq.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ prev: hooks-reference.html
6464
بدءًا من الإصدار 16.8.0، تضمنت React تنفيذًا مستقرًا للخطافات من أجل:
6565

6666
* React DOM
67+
* React Native
6768
* React DOM Server
6869
* React Test Renderer
6970
* React Shallow Renderer
7071

7172
لاحظ أن **لتمكين الخطافات ، يجب أن تكون جميع حزم 16.8.0 React أو أعلى**. لن تعمل الخطافات إذا نسيت التحديث ، على سبيل المثال ، React DOM.
7273

73-
74-
ستدعم ReactNative الخطافات دعمًا كاملًا في الإصدار المستقر القادم.
74+
الاصدار [React Native 0.59](https://facebook.github.io/react-native/blog/2019/03/12/releasing-react-native-059) وما بعد يدعم الخطافات.
7575

7676
### هل احتاج إلى إعادة كتابة جميع مكونات الأصناف الخاصة بي؟ {#do-i-need-to-rewrite-all-my-class-components}
7777

content/docs/hooks-intro.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ function Example() {
3131

3232
>Note
3333
>
34-
> الإصدار 16.8.0 من React هو أول إصدار يدعم الخطافات. عند الترقية إليه، لا تنسَ تحديث جميع الحزم بما فيها React DOM. ستدعم ReactNative الخطافات في الإصدار المستقر القادم.
34+
> الإصدار 16.8.0 من React هو أول إصدار يدعم الخطافات. عند الترقية إليه، لا تنسَ تحديث جميع الحزم بما فيها React DOM.
35+
> React Native تدعم الخطافات في [اصدار 0.59](https://facebook.github.io/react-native/blog/2019/03/12/releasing-react-native-059).
3536
3637
## فيديو تقديمي {#video-introduction}
3738

content/docs/optimizing-performance.md

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -217,24 +217,6 @@ module.exports = {
217217

218218
عندما تتغيّر خاصيّة أو حالة المُكوِّن، تُقرِّر React أي عقدة DOM هي التي يجب تحديثها عن طريق مقارنة العنصر الجديد المُعاد مع العنصر السابق المُصيَّر. وعندما لا يكونان متطابقين ستُحدِّث React واجهة DOM.
219219

220-
بإمكانك الآن إظهار مخططات لعملية إعادة تصيير DOM الافتراضي باستخدام أدوات تطوير React:
221-
222-
- [إضافة متصفّح Chrome](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en)
223-
- [Firefox إضافة متصفّح](https://addons.mozilla.org/en-GB/firefox/addon/react-devtools/)
224-
- [الإصدار المستقل (حزمة Node)](https://www.npmjs.com/package/react-devtools)
225-
226-
حدِّد من نافذة Console الخيار **Highlight Updates** في النافذة **React**:
227-
228-
<center><img src="../images/blog/devtools-highlight-updates.png" style="max-width:100%; margin-top:10px;" alt="How to enable highlight updates" /></center>
229-
230-
تفاعل مع الصفحة وسترى حدود ملوّنة تظهر بشكل آني حول أي مُكوِّن يُعاد تصييره. يُتيح لك ذلك التقاط أي إعادة تصيير غير ضروريّة. يُمكنِك تعلم المزيد حول هذه الميزة من [هذه المقالة](https://blog.logrocket.com/make-react-fast-again-part-3-highlighting-component-updates-6119e45e6833) من طرف [Ben Edelstein](https://blog.logrocket.com/@edelstein).
231-
232-
أنظر إلى هذا المثال:
233-
234-
<center><img src="../images/blog/highlight-updates-example.gif" style="max-width:100%; margin-top:20px;" alt="React DevTools Highlight Updates example" /></center>
235-
236-
لاحظ أنّنا حين أدخلنا واجبًا ثانيًا لفعله استمر الواجب الأول بالإضاءة على الشاشة مع كل نقرة زر، ويعني هذا أنّه يُعاد تصييره مع كل إدخال من قبل React. يُدعى هذا أحيانًا بالتصيير المُضيِّع للوقت، ونعلم أنّه غير ضروري لأنّ الواجب الأول لم يتغيّر، ولكنّ React لا تعلم ذلك.
237-
238220
على الرغم من تحديث React لعُقَد DOM التي تغيّرت، فلا تزال إعادة التصيير تستغرق بعض الوقت. في العديد من الحالات لن تكون هذه مشكلة، ولكن إن كان البطء ملاحظًا فبإمكانك تسريع العملية عن طريق تجاوز تابع دورة حياة المُكوِّن `shouldComponentUpdate` والذي يُطلَق قبل بدء عملية إعادة التصيير. يُعيد هذا التابع بشكل افتراضي القيمة `true` وبذلك يترك لمكتبة React إنجاز التحديث:
239221

240222
```javascript
@@ -407,36 +389,4 @@ function updateColorMap(colormap) {
407389

408390
إن كنتَ تستخدم Create React App فسيكون التابع `Object.assign` وصيغة نشر الكائن متوفرة بشكلٍ افتراضي.
409391

410-
## استخدام بُنى البيانات غير القابلة للتعديل {#using-immutable-data-structures}
411-
412-
مكتبة [Immutable.js](https://github.com/facebook/immutable-js) هي طريقة أخرى لحل هذه المشكلة، فهي تُزوّدنا بمجموعات دائمة غير قابلة للتعديل والتي تعمل عبر المشاركة البنيوية:
413-
414-
* غير قابلة للتعديل (*Immutable*): فحالما تُنشَأ المجموعة لا يُمكن تبديلها في أي نقطة زمنية.
415-
* دائمة (*Persistent*): يُمكِن إنشاء مجموعات جديدة من مجموعة قديمة بعد تعديلها. وتبقى المجموعة الأصلية صالحة بعد إنشاء المجموعة الجديدة.
416-
* المشاركة البنيوية (*Structural Sharing*): تُنشأ مجموعات جديدة باستخدام مماثلة لبنية المجموعة الأصلية قدر الإمكان مع تقليل النسخ إلى الحد الأدنى لتحسين الأداء.
417-
418-
تجعل عدم القدرة على التعديل من تتبّع التغييرات أمرًا سهلًا، فالتغيير سيُنتِج دومًا كائنًا جديدًا لذا نحتاج فقط للتحقق إن كان مرجع الكائن قد تغيّر. فمثلًا في شيفرة JavaScript الاعتيادية التالية:
419-
420-
```javascript
421-
const x = { foo: 'bar' };
422-
const y = x;
423-
y.foo = 'baz';
424-
x === y; // true
425-
```
426-
427-
على الرغم من أنّنا عدّلنا المتغيّر `y` بما أنّه مرجع لنفس الكائن مثل المتغيّر `x`، فستُعيد المقارنة القيمة `true`. بإمكانك كتابة نفس الشيفرة باستخدام immutable.js:
428-
429-
```javascript
430-
const SomeRecord = Immutable.Record({ foo: null });
431-
const x = new SomeRecord({ foo: 'bar' });
432-
const y = x.set('foo', 'baz');
433-
const z = x.set('foo', 'bar');
434-
x === y; // false
435-
x === z; // true
436-
```
437-
438-
في هذه الحالة بما أنّنا أعدنا مرجعًا عند تعديل المتغيّر `x` فيُمكننا استخدام المقارنة بين المراجع `(x === y)` للتأكد من أنّ القيمة الجديدة المُخزّنة في `y` مختلفة عن القيمة الأصليّة المُخزّنة في `x`.
439-
440-
من المكتبات الأخرى التي تساعد على استخدام البيانات غير القابلة للتعديل نجد [Immer](https://github.com/mweststrate/immer) و [immutability-helper](https://github.com/kolodny/immutability-helper) أو [seamless-immutable](https://github.com/rtfeldman/seamless-immutable).
441-
442-
تُزوِّدك بنى البيانات غير القابلة للتعديل بطريقة سهلة لتتبّع التغييرات على الكائنات، وهو كل ما نحتاجه لتنفيذ التابع `shouldComponentUpdate`. يُزوِّدك ذلك بدفعة جيدة لتحسين الأداء في تطبيقك.
392+
من المكتبات الأخرى التي تساعد على استخدام البيانات غير القابلة للتعديل نجد [Immer](https://github.com/mweststrate/immer) و [immutability-helper](https://github.com/kolodny/immutability-helper) تُزوِّدك بنى البيانات غير القابلة للتعديل بطريقة سهلة لتتبّع التغييرات على الكائنات.

content/docs/reference-profiler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ render(
4444
<Profiler id="Main" onRender={callback}>
4545
<Main {...props} />
4646
</Profiler>
47-
</App>
47+
</App>
4848
);
4949
```
5050

content/docs/reference-test-renderer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ expect(testInstance.findByProps({className: "sub"}).children).toEqual(['Sub']);
103103
TestRenderer.create(element, options);
104104
```
105105

106-
إنشاء نسخة من `TestRenderer` مع عنصر React المُمرَّر. لا يستخدم هذا التابع DOM الحقيقي ولكنّه يُصيِّر بشكل كامل شجرة المكوّنات في الذاكرة. تملك النسخة المُعادة التوابع والخاصيّات التالية.
106+
إنشاء نسخة من `TestRenderer` مع عنصر React المُمرَّر. لا يستخدم هذا التابع DOM الحقيقي ولكنّه يُصيِّر بشكل كامل شجرة المكوّنات في الذاكرة حتى تتمكن من تقديم التأكيدات حولها. وترجع [TestRenderer نموذج](#testrenderer-instance).
107107

108108
### `TestRenderer.act()` {#testrendereract}
109109

0 commit comments

Comments
 (0)