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

Enable Typescript 3.8 and update Sewing-kit to latest #2873

Merged
merged 10 commits into from
Mar 25, 2020
2 changes: 1 addition & 1 deletion src/components/DataTable/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {measureColumn, getPrevAndCurrentColumns} from './utilities';
import {DataTableState, SortDirection, VerticalAlign} from './types';
import styles from './DataTable.scss';

export {SortDirection};
export type {SortDirection};

type CombinedProps = DataTableProps & WithAppProviderProps;
export type TableRow =
Expand Down
3 changes: 2 additions & 1 deletion src/components/DatePicker/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import {monthName} from './utilities';
import {Month} from './components';
import styles from './DatePicker.scss';

export {Range, Months, Year};
export {Months};
Copy link
Contributor

Choose a reason for hiding this comment

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

What's going on here? Is Months not a type even though it's imported from the same place as Year and Range?

Copy link
Member Author

@BPScott BPScott Mar 25, 2020

Choose a reason for hiding this comment

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

Bingo. Months is an enum, while Range and Year are both types. See https://github.com/Shopify/javascript-utilities/blob/master/src/dates.ts#L11

Follow up questions: is this annoying and would it be better if Months was a union type like type Months = 0 |1|2|3|4|5|6|7|8|9|10|11? Yeah probably, but thar be dragons in the javascript-utilities packages and I want to stop relying on it eventually so just stick your fingers in your ears and ignore it for now :D

export type {Range, Year};

export interface DatePickerProps {
/** ID for the element */
Expand Down
2 changes: 1 addition & 1 deletion src/components/Frame/components/Toast/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {ToastProps} from '../../../../utilities/frame';

import styles from './Toast.scss';

export {ToastProps};
export type {ToastProps};

export const DEFAULT_TOAST_DURATION = 5000;

Expand Down
4 changes: 2 additions & 2 deletions src/components/Navigation/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export * from './Navigation';

export {
export {isNavigationItemActive} from './components';
export type {
ItemProps as NavigationItemProps,
SubNavigationItem,
isNavigationItemActive,
MessageProps as NavigationMessageProps,
} from './components';
2 changes: 1 addition & 1 deletion src/components/RangeSlider/RangeSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {useUniqueId} from '../../utilities/unique-id';
import {RangeSliderProps, RangeSliderValue, DualValue} from './types';
import {SingleThumb, DualThumb} from './components';

export {RangeSliderProps};
export type {RangeSliderProps};

// The script in the styleguide that generates the Props Explorer data expects
// that the interface defining the props is defined in this file, not imported
Expand Down
2 changes: 1 addition & 1 deletion src/components/ResourceList/ResourceList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
} from './components';
import styles from './ResourceList.scss';

export {FilterControlProps};
export type {FilterControlProps};

const SMALL_SCREEN_WIDTH = 458;
const SMALL_SPINNER_HEIGHT = 28;
Expand Down
2 changes: 1 addition & 1 deletion src/components/TopBar/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
} from './components';
import styles from './TopBar.scss';

export {UserMenuProps, SearchFieldProps};
export type {UserMenuProps, SearchFieldProps};

export interface TopBarProps {
/** Toggles whether or not a navigation component has been provided. Controls the presence of the mobile nav toggle button */
Expand Down
Loading