Skip to content

Commit fc1460f

Browse files
authored
Upgrade to TypeScript 5 (#4635)
1 parent 9061591 commit fc1460f

File tree

17 files changed

+57
-323
lines changed

17 files changed

+57
-323
lines changed

NOTICE.txt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,6 @@ This codebase contains a modified portion of code from focus-options-polyfill wh
100100
SOFTWARE.
101101

102102
-------------------------------------------------------------------------------
103-
This codebase contains ResizeObserver.d.ts type declaration file which can be obtained at:
104-
* SOURCE:
105-
* https://gist.github.com/strothj/708afcf4f01dd04de8f49c92e88093c3
106-
107-
* LICENSE:
108-
Copyright 2020 Jason Strothmann
109-
110-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
111-
112-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
113-
114-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
115-
116-
------------------------------------------------------------------------------
117103

118104
This codebase contains a portion of code that vuejs adapted from jest-dom which can be obtained at:
119105
* SOURCE:

examples/rsp-cra-18/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"react": "^18.1.0",
1818
"react-dom": "^18.1.0",
1919
"react-scripts": "5.0.1",
20-
"typescript": "^4.7.3",
20+
"typescript": "5.0.4",
2121
"web-vitals": "^2.1.4"
2222
},
2323
"scripts": {

examples/rsp-next-ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@
2727
"@types/react": "^18.0.21",
2828
"eslint": "^8.24.0",
2929
"eslint-config-next": "^13.4.1",
30-
"typescript": "^4.8.4"
30+
"typescript": "^5.1.3"
3131
}
3232
}

examples/rsp-next-ts/pages/_app.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ function MyApp({ Component, pageProps }: AppProps) {
4444
</ActionButton>
4545
</Flex>
4646
<View>
47-
{/* @ts-ignore */}
4847
<Component {...pageProps} />
4948
</View>
5049
</Grid>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
"sinon": "^7.3.1",
166166
"storybook-dark-mode": "^1.1.1-canary.120.3843.0",
167167
"tempy": "^0.5.0",
168-
"typescript": "^4.6.0",
168+
"typescript": "5.0.4",
169169
"typescript-strict-plugin": "^2.0.0",
170170
"verdaccio": "^5.13.0",
171171
"walk-object": "^4.0.0",

packages/@internationalized/string-compiler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"url": "https://github.com/adobe/react-spectrum"
1515
},
1616
"dependencies": {
17-
"@formatjs/icu-messageformat-parser": "2.0.19"
17+
"@formatjs/icu-messageformat-parser": "^2.4.0"
1818
},
1919
"publishConfig": {
2020
"access": "public"

packages/@react-aria/datepicker/src/useDisplayNames.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {LocalizedStringDictionary} from '@internationalized/string';
1616
import {useLocale} from '@react-aria/i18n';
1717
import {useMemo} from 'react';
1818

19-
type Field = 'era' | 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'dayPeriod' | 'timeZoneName' | 'weekday';
19+
type Field = Intl.DateTimeFormatPartTypes;
2020
interface DisplayNames {
2121
of(field: Field): string
2222
}

packages/@react-spectrum/numberfield/docs/NumberField.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,11 @@ Both a description and an error message can be supplied to a NumberField. The de
324324
```tsx example
325325
function Example() {
326326
let [value, setValue] = React.useState(1);
327-
let isValid = React.useMemo(() => value > 0 || value === NaN, [value]);
327+
let isValid = React.useMemo(() => value > 0 || Number.isNaN(value), [value]);
328328

329329
return (
330330
<NumberField
331-
validationState={value === NaN ? undefined : (isValid ? 'valid' : 'invalid')}
331+
validationState={Number.isNaN(value) ? undefined : (isValid ? 'valid' : 'invalid')}
332332
value={value}
333333
onChange={setValue}
334334
label="Positive numbers only"

packages/@react-spectrum/utils/src/ResizeObserver.d.ts

Lines changed: 0 additions & 250 deletions
This file was deleted.

packages/@react-spectrum/utils/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
*/
1212

1313
/// <reference types="css-module-types" />
14-
/// <reference path="./ResizeObserver.d.ts" />
1514

1615
export type {StyleHandlers} from './styleProps';
1716
export {shouldKeepSpectrumClassNames, keepSpectrumClassNames, classNames} from './classNames';

0 commit comments

Comments
 (0)