-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
cache.modify
: less strict types & dev runtime warnings
#11206
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
dd24ff7
example testing helpers with `using`
phryneas 4a49723
Merge branch 'main' into pr/tests-using
phryneas 65e3171
eslint rule, broken modules
phryneas 353b5dc
working local eslint rule
phryneas 162e9da
swap out many cases of manual console mocking
phryneas 1d6cd24
make lint rule more solid
phryneas 7f90db6
format
phryneas b7b6dec
rename variables
phryneas 5f2654f
recreate export snapshots without tests bleeding into each other
phryneas 6ae0eab
restore snapshotting behaviour
phryneas fc7f293
remove accidentally commited file
phryneas 51cc9da
migrate more usages
phryneas 9700c6b
laxer types for `modify` input & return arrays
phryneas 8185a2d
runtime dev warning when returning mixed arrays from `cache.modify`
phryneas 8e0a5c7
cache.modify: warn on writing non-existant References
phryneas a6f0ce2
only warn on objects that could be converted to a Reference
phryneas 8e7b5eb
changeset
phryneas e20b139
Merge remote-tracking branch 'origin/main' into pr/fix-11150
phryneas b392800
Merge branch 'main' into pr/fix-11150
phryneas dba00aa
add api-report
phryneas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my angular 14 projects, compilation fails at this point with the changes in the 3.8.1 patch. Is there a workaround or documentation so I can fix it?
`Error: node_modules/@apollo/client/cache/core/types/common.d.ts:52:110 - error TS1005: '?' expected.
52 type StoreObjectValueMaybeReference = StoreVal extends Array<infer Item extends Record<string, any>> ? ReadonlyArray<AsStoreObject | Reference> : StoreVal extends Record<string, any> ? AsStoreObject | Reference : StoreVal;
`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmoore9j what TypeScript version are you on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@phryneas currently its at ~4.6.4. Is there a recommended version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmoore9j Preferrably a recent one - TypeScript moves quite fast, and I would almost bet that you wouldn't have that problem with 5.1 or 5.2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The specific notion that's giving you problems here (
infer X extends Y
) seems to have been added with TS 4.8