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

Typescript 4.9 #2409

Merged
merged 5 commits into from
Feb 7, 2023
Merged

Typescript 4.9 #2409

merged 5 commits into from
Feb 7, 2023

Conversation

BPScott
Copy link
Member

@BPScott BPScott commented Sep 6, 2022

Description

Updating to typescript 4.9.2.

In particular I'm excited by the 4.8 update to how file watching works, which should stop VSCode's typescript server thrashing when you switch branches. Also type-check goes from ~15 to ~12 seconds which is always nice.

See https://devblogs.microsoft.com/typescript/announcing-typescript-4-8/
See https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/

Most changes relate to [Generic constraints no longer extending from {}](https://devblogs.microsoft.com/typescript/announcing-typescript-4-8/#unconstrained-generics-no-longer-assignable-to}. The explanation is pretty dense but the fix boils down to: "Add extends {} if the generic argument can be null/undefined, otherwise add extends object or the the functionally equal extends {[key: string]: unknown} if it's always going to be an object. See microsoft/TypeScript#49489 / microsoft/TypeScript#49119 for more info.

For GraphQL stuff we want to mimic graphql-typed-document-node so we use extends {[key: string]: unknown}

Other changes are regarding small adjustments to Window and NavigatorConnection.

@BPScott BPScott changed the title Typescript 4.8 Typescript 4.9 Nov 29, 2022
@BPScott BPScott marked this pull request as ready for review November 29, 2022 21:46
@BPScott BPScott requested a review from a team as a code owner November 29, 2022 21:46
@BPScott
Copy link
Member Author

BPScott commented Nov 29, 2022

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @BPScott! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/address-mocks@0.0.0-snapshot-20221129214725
yarn add graphql-fixtures@0.0.0-snapshot-20221129214725
yarn add graphql-mini-transforms@0.0.0-snapshot-20221129214725
yarn add @shopify/jest-dom-mocks@0.0.0-snapshot-20221129214725
yarn add @shopify/react-async@0.0.0-snapshot-20221129214725
yarn add @shopify/react-form-state@0.0.0-snapshot-20221129214725
yarn add @shopify/react-google-analytics@0.0.0-snapshot-20221129214725
yarn add @shopify/react-graphql@0.0.0-snapshot-20221129214725
yarn add @shopify/react-graphql-universal-provider@0.0.0-snapshot-20221129214725
yarn add @shopify/react-idle@0.0.0-snapshot-20221129214725
yarn add @shopify/react-import-remote@0.0.0-snapshot-20221129214725
yarn add @shopify/react-server@0.0.0-snapshot-20221129214725
yarn add @shopify/react-testing@0.0.0-snapshot-20221129214725

@BPScott
Copy link
Member Author

BPScott commented Nov 29, 2022

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @BPScott! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/address-mocks@0.0.0-snapshot-20221129224804
yarn add graphql-fixtures@0.0.0-snapshot-20221129224804
yarn add graphql-mini-transforms@0.0.0-snapshot-20221129224804
yarn add @shopify/jest-dom-mocks@0.0.0-snapshot-20221129224804
yarn add @shopify/react-async@0.0.0-snapshot-20221129224804
yarn add @shopify/react-form-state@0.0.0-snapshot-20221129224804
yarn add @shopify/react-google-analytics@0.0.0-snapshot-20221129224804
yarn add @shopify/react-graphql@0.0.0-snapshot-20221129224804
yarn add @shopify/react-graphql-universal-provider@0.0.0-snapshot-20221129224804
yarn add @shopify/react-idle@0.0.0-snapshot-20221129224804
yarn add @shopify/react-import-remote@0.0.0-snapshot-20221129224804
yarn add @shopify/react-server@0.0.0-snapshot-20221129224804
yarn add @shopify/react-testing@0.0.0-snapshot-20221129224804

@BPScott BPScott marked this pull request as draft November 30, 2022 16:56
@BPScott
Copy link
Member Author

BPScott commented Dec 1, 2022

Trying these snapshots out over in https://buildkite.com/shopify/web-ci-builder/builds?branch=quilt-ts49-test. They're failing at the moment, hold off on reviewing till they go green.

@BPScott BPScott self-assigned this Jan 9, 2023
- Update types to account for lib.d.ts changes regarding Navigator and
  Window.
- Propogate generic constraints
@BPScott
Copy link
Member Author

BPScott commented Feb 6, 2023

/snapit

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2023

🫰✨ Thanks @BPScott! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/address-mocks@0.0.0-snapshot-20230206191454
yarn add @shopify/browser@0.0.0-snapshot-20230206191454
yarn add graphql-fixtures@0.0.0-snapshot-20230206191454
yarn add graphql-mini-transforms@0.0.0-snapshot-20230206191454
yarn add @shopify/jest-dom-mocks@0.0.0-snapshot-20230206191454
yarn add @shopify/react-async@0.0.0-snapshot-20230206191454
yarn add @shopify/react-form-state@0.0.0-snapshot-20230206191454
yarn add @shopify/react-google-analytics@0.0.0-snapshot-20230206191454
yarn add @shopify/react-graphql@0.0.0-snapshot-20230206191454
yarn add @shopify/react-graphql-universal-provider@0.0.0-snapshot-20230206191454
yarn add @shopify/react-i18n@0.0.0-snapshot-20230206191454
yarn add @shopify/react-i18n-universal-provider@0.0.0-snapshot-20230206191454
yarn add @shopify/react-idle@0.0.0-snapshot-20230206191454
yarn add @shopify/react-import-remote@0.0.0-snapshot-20230206191454
yarn add @shopify/react-server@0.0.0-snapshot-20230206191454
yarn add @shopify/react-testing@0.0.0-snapshot-20230206191454

@BPScott
Copy link
Member Author

BPScott commented Feb 6, 2023

/snapit

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2023

🫰✨ Thanks @BPScott! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/address-mocks@0.0.0-snapshot-20230206232325
yarn add @shopify/browser@0.0.0-snapshot-20230206232325
yarn add graphql-fixtures@0.0.0-snapshot-20230206232325
yarn add graphql-mini-transforms@0.0.0-snapshot-20230206232325
yarn add @shopify/jest-dom-mocks@0.0.0-snapshot-20230206232325
yarn add @shopify/react-async@0.0.0-snapshot-20230206232325
yarn add @shopify/react-form-state@0.0.0-snapshot-20230206232325
yarn add @shopify/react-google-analytics@0.0.0-snapshot-20230206232325
yarn add @shopify/react-graphql@0.0.0-snapshot-20230206232325
yarn add @shopify/react-graphql-universal-provider@0.0.0-snapshot-20230206232325
yarn add @shopify/react-i18n@0.0.0-snapshot-20230206232325
yarn add @shopify/react-i18n-universal-provider@0.0.0-snapshot-20230206232325
yarn add @shopify/react-idle@0.0.0-snapshot-20230206232325
yarn add @shopify/react-import-remote@0.0.0-snapshot-20230206232325
yarn add @shopify/react-server@0.0.0-snapshot-20230206232325
yarn add @shopify/react-testing@0.0.0-snapshot-20230206232325

@BPScott BPScott marked this pull request as ready for review February 7, 2023 00:12
@BPScott
Copy link
Member Author

BPScott commented Feb 7, 2023

Haha, yes that's now passing in web, with some minor changes.

@BPScott BPScott merged commit 0bff6fa into main Feb 7, 2023
@BPScott BPScott deleted the ts4.8 branch February 7, 2023 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant