This repository was archived by the owner on Sep 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
Fix opaque types #139
Merged
Merged
Fix opaque types #139
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a53b116
fix opaque types using string literals
ds300 b892ceb
fix ref type name
ds300 0d60f87
fix type emission
ds300 30e7957
undo nullability of fragment refs
ds300 bab723d
bring example app up to date
ds300 84e6565
update snapshots
ds300 084745b
remove relay-devtools and @types/node patch
ds300 bfda71e
move FragmentRefs out to @types/relay-runtime
ds300 4244987
delete commented-out code
ds300 ea55246
update snapshot
ds300 2bf3ef7
update @types/relay-runtime version constraint
ds300 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,3 +63,7 @@ typings/ | |
/bin | ||
|
||
.npmrc | ||
|
||
# Build artifacts | ||
.yalc | ||
yalc.lock |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
__snapshots__/ | ||
fixtures/ | ||
fixtures/ | ||
example/ts/__relay_artifacts |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
diff --git a/node_modules/@types/relay-runtime/index.d.ts b/node_modules/@types/relay-runtime/index.d.ts | ||
index 18ff05e..1ab09b6 100644 | ||
--- a/node_modules/@types/relay-runtime/index.d.ts | ||
+++ b/node_modules/@types/relay-runtime/index.d.ts | ||
@@ -193,12 +193,20 @@ export { createRelayNetworkLogger } from './lib/network/createRelayNetworkLogger | ||
export { deepFreeze } from './lib/util/deepFreeze'; | ||
|
||
// These match the output of relay-compiler-language-typescript. | ||
-export interface _RefType<T> { | ||
- ' $refType': T; | ||
+export interface _RefType<T extends string> { | ||
+ " $refType": T; | ||
} | ||
-export interface _FragmentRefs<T> { | ||
- ' $fragmentRefs': T; | ||
+ | ||
+export type FragmentRefs<Refs extends string> = { | ||
+ [ref in Refs]: true | ||
+} | ||
+ | ||
+export interface _FragmentRefs<Refs extends string> { | ||
+ " $fragmentRefs": FragmentRefs<Refs> | ||
} | ||
|
||
// This is a utility type for converting from a data type to a fragment reference that will resolve to that data type. | ||
-export type FragmentRef<T> = T extends _RefType<infer U> ? _FragmentRefs<U> : never; | ||
+export type FragmentRef<T> = T extends _RefType<infer U> | ||
+ ? _FragmentRefs<U> | ||
+ : never; | ||
+ |
This file contains hidden or 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 hidden or 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.
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.
They ran out of spuds!