Skip to content

Commit

Permalink
Typescript 5.5.0 upgrade (#6370)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowystinger authored Jun 24, 2024
1 parent 4e3af37 commit 2cd8f0b
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 26 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"react-dom": "^18.2.0",
"react-frame-component": "^5.0.0",
"react-test-renderer": "^16.9.0",
"recast": "^0.20",
"recast": "^0.23",
"recursive-readdir": "^2.2.2",
"regenerator-runtime": "0.13.3",
"rimraf": "^2.6.3",
Expand All @@ -185,7 +185,7 @@
"tailwindcss": "^3.4.0",
"tailwindcss-animate": "^1.0.7",
"tempy": "^0.5.0",
"typescript": "^5.3.3",
"typescript": "^5.5.0",
"typescript-strict-plugin": "^2.0.0",
"verdaccio": "^5.13.0",
"walk-object": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@react-aria/numberfield/src/useNumberField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export function useNumberField(props: AriaNumberFieldProps, state: NumberFieldSt
// Browsers and operating systems are quite inconsistent about what keys are available, however.
// We choose between numeric and decimal based on whether we allow negative and fractional numbers,
// and based on testing on various devices to determine what keys are available in each inputMode.
let hasDecimals = intlOptions.maximumFractionDigits > 0;
let hasDecimals = (intlOptions.maximumFractionDigits ?? 0) > 0;
let hasNegative = (state.minValue === undefined || isNaN(state.minValue)) || state.minValue < 0;
let inputMode: TextInputDOMProps['inputMode'] = 'numeric';
if (isIPhone()) {
Expand Down
4 changes: 2 additions & 2 deletions packages/@react-spectrum/color/src/ColorEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function ColorEditor(props: SpectrumColorEditorProps, ref: DOMRef<HTMLDivElement
}
</div>
<div className={style({display: 'flex', gap: 4})()}>
<Picker
<Picker
aria-label={formatter.format('colorFormat')}
isQuiet
width="size-700"
Expand All @@ -47,7 +47,7 @@ function ColorEditor(props: SpectrumColorEditorProps, ref: DOMRef<HTMLDivElement
{format === 'hex'
? <ColorField isQuiet width="size-1000" aria-label={formatter.format('hex')} />
: getColorChannels(format).map(channel => (
<ColorField key={channel} colorSpace={format === 'hex' ? 'rgb' : format} channel={channel} isQuiet width="size-400" flex UNSAFE_style={{'--spectrum-textfield-min-width': 0} as CSSProperties} />
<ColorField key={channel} colorSpace={format} channel={channel} isQuiet width="size-400" flex UNSAFE_style={{'--spectrum-textfield-min-width': 0} as CSSProperties} />
))}
{!props.hideAlphaChannel &&
<ColorField channel="alpha" isQuiet width="size-400" flex UNSAFE_style={{'--spectrum-textfield-min-width': 0} as CSSProperties} />}
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-spectrum/meter/stories/Meter.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@

import {ComponentMeta, ComponentStoryObj} from '@storybook/react';
import {Meter} from '../';
import {NumberFormatOptions} from '@internationalized/number';
import React from 'react';

type MeterStory = ComponentStoryObj<typeof Meter>;

const formatOptions = {
style: 'currency',
currency: 'JPY'
};
} satisfies NumberFormatOptions;

export default {
title: 'Meter',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ export const ColorPickerExample = (args) => {
</select>
</label>
<div style={{display: 'flex', gap: 4, width: 192}}>
{format === 'hex'
{format === 'hex'
? (
<ColorField style={{display: 'flex', flexDirection: 'column'}}>
<Label>Hex</Label>
<Input />
</ColorField>
) : getColorChannels(format).map(channel => (
<ColorField key={channel} colorSpace={format === 'hex' ? 'rgb' : format} channel={channel} style={{display: 'flex', flexDirection: 'column', flex: 1}}>
<ColorField key={channel} colorSpace={format} channel={channel} style={{display: 'flex', flexDirection: 'column', flex: 1}}>
<Label />
<Input style={{width: '100%', boxSizing: 'border-box'}} />
</ColorField>
Expand Down
15 changes: 15 additions & 0 deletions patches/ast-types+0.16.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/node_modules/ast-types/lib/main.d.ts b/node_modules/ast-types/lib/main.d.ts
index 9b54fef..5c38539 100644
--- a/node_modules/ast-types/lib/main.d.ts
+++ b/node_modules/ast-types/lib/main.d.ts
@@ -1,7 +1,7 @@
-import { ASTNode, Type, AnyType, Field } from "./types";
-import { NodePath } from "./node-path";
+import { ASTNode, type Type, AnyType, Field } from "./types";
+import { type NodePath } from "./node-path";
import { namedTypes } from "./gen/namedTypes";
-import { builders } from "./gen/builders";
+import { type builders } from "./gen/builders";
import { Visitor } from "./gen/visitor";
declare const astNodesAreEquivalent: {
(a: any, b: any, problemPath?: any): boolean;
2 changes: 1 addition & 1 deletion scripts/extractExamples.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ import ReactDOM from 'react-dom/client';

fs.writeFileSync(`${distDir}/tsconfig.json`, `{
"compilerOptions": {
"target": "es6",
"target": "es2018",
"lib": [
"dom",
"dom.iterable",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// we can explicitly declare `any`, but we don't want to infer `any`
"noImplicitAny": false,
// maybe bump to 'esNext'?
"target": "es6",
"target": "es2018",
// allows react jsx in tsx files
"jsx": "react",
// Eventually turn off, one we have no more assumed default exports.
Expand Down
26 changes: 10 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6797,13 +6797,6 @@ ast-types-flow@^0.0.7:
resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad"
integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0=

ast-types@0.14.2:
version "0.14.2"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.14.2.tgz#600b882df8583e3cd4f2df5fa20fa83759d4bdfd"
integrity sha512-O0yuUDnZeQDL+ncNGlJ78BiO4jnYI3bvMsD5prT0/nsgijG/LpNBIr63gTjVTNsiGkgQhiyCShTgxt8oXOrklA==
dependencies:
tslib "^2.0.1"

ast-types@^0.16.1:
version "0.16.1"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.16.1.tgz#7a9da1617c9081bc121faafe91711b4c8bb81da2"
Expand Down Expand Up @@ -19769,14 +19762,15 @@ readdirp@~3.6.0:
dependencies:
picomatch "^2.2.1"

recast@^0.20:
version "0.20.5"
resolved "https://registry.yarnpkg.com/recast/-/recast-0.20.5.tgz#8e2c6c96827a1b339c634dd232957d230553ceae"
integrity sha512-E5qICoPoNL4yU0H0NoBDntNB0Q5oMSNh9usFctYniLBluTthi3RsQVBXIJNbApOlvSwW/RGxIuokPcAc59J5fQ==
recast@^0.23:
version "0.23.9"
resolved "https://registry.yarnpkg.com/recast/-/recast-0.23.9.tgz#587c5d3a77c2cfcb0c18ccce6da4361528c2587b"
integrity sha512-Hx/BGIbwj+Des3+xy5uAtAbdCyqK9y9wbBcDFDYanLS9JnMqf7OeF87HQwUimE87OEc72mr6tkKUKMBBL+hF9Q==
dependencies:
ast-types "0.14.2"
ast-types "^0.16.1"
esprima "~4.0.0"
source-map "~0.6.1"
tiny-invariant "^1.3.3"
tslib "^2.0.1"

recast@^0.23.1, recast@^0.23.3:
Expand Down Expand Up @@ -22382,10 +22376,10 @@ typescript-strict-plugin@^2.0.0:
ora "^5.4.1"
yargs "^16.2.0"

typescript@^5.3.3:
version "5.3.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37"
integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==
typescript@^5.5.0:
version "5.5.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.2.tgz#c26f023cb0054e657ce04f72583ea2d85f8d0507"
integrity sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==

ua-parser-js@0.7.17:
version "0.7.17"
Expand Down

1 comment on commit 2cd8f0b

@rspbot
Copy link

@rspbot rspbot commented on 2cd8f0b Jun 24, 2024

Choose a reason for hiding this comment

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

Please sign in to comment.