Skip to content
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

Remove unstable telemetry feature added for icons #2561

Merged
merged 1 commit into from Jan 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions UNRELEASED.md
Expand Up @@ -2,6 +2,8 @@

### Breaking changes

- Remove unstable telemetry API for icons ([#]())

### Enhancements

- Added `hideTags` prop to `Filters` ([#2573](https://github.com/Shopify/polaris-react/pull/2573))
Expand Down
13 changes: 2 additions & 11 deletions src/components/AppProvider/AppProvider.tsx
@@ -1,6 +1,5 @@
import React from 'react';
import {ThemeConfig} from '../../utilities/theme';
import {TelemetryContext, TelemetryObject} from '../../utilities/telemetry';
import {ThemeProvider} from '../ThemeProvider';
import {MediaQueryProvider} from '../MediaQueryProvider';
import {I18n, I18nContext} from '../../utilities/i18n';
Expand Down Expand Up @@ -42,7 +41,6 @@ export interface AppProviderProps extends AppBridgeOptions {
features?: Features;
/** Inner content of the application */
children?: React.ReactNode;
UNSTABLE_telemetry?: TelemetryObject;
}

export class AppProvider extends React.Component<AppProviderProps, State> {
Expand Down Expand Up @@ -100,12 +98,7 @@ export class AppProvider extends React.Component<AppProviderProps, State> {
}

render() {
const {
theme = {},
features = {},
UNSTABLE_telemetry,
children,
} = this.props;
const {theme = {}, features = {}, children} = this.props;
const {intl, appBridge, link} = this.state;

return (
Expand All @@ -117,9 +110,7 @@ export class AppProvider extends React.Component<AppProviderProps, State> {
<AppBridgeContext.Provider value={appBridge}>
<LinkContext.Provider value={link}>
<ThemeProvider theme={theme}>
<TelemetryContext.Provider value={UNSTABLE_telemetry}>
<MediaQueryProvider>{children}</MediaQueryProvider>
</TelemetryContext.Provider>
<MediaQueryProvider>{children}</MediaQueryProvider>
</ThemeProvider>
</LinkContext.Provider>
</AppBridgeContext.Provider>
Expand Down
20 changes: 1 addition & 19 deletions src/components/Icon/Icon.tsx
@@ -1,7 +1,6 @@
import React, {useEffect} from 'react';
import React from 'react';
import {classNames, variationName} from '../../utilities/css';
import {useI18n} from '../../utilities/i18n';
import {useTelemetry} from '../../utilities/telemetry';
import {IconProps} from '../../types';

import styles from './Icon.scss';
Expand All @@ -22,14 +21,6 @@ interface Props extends IconProps {}

export function Icon({source, color, backdrop, accessibilityLabel}: Props) {
const i18n = useI18n();
const telemetry = useTelemetry();

useEffect(() => {
telemetry.produce('polaris_icons_usage/1.0', {
// eslint-disable-next-line @typescript-eslint/camelcase
icon_source: parseSource(source),
});
}, [source, telemetry]);

if (color && backdrop && !COLORS_WITH_BACKDROPS.includes(color)) {
// eslint-disable-next-line no-console
Expand Down Expand Up @@ -77,12 +68,3 @@ export function Icon({source, color, backdrop, accessibilityLabel}: Props) {
</span>
);
}

function parseSource(source: string | Function) {
if (typeof source === 'function') {
return source.name;
} else if (source === 'placeholder') {
return source;
}
return 'custom icon string';
}
9 changes: 0 additions & 9 deletions src/utilities/telemetry/context.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions src/utilities/telemetry/hooks.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions src/utilities/telemetry/index.ts

This file was deleted.