Upgrading typescript isn't possible without breaking the api-graphql and datastore builds.
For this change, I upgraded the entire amplify-js library to "typescript": "5.4.2" (by finding/replacing this dependency where it appears in the repo), then reviewing the build errors and fixing them,
Using a type subset where the problem comes up, this type refinement issue shows up between typescript 5.3.5 and 5.4.5.
5.4.0 came with a bunch of changes that may be causing this, the one that catches my attention is the more aggressive intersection reduction. It appears that repeated generic execution is retaining type narrowing now where before the superset type was kept, if I'm reading these errors correctly.
Description of how you validated changes
I have run/rerun yarn && yarn build && yarn test for both the upgraded and unupgraded versions of this fix.
Checklist
[x] PR description included
[x] yarn test passes
Checklist for repo maintainers
[ ] Verify E2E tests for existing workflows are working as expected or add E2E tests for newly added workflows
[ ] New source file paths included in this PR have been added to CODEOWNERS, if appropriate
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description of changes
Upgrading typescript isn't possible without breaking the
api-graphql
anddatastore
builds.For this change, I upgraded the entire
amplify-js
library to"typescript": "5.4.2"
(by finding/replacing this dependency where it appears in the repo), then reviewing the build errors and fixing them,Using a type subset where the problem comes up, this type refinement issue shows up between typescript 5.3.5 and 5.4.5.
5.4.0 came with a bunch of changes that may be causing this, the one that catches my attention is the more aggressive intersection reduction. It appears that repeated generic execution is retaining type narrowing now where before the superset type was kept, if I'm reading these errors correctly.
Description of how you validated changes
I have run/rerun
yarn && yarn build && yarn test
for both the upgraded and unupgraded versions of this fix.Checklist
yarn test
passesChecklist for repo maintainers
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.