gecko-dev/devtools
Belén Albeza 4e1ce7bb11 Bug 1494543 - Part 1: Refactor sidebar items into different components. r=jdescottes,daisuke
This is a refactor of the components used in the sidebar. TL;DR: sidebar items now use the composition approach outlined here https://reactjs.org/docs/composition-vs-inheritance.html

Before we had a container `Sidebar` component, which in turn had `SidebarItem` components inside. The issue was that depending on what item is inside, the information and UX displayed is different. Before this patch, we had an optional commponent, `DeviceSidebarItemAction` –which was featuring a "Connect" button, and was only rendered in the runtime sidebar items. However, we now need to display even more info, so continue to pass optional components to `SidebarItem` was tricky.

What this patch does is to preserve `SidebarItem` and treat is a generic container of more specific content. This is passed via the `children` prop, which React automatically maps to the DOM content that we pass to that component (this is the same concept as slots in Web Components / Vue). `SidebarItem` now only contains the logic to select items in the sidebar and render them in `<li>` elements. Two new components, `SidebarFixedItem` (for our "static" pages) and `SidebarDeviceItem` are now the ones instancing `SidebarItem` with their specific contents.

Differential Revision: https://phabricator.services.mozilla.com/D7704

--HG--
extra : moz-landing-system : lando
2018-10-16 09:35:25 +00:00
..
client Bug 1494543 - Part 1: Refactor sidebar items into different components. r=jdescottes,daisuke 2018-10-16 09:35:25 +00:00
docs Bug 1485660 - Switch from listening from DebuggerClient to TargetFront. r=jdescottes 2018-10-15 08:36:10 +00:00
platform
server Backed out changeset 8d7987ea4fb1 (bug 1490257) for causing android failures. CLOSED TREE 2018-10-15 14:39:00 +03:00
shared Bug 1494632 - Convert WorkerClient to protocol.js front. r=jdescottes 2018-10-16 09:39:11 +00:00
startup Bug 1491879 - Fix telemetry support for multiple tabs / windows r=nchevobbe 2018-09-25 12:57:13 +00:00
.eslintrc.js Bug 1492510 - Deleting obsolete reference from eslintrc. r=sole 2018-09-24 12:34:12 +00:00
.eslintrc.mochitests.js Backed out changeset d8ff6c1c6f3a (bug 1471764) for failing devtools' browser_markup_flex_display_badge.js in beta simulations. a=backout 2018-09-04 18:21:03 +03:00
.eslintrc.xpcshell.js
CODE_OF_CONDUCT.md
moz.build Bug 1490575 - Remove Mulet comments from build files. r=froydnj 2018-09-11 23:07:32 -07:00
templates.mozbuild