Rename useConnection to useShowMorePagination#44703
Conversation
Bundle size report 📦
Look at the Statoscope report for a full comparison between the commits 03d4fa4 and 5473007 or learn more. Open explanation
|
826ebae to
b4b7d0e
Compare
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 5473007...03d4fa4.
|
|
Another option could be to rename |
|
I like that but I’m not sure if pagination alone clear enough (we've discussed this with @felixfbecker in the Slack thread). |
There was a problem hiding this comment.
@philipp-spiess, what do you think about renaming this interface too?
|
I'm still not sure about the naming. |
98b5d12 to
399b2ff
Compare
|
@taras-yemets Why is the word
In both cases you'd get a 'next page' function (
I think |
|
@philipp-spiess, I don't have name suggestions I'm confident in that seem more suitable than the ones shared by folks in this PR and in the referenced thread. |
|
@philipp-spiess I'm not intimately familiar with the pagination effort, just saw this PR and was interested. I skimmed through the Slack convo and the related tracking issue, and other PRs, that's pretty much all the context I have. So just leaving my two cents here: As far as I know, the term "connection" comes from the "GraphQL Cursor Connections" (I'll call it GCC in this message) standard: https://relay.dev/graphql/connections.htm I understand @thenamankumar is working on back-end changes that improve our pagination. But I'm unsure: does it also mean that we're moving off the GCC standard? a.) If yes, then renaming the hook to something like Again, just my two cents, I think this rename can't hurt in any case, as it's very easy to change it later. |
|
Thanks @vdavid!
No! The work that we're doing is to extend upon the GraphQL connection interface and add a helper in Go that makes it easier to: 1) uses proper cursors (the current patterns all show lead to We still expect the GraphQL APIs to implement the Connection type.
That is fair but I wonder how much additional value the knowledge that a hook uses an underlying GraphQL connection really brings: When adding a new usage of the hook, the types already make it clear that this is the required backend structure and when reading the code I feel like this term has just become a synonym for pagination in our codebase. |
|
Given that we expect this to exist (for at least some period of time) in combination with the new We can provide more context/detail about the relevant implementation details (e.g. the use of a "connection") as needed/desired in the JSDoc comments for the hooks (and, like you mentioned @philipp-spiess, the type system also helps us describe this). |
9c28dec to
03d4fa4
Compare
|
Thank you all for your feedback! I’m still not sure about the |
Part of https://github.com/sourcegraph/sourcegraph/issues/44706
From Slack:
This is the first step to my plan: Rename existing
useConnectionusages. @felixfbecker proposed the nameuseShowMorePaginationwhich I find quite fitting. @quinnkeast suggesteduseInfinitePaginationwhich would also work. Does anyone feel strongly about the name?Test plan
This is just a large string replace, I’m relying on our tests to break if things are broken.
App preview:
Check out the client app preview documentation to learn more.