Commit Graph

23 Commits

Author SHA1 Message Date
Andrey Goncharov
bd7a20d851 Enable Profiler
Summary: Show tab bar in React DevTools to allow switching to Profiler

Reviewed By: nikoant

Differential Revision: D35747309

fbshipit-source-id: ca7e65fdd30261aabc5f05fe10b451c115a92b7f
2022-04-19 07:52:32 -07:00
Andrey Goncharov
ba9a80545d Support globally installed React DevTools
Summary:
- Support loading globally installed DevTools

Background:
1. Initially, I wanted to use react-devtools-core as before. react-devtools-core standalone contains quite a few imports of node.js APIs. After [a conversation with Brian](https://fb.workplace.com/groups/react.devtools/permalink/3131548550392044), I pivoted to react-devtools-inline
2. Technical design doc of react-devtools-inline integration: https://docs.google.com/document/d/1STUSUhXzrW_KkvqSu7Ge-rxjVFF7oU3_NbwzimkO_Z4
3. We support usage of globally installed devtools. Code of react-devtools-inline is not ready to be used by the browser as is. We need to bundle it and substitute React and ReactDOM imports with the globals.
4. As we can't pre-compile what users install globally, we need to bundle global devtools on demand,
5. I tried re-using our Metro bundling pipeline initially, but gave up after fighting it for 2 days. Included, `rollup` instead.
6. Size of a `tgz` archive with a plugin is 2.1MB

allow-large-files

Reviewed By: mweststrate

Differential Revision: D34968770

fbshipit-source-id: 352299964ccc195b8677dbda47db84ffaf38737b
2022-03-31 04:01:33 -07:00
Andrey Goncharov
68aec1df60 Decapitate React DevTools
Summary:
Changelog: Migrate from react-devtools-core to -react-devtools-inline

Technical design doc: https://docs.google.com/document/d/1STUSUhXzrW_KkvqSu7Ge-rxjVFF7oU3_NbwzimkO_Z4

At this point, React DevTools doe snot support globally installed DevTools. Only the bundled version. The support for the globally installed DevTools comes in the subsequent diffs along with on-the-fly transpilation.

Reviewed By: mweststrate

Differential Revision: D34926472

fbshipit-source-id: fde1d4cf386adfbf8a8581ee5a54e950d2cb34ef
2022-03-31 04:01:33 -07:00
dependabot[bot]
4e11458655 Bump antd from 4.16.8 to 4.18.0 in /desktop (#3222)
Summary:
Bumps [antd](https://github.com/ant-design/ant-design) from 4.16.8 to 4.18.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/ant-design/ant-design/releases">antd's releases</a>.</em></p>
<blockquote>
<h2>4.18.0</h2>
<ul>
<li>🐞 Fix Skeleton missing <code>style</code> prop. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33405">#33405</a></li>
<li>🐞 Fix Descriptions overflow style cause other components being cut. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33392">#33392</a></li>
<li>🆕 Unique Select-like component generic as OptionType to support FieldNames type. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33364">#33364</a></li>
<li>🐞 Fix Slider rail hover color when it is disabled. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33369">#33369</a> <a href="https://github.com/chen-jingjie"><code>@​chen-jingjie</code></a></li>
<li>Table
<ul>
<li>🆕 Table <code>colSpan</code> &amp; <code>rowSpan</code> move to <code>onCell</code> function to optimize performance. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33114">#33114</a></li>
<li>🆕 Table support Table.EXPAND_COLUMN &amp; Table.SELECTION_COLUMN to customize column order. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33026">#33026</a></li>
</ul>
</li>
<li>Form
<ul>
<li>🔥 Form.List nest Form.Item no longer need pass <code>fieldKey</code> anymore. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32689">#32689</a></li>
<li>🆕 Form <code>label</code> can wrap via setting <code>labelWrap</code> now. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33048">#33048</a></li>
</ul>
</li>
<li>🆕 ConfigProvider support Form <code>colon</code>. <a href="https://github.com/ant-design/ant-design/commit/9bc148a">9bc148a</a> <a href="https://github.com/seaSuper"><code>@​seaSuper</code></a></li>
<li>🆕 add <code>prefix</code> to <code>InputNumber</code>. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32600">#32600</a> <a href="https://github.com/Austaras"><code>@​Austaras</code></a></li>
<li>🆕 Modal static function support <code>wrapClassName</code> prop. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32676">#32676</a> <a href="https://github.com/cwjTerrace"><code>@​cwjTerrace</code></a></li>
<li>🆕 Popconfirm add <code>showCancel</code> prop. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32620">#32620</a> <a href="https://github.com/cwjTerrace"><code>@​cwjTerrace</code></a></li>
<li>🆕 Dropdown.Button supports <code>loading</code> property now. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32467">#32467</a> <a href="https://github.com/kaysonwu"><code>@​kaysonwu</code></a></li>
<li>🆕 Input adds <code>showCount</code> property. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32522">#32522</a> <a href="https://github.com/cwjTerrace"><code>@​cwjTerrace</code></a></li>
<li>🆕 Alert supports <code>closeIcon</code> now. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32345">#32345</a> <a href="https://github.com/chen-jingjie"><code>@​chen-jingjie</code></a></li>
<li>Typography
<ul>
<li>🆕 for editable Paragraph, edit can be triggered by clicking the icon or the value itself (or both) with <code>triggerType</code>. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32219">#32219</a> <a href="https://github.com/kachanovskiy"><code>@​kachanovskiy</code></a></li>
<li>🆕 Typography support <code>enterIcon</code> to config confirm icon. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32220">#32220</a> <a href="https://github.com/kachanovskiy"><code>@​kachanovskiy</code></a></li>
</ul>
</li>
<li>🆕 Divider added <code>orientationMargin</code> APIs for customizing <code>margin-left/right</code> of title. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32084">#32084</a> <a href="https://github.com/neotan"><code>@​neotan</code></a></li>
<li>🆕 Avatar add <code>maxPopoverTrigger</code> to support configuration of popover trigger. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32197">#32197</a> <a href="https://github.com/RiteshMakan"><code>@​RiteshMakan</code></a></li>
<li>🆕 Upload supports <code>showUploadList.previewIcon</code> now. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32059">#32059</a> <a href="https://github.com/1040961807"><code>@​1040961807</code></a></li>
<li>🏴󠁥󠁳󠁣󠁴󠁿 Fix Catalan (ca_ES) missing translation key with <code>Form</code>. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33377">#33377</a> <a href="https://github.com/ZzGGitter"><code>@​ZzGGitter</code></a></li>
<li>🇫🇮 Fix Finland (fi_FI) missing translation key with <code>Table</code>. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33372">#33372</a> <a href="https://github.com/ZakarFin"><code>@​ZakarFin</code></a></li>
<li>🇰🇭 Added locales for Khmer (km_KH) translation. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32853">#32853</a> <a href="https://github.com/vireakkeosokvibol"><code>@​vireakkeosokvibol</code></a></li>
<li>TypeScript
<ul>
<li>� Add Upload <code>capture</code> definition. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33370">#33370</a> <a href="https://github.com/MichalPodeszwa"><code>@​MichalPodeszwa</code></a></li>
</ul>
</li>
</ul>
<hr />
<ul>
<li>🐞 修复 Skeleton 不支持 <code>style</code> 的问题。<a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33405">#33405</a></li>
<li>🐞 修复 Descriptions 内使用其他组件会被切割的问题。<a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33392">#33392</a></li>
<li>🆕 统一类 Select 组件泛型定义为 OptionType 以支持自定义 FieldNames 匹配。<a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33364">#33364</a></li>
<li>🐞 修复 Slider 禁用时 <code>hover</code> 色彩的问题。<a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33369">#33369</a> <a href="https://github.com/chen-jingjie"><code>@​chen-jingjie</code></a></li>
<li>Table
<ul>
<li>🆕 Table <code>colSpan</code> 与 <code>rowSpan</code> 迁移至 <code>onCell</code> 方法中,以优化渲染性能。<a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33114">#33114</a></li>
<li>🆕 Table 支持 Table.EXPAND_COLUMN 和 Table.SELECTION_COLUMN 以实现自定义列排序。<a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33026">#33026</a></li>
</ul>
</li>
<li>Form
<ul>
<li>🔥 Form.List 嵌套使用 Form.Item 时不再需要手工指定 <code>fieldKey</code>。<a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32689">#32689</a></li>
<li>🆕 Form 现在支持通过 <code>labelWrap</code> 开启标签可换行。<a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33048">#33048</a></li>
</ul>
</li>
<li>🆕 ConfigProvider 支持 Form 的 colon 配置。<a href="https://github.com/ant-design/ant-design/commit/9bc148a">9bc148a</a> <a href="https://github.com/seaSuper"><code>@​seaSuper</code></a></li>
<li>🆕 <code>InputNumber</code> 增加 <code>prefix</code> 属性支持。<a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32600">#32600</a> <a href="https://github.com/Austaras"><code>@​Austaras</code></a></li>
<li>🆕 Modal 静态方法支持 <code>wrapClassName</code> 属性。<a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32676">#32676</a> <a href="https://github.com/cwjTerrace"><code>@​cwjTerrace</code></a></li>
<li>🆕 Popconfirm 新增是否显示取消按钮。<a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32620">#32620</a> <a href="https://github.com/cwjTerrace"><code>@​cwjTerrace</code></a></li>
<li>🆕 Dropdown.Button 新增 <code>loading</code> 属性。<a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32467">#32467</a> <a href="https://github.com/kaysonwu"><code>@​kaysonwu</code></a></li>
<li>🆕 Input 新增 <code>showCount</code> 属性。<a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32522">#32522</a> <a href="https://github.com/cwjTerrace"><code>@​cwjTerrace</code></a></li>
<li>🆕 Alert 支持 <code>closeIcon</code> 自定义关闭图标。<a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32345">#32345</a> <a href="https://github.com/chen-jingjie"><code>@​chen-jingjie</code></a></li>
<li>Typography
<ul>
<li>🆕 对于可编辑段落,可以通过配置 <code>triggerType</code> 配置触发编辑状态。<a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32219">#32219</a> <a href="https://github.com/kachanovskiy"><code>@​kachanovskiy</code></a></li>
<li>🆕 Typography 支持 <code>enterIcon</code> 以设置编辑确认图标。<a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32220">#32220</a> <a href="https://github.com/kachanovskiy"><code>@​kachanovskiy</code></a></li>
</ul>
</li>
</ul>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/ant-design/ant-design/blob/master/CHANGELOG.en-US.md">antd's changelog</a>.</em></p>
<blockquote>
<h2>4.18.0</h2>
<p><code>2021-12-27</code></p>
<ul>
<li>🐞 Fix Skeleton missing <code>style</code> prop. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33405">#33405</a></li>
<li>🐞 Fix Descriptions overflow style cause other components being cut. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33392">#33392</a></li>
<li>🆕 Unique Select-like component generic as OptionType to support FieldNames type. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33364">#33364</a></li>
<li>🐞 Fix Slider rail hover color when it is disabled. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33369">#33369</a> <a href="https://github.com/chen-jingjie"><code>@​chen-jingjie</code></a></li>
<li>Table
<ul>
<li>🆕 Table <code>colSpan</code> &amp; <code>rowSpan</code> move to <code>onCell</code> function to optimize performance. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33114">#33114</a></li>
<li>🆕 Table support Table.EXPAND_COLUMN &amp; Table.SELECTION_COLUMN to customize column order. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33026">#33026</a></li>
</ul>
</li>
<li>Form
<ul>
<li>🔥 Form.List nest Form.Item no longer need pass <code>fieldKey</code> anymore. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32689">#32689</a></li>
<li>🆕 Form <code>label</code> can wrap via setting <code>labelWrap</code> now. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33048">#33048</a></li>
</ul>
</li>
<li>🆕 ConfigProvider support Form <code>colon</code>. <a href="https://github.com/ant-design/ant-design/commit/9bc148a">9bc148a</a> <a href="https://github.com/seaSuper"><code>@​seaSuper</code></a></li>
<li>🆕 add <code>prefix</code> to <code>InputNumber</code>. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32600">#32600</a> <a href="https://github.com/Austaras"><code>@​Austaras</code></a></li>
<li>🆕 Modal static function support <code>wrapClassName</code> prop. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32676">#32676</a> <a href="https://github.com/cwjTerrace"><code>@​cwjTerrace</code></a></li>
<li>🆕 Popconfirm add <code>showCancel</code> prop. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32620">#32620</a> <a href="https://github.com/cwjTerrace"><code>@​cwjTerrace</code></a></li>
<li>🆕 Dropdown.Button supports <code>loading</code> property now. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32467">#32467</a> <a href="https://github.com/kaysonwu"><code>@​kaysonwu</code></a></li>
<li>🆕 Input adds <code>showCount</code> property. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32522">#32522</a> <a href="https://github.com/cwjTerrace"><code>@​cwjTerrace</code></a></li>
<li>🆕 Alert supports <code>closeIcon</code> now. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32345">#32345</a> <a href="https://github.com/chen-jingjie"><code>@​chen-jingjie</code></a></li>
<li>Typography
<ul>
<li>🆕 for editable Paragraph, edit can be triggered by clicking the icon or the value itself (or both) with <code>triggerType</code>. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32219">#32219</a> <a href="https://github.com/kachanovskiy"><code>@​kachanovskiy</code></a></li>
<li>🆕 Typography support <code>enterIcon</code> to config confirm icon. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32220">#32220</a> <a href="https://github.com/kachanovskiy"><code>@​kachanovskiy</code></a></li>
</ul>
</li>
<li>🆕 Divider added <code>orientationMargin</code> APIs for customizing <code>margin-left/right</code> of title. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32084">#32084</a> <a href="https://github.com/neotan"><code>@​neotan</code></a></li>
<li>🆕 Avatar add <code>maxPopoverTrigger</code> to support configuration of popover trigger. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32197">#32197</a> <a href="https://github.com/RiteshMakan"><code>@​RiteshMakan</code></a></li>
<li>🆕 Upload supports <code>showUploadList.previewIcon</code> now. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32059">#32059</a> <a href="https://github.com/1040961807"><code>@​1040961807</code></a></li>
<li>🏴󠁥󠁳󠁣󠁴󠁿 Fix Catalan (ca_ES) missing translation key with <code>Form</code>. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33377">#33377</a> <a href="https://github.com/ZzGGitter"><code>@​ZzGGitter</code></a></li>
<li>🇫🇮 Fix Finland (fi_FI) missing translation key with <code>Table</code>. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33372">#33372</a> <a href="https://github.com/ZakarFin"><code>@​ZakarFin</code></a></li>
<li>🇰🇭 Added locales for Khmer (km_KH) translation. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32853">#32853</a> <a href="https://github.com/vireakkeosokvibol"><code>@​vireakkeosokvibol</code></a></li>
<li>TypeScript
<ul>
<li>� Add Upload <code>capture</code> definition. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33370">#33370</a> <a href="https://github.com/MichalPodeszwa"><code>@​MichalPodeszwa</code></a></li>
</ul>
</li>
</ul>
<h2>4.17.4</h2>
<p><code>2021-12-19</code></p>
<ul>
<li>🐞 Fix a bug that Form.Item name is &quot;parentNode&quot; casue endless loop and memory leak. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/31846">#31846</a> <a href="https://github.com/DaoxingHuang"><code>@​DaoxingHuang</code></a></li>
<li>🐞 Revert <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32448">#32448</a> to fix emoji input at Input.TextArea. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33312">#33312</a></li>
</ul>
<h2>4.17.3</h2>
<p><code>2021-12-08</code></p>
<ul>
<li>🐞 Fix Drawer broken style caused by title width. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33205">#33205</a></li>
<li>🐞 Fix Badge flash style when switch from <code>display:none</code>. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33083">#33083</a> <a href="https://github.com/songlinn"><code>@​songlinn</code></a></li>
<li>💄 Change Anchor className form <code>.fixed</code> to <code>.ant-anchor-fixed</code>. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33085">#33085</a> <a href="https://github.com/tangjinzhou"><code>@​tangjinzhou</code></a></li>
<li>💄 Fix Button loading style missing in Firefox. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/33199">#33199</a></li>
<li>Select
<ul>
<li>🐞 Fix Select width became small when searching. <a href="https://github-redirect.dependabot.com/ant-design/ant-design/pull/32988">#32988</a></li>
</ul>
</li>
</ul>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="41ac1f0c1a"><code>41ac1f0</code></a> chore: 4.18.0 changelog (<a href="https://github-redirect.dependabot.com/ant-design/ant-design/issues/33424">#33424</a>)</li>
<li><a href="24458eb54e"><code>24458eb</code></a> chore: auto merge branchs (<a href="https://github-redirect.dependabot.com/ant-design/ant-design/issues/33423">#33423</a>)</li>
<li><a href="b3cc1e5276"><code>b3cc1e5</code></a> chore: auto merge branchs (<a href="https://github-redirect.dependabot.com/ant-design/ant-design/issues/33422">#33422</a>)</li>
<li><a href="7ae451729f"><code>7ae4517</code></a> test: update snapshot</li>
<li><a href="6ed4d855b1"><code>6ed4d85</code></a> Merge remote-tracking branch 'origin/master' into feature-merge-master</li>
<li><a href="73ac1b1aaa"><code>73ac1b1</code></a> docs: Update practical-projects.zh-CN.md (<a href="https://github-redirect.dependabot.com/ant-design/ant-design/issues/33419">#33419</a>)</li>
<li><a href="7f09f0a604"><code>7f09f0a</code></a> chore(deps): update dependency scrollama to v3 (<a href="https://github-redirect.dependabot.com/ant-design/ant-design/issues/33418">#33418</a>)</li>
<li><a href="9c086c5328"><code>9c086c5</code></a> fix: Skeleton missing style (<a href="https://github-redirect.dependabot.com/ant-design/ant-design/issues/33405">#33405</a>)</li>
<li><a href="f1e0c9c1d2"><code>f1e0c9c</code></a> chore: Internal Menu interface for ProLayout usage (<a href="https://github-redirect.dependabot.com/ant-design/ant-design/issues/33399">#33399</a>)</li>
<li><a href="0edf04253e"><code>0edf042</code></a> fix: Descriptions default overflow value (<a href="https://github-redirect.dependabot.com/ant-design/ant-design/issues/33392">#33392</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/ant-design/ant-design/compare/4.16.8...4.18.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=antd&package-manager=npm_and_yarn&previous-version=4.16.8&new-version=4.18.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

Pull Request resolved: https://github.com/facebook/flipper/pull/3222

Reviewed By: timur-valiev

Differential Revision: D33348265

Pulled By: nikoant

fbshipit-source-id: e219049791c8341b4795fc8b742edaa61ee7559d
2022-01-01 20:28:45 -08:00
Andres Suarez
79023ee190 Update copyright headers from Facebook to Meta
Reviewed By: bhamodi

Differential Revision: D33331422

fbshipit-source-id: 016e8dcc0c0c7f1fc353a348b54fda0d5e2ddc01
2021-12-27 14:31:45 -08:00
Juan Tejada
c42c54f69d For FB, prefer internal build over global build
Summary:
This commit makes it so when running the internal version of Flipper, we always prefer the internal build of React DevTools as opposed to a global install of DevTools. Note that users may still change the version the use and select the global version.

Externally, i.e. for the OSS build, users will still have the option to always prefer the global build and toggle between it.

The motivation for this is to let us ensure that employees are using the latest version of React DevTools and in order to obtain accurate logs of internal usage of DevTools

Reviewed By: mweststrate

Differential Revision: D33167394

fbshipit-source-id: ee75eedc3a488e223189bbfa6288408bb84824e3
2021-12-17 07:57:05 -08:00
Andrey Goncharov
6aa0cef927 Use download file API in MobileBuildsPlugin
Summary:
Facenook:
Use downloadFile API in Mobile Builds plugin

Reviewed By: mweststrate

Differential Revision: D32922041

fbshipit-source-id: d554ed9287af3bda4329e87732ab4de67136c0d2
2021-12-10 06:36:12 -08:00
Andrey Goncharov
4cb80a452f Rename RemoteNodeAPI tp RemoteServerContext
Reviewed By: mweststrate

Differential Revision: D32921160

fbshipit-source-id: 9d6b723427d7a819f2fc1b7168f6d1077dc56bd9
2021-12-10 06:36:12 -08:00
Andrey Goncharov
9df3437683 Remove child_process from Tracery and ReactDevTools
Summary: Changelog: Remove child_process usage  from ReactDevTools plugin

Reviewed By: mweststrate

Differential Revision: D32881744

fbshipit-source-id: c80c3f7589a2787c4b5916ff1eb9f28d4af79700
2021-12-10 06:36:12 -08:00
Michel Weststrate
ad4a55f263 move node types, stub node modules
Summary: This diff stubs all node modules when running in the browser, so that, albeit with a lot of errors and without plugins, the UI loads in a browser. To be continued in the rest of this diff

Reviewed By: antonk52

Differential Revision: D32665705

fbshipit-source-id: 4632e241f59c5b9712a41d01a26878afb01f69b5
2021-12-08 04:30:57 -08:00
Juan Tejada
e75238cbd2 Properly make use of status events provided by DevTools server
Summary: Uses the new statuses emitted by DevTools in https://github.com/facebook/react/pull/22848 to better handle the connection state when connecting to DevTools from Flipper.

Reviewed By: bvaughn

Differential Revision: D32891240

fbshipit-source-id: 142d9996e05b5113e6dca28074c461d5a5acd38f
2021-12-07 10:53:06 -08:00
Juan Tejada
4a93224151 Differentiate Flipper in logging from standalone app
Summary:
This commit makes it so when we load DevTools from within Flipper we log it as a Flipper load and not a regular standalone app load.

Note that the logging only applies internally.

Reviewed By: bvaughn

Differential Revision: D32884616

fbshipit-source-id: 90d0962bac9c1abdde36a70fd361251d7e607b57
2021-12-06 12:41:51 -08:00
Juan Tejada
f9547e024e Allow switching between internal and OSS DevTools (#3139)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/3139

This commit adds new UI in the top level toolbar to allow internal FB users to switch between the internal build of devtools and the OSS one.

## Scenarios

**Internal (when `client.isFB`)**

- DevTools version will default to the internal version, and will render a `Select` component with option to switch to the OSS version.
- If a global install of DevTools is present, the selection menu will also offer the option to switch to the global DevTools version.

**External (when `!client.isFB`)**
Will preserve previous behavior:

- Uses the OSS version by default, and doesn't provide option to switch to internal version.
- If a global installation is present, will render a `Switch` component that allows switching between OSS and global installation.

### Implementation

This commit refactors some parts of the DevTools plugin to provide a bit more clarity in the loading sequence by renaming and modifying some of the messaging, and fixing lint warnings.

A change introduced here is that when switching or loading devtools, when we attempt to reload the device via Metro, don't immediately show a "Retry" button, since at that point nothing has gone wrong, and the Retry button will only occur if the Metro reload doesn't occur after a few seconds.

In a future commit, this [PR in Devtools](https://github.com/facebook/react/pull/22848) will allow us to clear any loading messages once DevTools has successfully connected.

Reviewed By: lunaruan, mweststrate

Differential Revision: D32773200

fbshipit-source-id: aa15ffecba7b2b2ea74e109e9f16334d47bf5868
2021-12-06 12:41:51 -08:00
Juan Tejada
618670d00a Update Flipper DevTools plugin to use internal build
Summary:
This commit update the React DevTools Flipper plugin to use the internal build of `react-devtools-core/standalone`.

The internal build of `react-devtools-core/standalone` is generated by the new sync script: `js1 upgrade react-devtools-core`, which places the build under  `xplat/sonar/desktop/plugins/public/reactdevtools/fb`.

As a follow up, we can add a dropdown to allow users to select which version of React DevTools they'd like to use.

Reviewed By: mweststrate

Differential Revision: D31904288

fbshipit-source-id: ce0880284bd7f9ccaa6258a7c2956f20771e81a9
2021-12-06 12:41:51 -08:00
Andrey Goncharov
5610f8f058 Remove 'path' from plugins
Summary:
1. Add `path` replacement
1. Remove Node's path for all plugins but MobileBuildsPluginContainer (it is probably going to be moved to the server)

Reviewed By: mweststrate

Differential Revision: D32766327

fbshipit-source-id: e636f273842506e752b97cf1b28ce7ac51ce9a12
2021-12-02 04:14:51 -08:00
Michel Weststrate
3882357579 Factor out realDevice [7/n]
Summary: `device.realDevice` was the escape hatch used in Sandy plugins to give access to device specific features like taking screenshots, clearing logs or accessing `adb`. Since in decapitated Flipper that won't be possible anymore (since plugins run in the client but device implementations on the server), all escape hatches have been bridged in this stack, and we can get of the `realDevice` interaction, by explicitly exposing those cases, which makes it type safe as well.

Reviewed By: passy

Differential Revision: D31079509

fbshipit-source-id: c9ec2e044d0dec0ccb1de287cf424907b198f818
2021-09-22 09:03:33 -07:00
Michel Weststrate
4463e7ede2 Restore metro functionality [4/n]
Summary: Restored Metro functionality; progress reports, metro logs, RN/Hermes debugging, reload / dev menu button

Reviewed By: passy

Differential Revision: D31055958

fbshipit-source-id: c243035c343c14718a9afe275c8f5f36a1aa3a94
2021-09-22 09:03:32 -07:00
Michel Weststrate
a8062499df Use local storage for state persisting
Summary: Apply local storage setting at a few relevant places, see parent diff

Reviewed By: cekkaewnumchai

Differential Revision: D29516498

fbshipit-source-id: 4797986e3540217e42dfb867f7d627921b97618e
2021-07-05 08:39:54 -07:00
Michel Weststrate
96cbc81e63 Fix connection and DOM management of React DevTools
Summary:
This diff fixes several existing issues in the React DevTools:

Every time the user opened the plugin we re-instantiated the devtools, which has a few problems: 1) it looses all state (e.g. selection), and 2) this causes the tools to start a websocket listener on a new port, that was never cleaned up, or ever used, since React Native always connects to port 8097 anyway.

To preserve the state the idea of the original implementation was to move the devTools out of the current view, without disposing it. This actually didn't work in practice due to a faulty implementation, causing a full reinialization of the tools every time. Addressed this by reusing the mechanism that is used by the Hermes debugger tools as well.

By properly managing the port (e.g. closing it), there is no need to start (in vain) the devTools on a random port.

Port reversal for physical devices needs to happen only once, in principle upon connecting the device, so moved it to the device logic, which also avoids the need to hack into the global Flipper store.

Avoiding recreating the devTools makes plugin switching near instant, instead of needing to wait for a few seconds until the devTools connect.

When multiple apps are connected the behavior is now consistent: the application that refreshed last will be the one visible in the devTools. (That is still pretty suboptimal, but at least predicable and not a use case that is requested / supported in the DevTools themselves atm)

There is still ugly DOM business going on, did put that in a stand alone component for now.
Didn't extract the shared logic with Hermes plugin yet, but did verify both are still working correctly.

Changelog: [React DevTools] Several improvements that should improve the overal experience, the plugin should load much quicker and behave more predictably.

Reviewed By: bvaughn

Differential Revision: D28382587

fbshipit-source-id: 0f2787b24fa2afdf5014dbf1d79240606405199a
2021-05-12 14:21:53 -07:00
Michel Weststrate
ab17bbd555 Allow using global devTools
Summary:
Currently Flipper embeds the React devTools, and as a result the version of the React devTools is strictly coupled to the Flipper version. This is troublesome when connecting to (slightly) older React Native versions, that use a different version of the tools. That results in errors like this one:

{F615263497}

This diff introduces a feature to use globally installed devTools instead of the embedded ones, giving users the flexibility to pick their own version.

{F615263580}

This addresses

https://fb.workplace.com/groups/flippersupport/permalink/1125669971246993/
https://github.com/facebook/flipper/issues/2250
https://github.com/facebook/flipper/issues/2224

Changelog: [React DevTools] It is now possible to switch between the embedded and globally installed version of the React DevTools. This will enable the React DevTools to connect to older RN versions. Fixes #2250, #2224

Reviewed By: passy

Differential Revision: D28382586

fbshipit-source-id: a5386a5043933acda5aab2db74078bf7ceb105ca
2021-05-12 14:21:53 -07:00
Michel Weststrate
4062950fbe Convert React DevTools to Sandy
Summary:
Converted ReactDevTools to Sandy, no real semantic changes. Will add those in next diffs.

Made some minor flow optimizations.

The port forwarding setup interacted directly with the Flipper store, so made an escape hatch for that. Will clean that up again in next diffs.

Reviewed By: passy

Differential Revision: D28380055

fbshipit-source-id: 053979fd10bf3b62089a4f1e27b0e02b4b05e2e1
2021-05-12 14:21:53 -07:00
Anton Nikolaev
dc7226b7dc Script for plugin type-checking (#2172)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/2172

New script which runs "tsc" for all plugins, receives list of errors and then checks which plugins are affected. It works for shared libs too, e.g. if there is an error in a shared library, then all plugins dependant on it will be counted as affected. For convenience, script saves list of errors affecting each plugin to "tsc-errors.log" in plugin folder.

This script will be used for automatic type-checking plugins against current "stable" and "insiders" versions of Flipper.

An alternative to this implementation would be to simply run "tsc" for each plugin individually, but such implementation takes a lot of time (5+ sec per plugin) and so cannot be effectively used on diffs.

Reviewed By: mweststrate

Differential Revision: D27499765

fbshipit-source-id: fcbbfc94a13e6c7c5beff0c889a929f84c41b2dd
2021-04-09 05:22:01 -07:00
Anton Nikolaev
b3274a8450 Plugin folders re-structuring
Summary:
Here I'm changing plugin repository structure to allow re-using of shared packages between both public and fb-internal plugins, and to ensure that public plugins has their own yarn.lock as this will be required to implement reproducible jobs checking plugin compatibility with released flipper versions.

Please note that there are a lot of moved files in this diff, make sure to click "Expand all" to see all that actually changed (there are not much of them actually).

New proposed structure for plugin packages:
```
- root
- node_modules - modules included into Flipper: flipper, flipper-plugin, react, antd, emotion
-- plugins
 --- node_modules - modules used by both public and fb-internal plugins (shared libs will be linked here, see D27034936)
 --- public
---- node_modules - modules used by public plugins
---- pluginA
----- node_modules - modules used by plugin A exclusively
---- pluginB
----- node_modules - modules used by plugin B exclusively
 --- fb
---- node_modules - modules used by fb-internal plugins
---- pluginC
----- node_modules - modules used by plugin C exclusively
---- pluginD
----- node_modules - modules used by plugin D exclusively
```
I've moved all public plugins under dir "plugins/public" and excluded them from root yarn workspaces. Instead, they will have their own yarn workspaces config and yarn.lock and they will use flipper modules as peer dependencies.

Reviewed By: mweststrate

Differential Revision: D27034108

fbshipit-source-id: c2310e3c5bfe7526033f51b46c0ae40199fd7586
2021-04-09 05:22:00 -07:00