Relay

91 posts

Relay banner
Relay

Relay

@RelayFramework

Relay is a framework for managing GraphQL data in React applications

加入时间 Eylül 2021
6 关注1K 粉丝
Relay
Relay@RelayFramework·
We’ve just released version 18.2.0 of Relay. This version includes compiler-driven codemods and expanded support for at-catch. github.com/facebook/relay…
English
0
6
35
1.9K
Relay
Relay@RelayFramework·
@jantimon What kinds of things?
English
0
0
0
57
Jan Nicklas
Jan Nicklas@jantimon·
@RelayFramework would it be possible to extend the compiler so it does some extra things during its watch mode?
English
1
0
0
78
Relay
Relay@RelayFramework·
The Relay compiler is gaining a new capability: codemods What GraphQL codemods would you like to see built into the Relay compiler? relay.dev/docs/next/guid…
English
4
8
31
2.2K
Relay
Relay@RelayFramework·
@StatisticsFTW Instead of trying to force discriminated unions, could you just use @alias on the inline fragments?
English
1
0
0
98
Robert Balicki (👀 @IsographLabs)
Rewriting all fragment spreads as aliased fragment spreads (dangerous or not); ensure that any field containing inline fragments that refine to a concrete type has only inline fragments that refine to a concrete type + each has a typename selection + no directives (i.e. enforce that a discriminated union is created) Those are top of mind for me. Anything else would (presumably) require knowledge of the JS. But if Relay gains that, then there's a lot!
English
1
0
4
234
Robert Balicki (👀 @IsographLabs)
The fragments that are used only in an event make me think that @RelayFramework has a missing primitive: the ability to defer a fragment and read it, without suspending, but instead to get a promise that resolves with the deferred fragment's value.
Robert Balicki (👀 @IsographLabs)@StatisticsFTW

@graphql Fragments used unconditionally and fetched unconditionally: 30 🙁 Fragments that maybe don't need to be fetched, if we had 3D: 6 😒 Fragments fetched unconditionally, but used conditionally (behind a prop, other field's nullability, or experiment): 28!! 😲 Fragments used only in an event or callback: 11 😭 Fragments that are only used by UI that isn't initially rendered, thus are good candidates for entrypoints: 6 That's... 37% of fragments that are always needed for the initial render. In practice, many of the 28 that are fetched unconditionally, but used conditionally, will be needed for any given render. So, I'm being a bit pessimistic here. But nonetheless, quite instructive!

English
1
1
4
3K
Relay
Relay@RelayFramework·
We recently added an experimental API to enable exactly this: defer data that you only access within an event handler. waitForFragmentData: relay.dev/docs/next/api-…
Robert Balicki (👀 @IsographLabs)@StatisticsFTW

The fragments that are used only in an event make me think that @RelayFramework has a missing primitive: the ability to defer a fragment and read it, without suspending, but instead to get a promise that resolves with the deferred fragment's value.

English
1
5
12
2.1K
Relay
Relay@RelayFramework·
@hd_nvim @StatisticsFTW @defer Notably useLazyLoadQuery will suspend until the data is available, which is not what you want for reading data that is only needed within an event handler.
English
0
0
1
58
Relay
Relay@RelayFramework·
@hd_nvim @StatisticsFTW This lets you include the data you want as part of the parent query so it’s either already loaded or on its way when you try to load it. But it also lets you use @defer so that the rest of the data in the query will not wait on data only needed in an event handler.
English
2
1
2
195
Relay 已转推
Michael Staib
Michael Staib@michael_staib·
The Relay #GraphQL connection specification explained! Have a look at the recording, It explains really well why meta designed this fundamental GraphQL pattern the way they did. graphql.org/conf/2024/sche…
English
0
3
6
593
Relay 已转推
Jordan Eldredge
Jordan Eldredge@captbaritone·
The “Data collocation” enabled by Relay (and now RSC) is really about composability. Without colocated data dependencies your components are tightly coupled to a parent query. With collocation your components snap into (and out of!) place like LEGO bricks letting you move fast.
English
2
9
29
2.6K
Relay 已转推
Jordan Eldredge
Jordan Eldredge@captbaritone·
Relay 18 is out and I’m really excited about the powerful new new capabilities it enables, so I wanted to share them in a thread! 1/9👇
Jordan Eldredge tweet media
English
3
20
74
8.4K
Relay
Relay@RelayFramework·
Huge thanks to @tobiastengler and other contributors who made this release possible.
English
0
2
8
940
Relay
Relay@RelayFramework·
Relay v16.2.0 has been released. It includes support for the new @preloadable directive and also contains a minor breaking change to the configuration. You can find more information in the release notes here: github.com/facebook/relay…
English
1
11
33
6.2K
Relay
Relay@RelayFramework·
New Relay blog post articulating how Relay’s approach to application authorship enables a unique combination of optimal runtime performance and application maintainability. relay.dev/blog/2023/10/2… by @captbaritone
English
0
17
45
7.8K
Relay
Relay@RelayFramework·
We now have a Threads account: @relayframework" target="_blank" rel="nofollow noopener">threads.net/@relayframework. Follow us for updates and stay tuned for more!
English
0
1
7
608