Skip to content

Commit

Permalink
Merge "ui: Create new 'components' root level dir and move files into…
Browse files Browse the repository at this point in the history
… it" into main
  • Loading branch information
stevegolton authored and Gerrit Code Review committed Nov 25, 2024
2 parents 7bb662b + 0a9bc87 commit 920ad3c
Show file tree
Hide file tree
Showing 193 changed files with 640 additions and 751 deletions.
84 changes: 30 additions & 54 deletions python/tools/check_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
'/frontend/*',
'/core/*',
'/common/*',
'/components/*',
'/public/*',
'/trace_processor/*',
'/widgets/*',
Expand All @@ -59,10 +60,7 @@
),

# /public (interfaces + lib) can depend only on a restricted surface.
('/public/*', ['/base/*', '/trace_processor/*']),

# /public/lib can also depend on the plublic interface and widgets.
('/public/lib/*', ['/public/*', '/frontend/widgets/*', '/widgets/*']),
('/public/*', ['/base/*', '/trace_processor/*', '/widgets/*']),

# /plugins (and core_plugins) can depend only on a restricted surface.
(
Expand All @@ -72,7 +70,19 @@
'/public/*',
'/trace_processor/*',
'/widgets/*',
'/frontend/widgets/*',
'/components/*'
],
),

# /components can depend on the 'base' packages & public
(
'/components/*',
[
'/base/*',
'/trace_processor/*',
'/widgets/*',
'/public/*',
'/components/*',
],
),

Expand All @@ -92,61 +102,27 @@
('/protos/index', '/gen/protos'),

# ------ Technical debt that needs cleaning up below this point ------

# TODO(primiano): this dependency for BaseSliceTrack & co needs to be moved
# to /public/lib or something similar.
('/*plugins/*', '/frontend/*track'),

# TODO(primiano): clean up generic_slice_details_tab.
('/*plugins/*', '/frontend/generic_slice_details_tab'),

# TODO(primiano): these dependencies require a discussion with stevegolton@.
# unclear if they should be moved to public/lib/* or be part of the
# {Base/Named/Slice}Track overhaul.
('/*plugins/*', [
'/frontend/slice_layout',
'/frontend/slice_args',
'/frontend/checkerboard',
'/common/track_helper',
'/common/track_data',
]),

# TODO(primiano): clean up dependencies on feature flags.
(['/public/lib/colorizer'], '/core/feature_flags'),
# TODO(stevegolton): Remove these once we extract core types out of
# components.
(
'/components/*',
[
'/core/trace_impl',
'/core/app_impl',
'/core/router',
'/core/flow_types',
'/core/fake_trace_impl',
'/core/raf_scheduler',
'/core/feature_flags',
'/frontend/css_constants',
],
),

# TODO(primiano): Record page-related technical debt.
('/plugins/dev.perfetto.RecordTrace/*', '/frontend/globals'),
('/chrome_extension/chrome_tracing_controller',
'/plugins/dev.perfetto.RecordTrace/*'),

# TODO(primiano): query-table tech debt.
(
'/public/lib/query_table/query_table',
['/frontend/*', '/core/app_impl', '/core/router'],
),

# TODO(primiano): tracks tech debt.
('/public/lib/tracks/*', [
'/frontend/base_counter_track',
'/frontend/slice_args',
'/frontend/tracks/custom_sql_table_slice_track',
'/frontend/tracks/generic_slice_details_tab',
]),

# TODO(stevegolton): It's too much effort to change all the callsites of
# Timestamp and Duration widgets in order to inject trace into them.
('/public/lib/widgets/*', [
'/core/app_impl',
]),

# TODO(primiano): controller-related tech debt.
('/frontend/index', '/controller/*'),
('/controller/*', ['/base/*', '/core/*', '/common/*']),

# TODO(primiano): check this with stevegolton@. Unclear if widgets should
# be allowed to depend on trace_processor.
('/widgets/vega_view', '/trace_processor/*'),

# Bigtrace deps.
('/bigtrace/*', ['/base/*', '/widgets/*', '/trace_processor/*']),

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
// limitations under the License.

import {hsl} from 'color-convert';
import {hash} from '../../base/hash';
import {featureFlags} from '../../core/feature_flags';
import {Color, HSLColor, HSLuvColor} from '../color';
import {ColorScheme} from '../color_scheme';
import {RandState, pseudoRand} from '../../base/rand';
import {hash} from '../base/hash';
import {featureFlags} from '../core/feature_flags';
import {Color, HSLColor, HSLuvColor} from '../public/color';
import {ColorScheme} from '../public/color_scheme';
import {RandState, pseudoRand} from '../base/rand';

// 128 would provide equal weighting between dark and light text.
// However, we want to prefer light text for stylistic reasons.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import {uuidv4} from '../base/uuid';
import {AppImpl} from '../core/app_impl';
import {Tab} from '../public/tab';
import {uuidv4} from '../../base/uuid';
import {AppImpl} from '../../core/app_impl';
import {Tab} from '../../public/tab';

// TODO(primiano): this method should take a Trace parameter (or probably
// shouldn't exist at all in favour of some helper in the Trace object).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
// limitations under the License.

import m from 'mithril';
import {Tab} from '../public/tab';
import {Upid} from '../trace_processor/sql_utils/core_types';
import {DetailsShell} from '../widgets/details_shell';
import {GridLayout, GridLayoutColumn} from '../widgets/grid_layout';
import {Section} from '../widgets/section';
import {Details, DetailsSchema} from './widgets/sql/details/details';
import {Tab} from '../../public/tab';
import {Upid} from '../sql_utils/core_types';
import {DetailsShell} from '../../widgets/details_shell';
import {GridLayout, GridLayoutColumn} from '../../widgets/grid_layout';
import {Section} from '../../widgets/section';
import {Details, DetailsSchema} from '../widgets/sql/details/details';
import d = DetailsSchema;
import {Trace} from '../public/trace';
import {Trace} from '../../public/trace';

export class ProcessDetailsTab implements Tab {
private data: Details;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
// limitations under the License.

import m from 'mithril';
import {isString} from '../base/object_utils';
import {Icons} from '../base/semantic_icons';
import {sqliteString} from '../base/string_utils';
import {exists} from '../base/utils';
import {isString} from '../../base/object_utils';
import {Icons} from '../../base/semantic_icons';
import {sqliteString} from '../../base/string_utils';
import {exists} from '../../base/utils';
import {ArgNode, convertArgsToTree, Key} from './slice_args_parser';
import {Anchor} from '../widgets/anchor';
import {MenuItem, PopupMenu2} from '../widgets/menu';
import {TreeNode} from '../widgets/tree';
import {Arg} from '../trace_processor/sql_utils/args';
import {assertExists} from '../base/logging';
import {getSqlTableDescription} from './widgets/sql/table/sql_table_registry';
import {Trace} from '../public/trace';
import {extensions} from '../public/lib/extensions';
import {Anchor} from '../../widgets/anchor';
import {MenuItem, PopupMenu2} from '../../widgets/menu';
import {TreeNode} from '../../widgets/tree';
import {Arg} from '../sql_utils/args';
import {assertExists} from '../../base/logging';
import {getSqlTableDescription} from '../widgets/sql/table/sql_table_registry';
import {Trace} from '../../public/trace';
import {extensions} from '../extensions';

// Renders slice arguments (key/value pairs) as a subtree.
export function renderArguments(trace: Trace, args: Arg[]): m.Children {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import {isString} from '../base/object_utils';
import {exists} from '../base/utils';
import {isString} from '../../base/object_utils';
import {exists} from '../../base/utils';

export type Key = string | number;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@
// limitations under the License.

import m from 'mithril';
import {BigintMath} from '../../../base/bigint_math';
import {sqliteString} from '../../../base/string_utils';
import {exists} from '../../../base/utils';
import {SliceDetails} from '../../../trace_processor/sql_utils/slice';
import {Anchor} from '../../../widgets/anchor';
import {MenuItem, PopupMenu2} from '../../../widgets/menu';
import {Section} from '../../../widgets/section';
import {SqlRef} from '../../../widgets/sql_ref';
import {Tree, TreeNode} from '../../../widgets/tree';
import {BigintMath} from '../../base/bigint_math';
import {sqliteString} from '../../base/string_utils';
import {exists} from '../../base/utils';
import {SliceDetails} from '../sql_utils/slice';
import {Anchor} from '../../widgets/anchor';
import {MenuItem, PopupMenu2} from '../../widgets/menu';
import {Section} from '../../widgets/section';
import {SqlRef} from '../../widgets/sql_ref';
import {Tree, TreeNode} from '../../widgets/tree';
import {
BreakdownByThreadState,
BreakdownByThreadStateTreeNode,
} from './thread_state';
import {DurationWidget} from '../widgets/duration';
import {renderProcessRef} from '../../../frontend/widgets/process';
import {renderThreadRef} from '../../../frontend/widgets/thread';
import {renderProcessRef} from '../widgets/process';
import {renderThreadRef} from '../widgets/thread';
import {Timestamp} from '../widgets/timestamp';
import {getSqlTableDescription} from '../../../frontend/widgets/sql/table/sql_table_registry';
import {assertExists} from '../../../base/logging';
import {Trace} from '../../trace';
import {getSqlTableDescription} from '../widgets/sql/table/sql_table_registry';
import {assertExists} from '../../base/logging';
import {Trace} from '../../public/trace';
import {extensions} from '../extensions';

// Renders a widget storing all of the generic details for a slice from the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@
// limitations under the License.

import m from 'mithril';
import {copyToClipboard} from '../base/clipboard';
import {Icons} from '../base/semantic_icons';
import {exists} from '../base/utils';
import {Button} from '../widgets/button';
import {DetailsShell} from '../widgets/details_shell';
import {Popup, PopupPosition} from '../widgets/popup';
import {AddDebugTrackMenu} from '../public/lib/tracks/add_debug_track_menu';
import {Filter} from './widgets/sql/table/column';
import {SqlTableState} from './widgets/sql/table/state';
import {SqlTable} from './widgets/sql/table/table';
import {SqlTableDescription} from './widgets/sql/table/table_description';
import {Trace} from '../public/trace';
import {MenuItem, PopupMenu2} from '../widgets/menu';
import {addEphemeralTab} from '../common/add_ephemeral_tab';
import {Tab} from '../public/tab';
import {addChartTab} from './widgets/charts/chart_tab';
import {copyToClipboard} from '../../base/clipboard';
import {Icons} from '../../base/semantic_icons';
import {exists} from '../../base/utils';
import {Button} from '../../widgets/button';
import {DetailsShell} from '../../widgets/details_shell';
import {Popup, PopupPosition} from '../../widgets/popup';
import {AddDebugTrackMenu} from '../tracks/add_debug_track_menu';
import {Filter} from '../widgets/sql/table/column';
import {SqlTableState} from '../widgets/sql/table/state';
import {SqlTable} from '../widgets/sql/table/table';
import {SqlTableDescription} from '../widgets/sql/table/table_description';
import {Trace} from '../../public/trace';
import {MenuItem, PopupMenu2} from '../../widgets/menu';
import {addEphemeralTab} from './add_ephemeral_tab';
import {Tab} from '../../public/tab';
import {addChartTab} from '../widgets/charts/chart_tab';
import {
ChartOption,
createChartConfigFromSqlTableState,
} from './widgets/charts/chart';
import {AddChartMenuItem} from './widgets/charts/add_chart_menu';
} from '../widgets/charts/chart';
import {AddChartMenuItem} from '../widgets/charts/add_chart_menu';

export interface AddSqlTableTabParams {
table: SqlTableDescription;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
// limitations under the License.

import m from 'mithril';
import {Tab} from '../public/tab';
import {Utid} from '../trace_processor/sql_utils/core_types';
import {DetailsShell} from '../widgets/details_shell';
import {GridLayout, GridLayoutColumn} from '../widgets/grid_layout';
import {Section} from '../widgets/section';
import {Details, DetailsSchema} from './widgets/sql/details/details';
import {Tab} from '../../public/tab';
import {Utid} from '../sql_utils/core_types';
import {DetailsShell} from '../../widgets/details_shell';
import {GridLayout, GridLayoutColumn} from '../../widgets/grid_layout';
import {Section} from '../../widgets/section';
import {Details, DetailsSchema} from '../widgets/sql/details/details';
import d = DetailsSchema;
import {Trace} from '../public/trace';
import {Trace} from '../../public/trace';

export class ThreadDetailsTab implements Tab {
private data: Details;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,35 @@
// limitations under the License.

import m from 'mithril';
import {Icons} from '../base/semantic_icons';
import {TimeSpan} from '../base/time';
import {exists} from '../base/utils';
import {Engine} from '../trace_processor/engine';
import {Button} from '../widgets/button';
import {DetailsShell} from '../widgets/details_shell';
import {GridLayout, GridLayoutColumn} from '../widgets/grid_layout';
import {MenuItem, PopupMenu2} from '../widgets/menu';
import {Section} from '../widgets/section';
import {Tree} from '../widgets/tree';
import {Flow, FlowPoint} from '../core/flow_types';
import {Icons} from '../../base/semantic_icons';
import {TimeSpan} from '../../base/time';
import {exists} from '../../base/utils';
import {Engine} from '../../trace_processor/engine';
import {Button} from '../../widgets/button';
import {DetailsShell} from '../../widgets/details_shell';
import {GridLayout, GridLayoutColumn} from '../../widgets/grid_layout';
import {MenuItem, PopupMenu2} from '../../widgets/menu';
import {Section} from '../../widgets/section';
import {Tree} from '../../widgets/tree';
import {Flow, FlowPoint} from '../../core/flow_types';
import {hasArgs, renderArguments} from './slice_args';
import {renderDetails} from '../public/lib/details/slice_details';
import {getSlice, SliceDetails} from '../trace_processor/sql_utils/slice';
import {renderDetails} from './slice_details';
import {getSlice, SliceDetails} from '../sql_utils/slice';
import {
BreakdownByThreadState,
breakDownIntervalByThreadState,
} from '../public/lib/details/thread_state';
import {asSliceSqlId} from '../trace_processor/sql_utils/core_types';
import {DurationWidget} from '../public/lib/widgets/duration';
import {SliceRef} from './widgets/slice';
import {BasicTable} from '../widgets/basic_table';
import {getSqlTableDescription} from './widgets/sql/table/sql_table_registry';
import {assertExists} from '../base/logging';
import {Trace} from '../public/trace';
import {TrackEventDetailsPanel} from '../public/details_panel';
import {TrackEventSelection} from '../public/selection';
import {extensions} from '../public/lib/extensions';
import {TraceImpl} from '../core/trace_impl';
} from './thread_state';
import {asSliceSqlId} from '../sql_utils/core_types';
import {DurationWidget} from '../widgets/duration';
import {SliceRef} from '../widgets/slice';
import {BasicTable} from '../../widgets/basic_table';
import {getSqlTableDescription} from '../widgets/sql/table/sql_table_registry';
import {assertExists} from '../../base/logging';
import {Trace} from '../../public/trace';
import {TrackEventDetailsPanel} from '../../public/details_panel';
import {TrackEventSelection} from '../../public/selection';
import {extensions} from '../extensions';
import {TraceImpl} from '../../core/trace_impl';

interface ContextMenuItem {
name: string;
Expand Down
Loading

0 comments on commit 920ad3c

Please sign in to comment.