Skip to content

Commit

Permalink
Bump typescript from 3.2.4 to 3.8.2 (mui#19242)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored and EsoterikStare committed Mar 30, 2020
1 parent d3c3e55 commit d5f7f31
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 31 deletions.
3 changes: 0 additions & 3 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ update_configs:
# https://github.com/mui-org/material-ui/pull/17168#issuecomment-524861427
dependency_name: 'tslint'
version_requirement: '5.x'
- match:
# we support typescript ^3.2.2 updating it in the repo might not catch new syntax
dependency_name: 'typescript'
- match:
# as of 3.x requires node@10. We can upgrade once we do as well
dependency_name: 'url-loader'
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/components/autocomplete/GoogleMaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export default function GoogleMaps() {

const fetch = React.useMemo(
() =>
throttle((input, callback) => {
autocompleteService.current.getPlacePredictions(input, callback);
throttle((request, callback) => {
autocompleteService.current.getPlacePredictions(request, callback);
}, 200),
[],
);
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/components/autocomplete/GoogleMaps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ export default function GoogleMaps() {

const fetch = React.useMemo(
() =>
throttle((input, callback) => {
(autocompleteService.current as any).getPlacePredictions(input, callback);
throttle((request: { input: string }, callback: (results?: PlaceType[]) => void) => {
(autocompleteService.current as any).getPlacePredictions(request, callback);
}, 200),
[],
);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"size-limit": "^0.21.0",
"ts-node": "^8.3.0",
"tslint": "5.14.0",
"typescript": "3.2.4",
"typescript": "^3.8.2",
"typescript-to-proptypes": "^1.4.0",
"vrtest": "^0.2.0",
"webpack": "^4.41.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ import { createStyles, makeStyles } from '@material-ui/styles';
defaultTheme: validCustomTheme,
});

// $ExpectError
makeStyles(style, {
// $ExpectError
defaultTheme: invalidCustomTheme,
});

Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui-styles/src/styled/styled.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function themeTest() {
value: number;
theme: { palette: { primary: string } };
}) => ({});
const Component: React.FC = () => null;
const Component: React.FC<{ value: number }> = () => null;
const ComponentWithTheme: React.FC<{ theme: { zIndex: { [k: string]: number } } }> = () => null;

const ComponentStyled = styled(Component)(style);
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui-styles/test/styles.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ withStyles(theme =>
content: {
minHeight: '100vh',
},
// $ExpectError
'@media (min-width: 960px)': {
content: {
// $ExpectError
display: 'flex',
},
},
Expand Down
3 changes: 3 additions & 0 deletions packages/material-ui/src/ButtonBase/ButtonBase.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,9 @@ describe('<ButtonBase />', () => {

describe('prop: component', () => {
it('should allow to use a link component', () => {
/**
* @type {React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement>>}
*/
const Link = React.forwardRef((props, ref) => (
<div data-testid="link" ref={ref} {...props} />
));
Expand Down
5 changes: 2 additions & 3 deletions packages/material-ui/test/typescript/components.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -613,9 +613,8 @@ const MenuTest = () => {
// 'false' is not assignable to true | undefined
button={false} // $ExpectError
ref={elem => {
// previous error throws type checker off. Since this is an error anyway
// `any` is fine
elem; // $ExpectType any
// inferred from `button={false}` instead of `action`
elem; // $ExpectType HTMLLIElement | null
}}
/>
</Menu>
Expand Down
11 changes: 4 additions & 7 deletions packages/material-ui/test/typescript/hoc-interop.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,21 @@ const filledProps = {
// baseline behavvior
<TextField variant="filled" {...filledProps} />;
// $ExpectError
<TextField {...filledProps} />; // desired
<TextField {...filledProps} />; // desired to throw

// styled
{
const StyledTextField = styled(TextField)``;
// $ExpectError
<StyledTextField variant="filled" {...filledProps} />; // undesired, fixable by using older version 4.1.20
// $ExpectError
<StyledTextField {...filledProps} />; // desired
<StyledTextField variant="filled" {...filledProps} />; // desired to pass
<StyledTextField {...filledProps} />; // undesired, should throw
}

// @emotion/styled
{
const StyledTextField = emotionStyled(TextField)``;
// $ExpectError
<StyledTextField variant="filled" {...filledProps} />; // undesired
// $ExpectError
<StyledTextField {...filledProps} />; // desired
<StyledTextField {...filledProps} />; // undesired, should throw
}

// react-router
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/test/typescript/styles.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ withStyles(theme =>
content: {
minHeight: '100vh',
},
// $ExpectError
'@media (min-width: 960px)': {
content: {
// $ExpectError
display: 'flex',
},
},
Expand Down
13 changes: 4 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14833,20 +14833,15 @@ typescript-to-proptypes@^1.4.0:
typescript "3.5.2"
uuid "^3.3.2"

typescript@3.2.4:
version "3.2.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.4.tgz#c585cb952912263d915b462726ce244ba510ef3d"
integrity sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg==

typescript@3.5.2:
version "3.5.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.2.tgz#a09e1dc69bc9551cadf17dba10ee42cf55e5d56c"
integrity sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA==

typescript@next:
version "3.3.0-dev.20190112"
resolved "https://registry.npmjs.org/typescript/-/typescript-3.3.0-dev.20190112.tgz#7d0485527d10db1acbfbc6f87bcd8541ec71c32f"
integrity sha512-aEfjOBzSPfd/sxQwEz6y+xl8+bYmGb2zl+sGIoJUNaKV+xk/Cf4bWtTlHcP/sTBRDQoE4iCT2gZZBmxfe3hWyg==
typescript@^3.8.2, typescript@next:
version "3.8.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.2.tgz#91d6868aaead7da74f493c553aeff76c0c0b1d5a"
integrity sha512-EgOVgL/4xfVrCMbhYKUQTdF37SQn4Iw73H5BgCrF1Abdun7Kwy/QZsE/ssAy0y4LxBbvua3PIbFsbRczWWnDdQ==

uglify-js@^3.1.4:
version "3.7.2"
Expand Down

0 comments on commit d5f7f31

Please sign in to comment.