Skip to content

ref(✂️): remove unused experiment code #90359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions static/app/types/experiments.tsx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the whole file be blown away?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

experiments are still part of the organization type:

experiments: Partial<OrgExperiments>;

if you’re sure they aren’t needed, I can try to remove them too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooh look at this: I can remove it from organization and user types and didn’t get any errors, so it’s really unused. More removal happened here: 8225ae9

Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,3 @@ export type OrgExperiments = GetExperimentAssignment<
export type UserExperiments = GetExperimentAssignment<
TypeSelect<ExperimentList, ExperimentType.USER>['key']
>;

export type ExperimentAssignment = GetExperimentAssignment<ExperimentList['key']>;
18 changes: 0 additions & 18 deletions static/app/types/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import type {ProductSelectionProps} from 'sentry/components/onboarding/productSe
import type SidebarItem from 'sentry/components/sidebar/sidebarItem';
import type DateRange from 'sentry/components/timeRangeSelector/dateRange';
import type SelectorItems from 'sentry/components/timeRangeSelector/selectorItems';
import type {UseExperiment} from 'sentry/utils/useExperiment';
import type {TitleableModuleNames} from 'sentry/views/insights/common/components/modulePageProviders';
import type {OrganizationStatsProps} from 'sentry/views/organizationStats';
import type {RouteAnalyticsContext} from 'sentry/views/routeAnalyticsContextProvider';
import type {NavigationItem, NavigationSection} from 'sentry/views/settings/types';

import type {ExperimentKey} from './experiments';
import type {Integration, IntegrationProvider} from './integrations';
import type {
Route,
Expand Down Expand Up @@ -217,7 +215,6 @@ type CustomizationHooks = {
*/
type AnalyticsHooks = {
'analytics:init-user': AnalyticsInitUser;
'analytics:log-experiment': AnalyticsLogExperiment;
'analytics:raw-track-event': AnalyticsRawTrackEvent;
'metrics:event': MetricsEvent;
};
Expand Down Expand Up @@ -319,7 +316,6 @@ type ReactHooks = {
props: RouteContextInterface
) => React.ContextType<typeof RouteAnalyticsContext>;
'react-hook:use-button-tracking': (props: ButtonProps) => () => void;
'react-hook:use-experiment': UseExperiment;
'react-hook:use-get-max-retention-days': () => number | undefined;
};

Expand Down Expand Up @@ -437,20 +433,6 @@ type AnalyticsRawTrackEvent = (
}
) => void;

/**
* Trigger experiment observed logging.
*/
type AnalyticsLogExperiment = (opts: {
/**
* The experiment key
*/
key: ExperimentKey;
/**
* The organization. Must be provided for organization experiments.
*/
organization?: Organization;
}) => void;

/**
* Trigger recording a metric in the hook store.
*/
Expand Down
44 changes: 0 additions & 44 deletions static/app/utils/useExperiment.tsx

This file was deleted.

26 changes: 0 additions & 26 deletions static/app/utils/withExperiment.spec.tsx

This file was deleted.

107 changes: 0 additions & 107 deletions static/app/utils/withExperiment.tsx

This file was deleted.

103 changes: 0 additions & 103 deletions static/gsApp/hooks/useExperiment.spec.tsx

This file was deleted.

Loading
Loading