Skip to content
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

feat(core): Reimplement fetch source as async generator #3043

Merged
merged 31 commits into from
Mar 15, 2023

Conversation

kitten
Copy link
Member

@kitten kitten commented Mar 14, 2023

Summary

This builds on fix/node-memory-leak-fetch-source to finally reimplement the fetch source implementation as an async generator, wrapped in a fromAsyncIterable conversion from wonka.

This also simplifies some of the existing logic, as per how meros works, and how Incremental Delivery is defined. For instance, we now assume that each chunk is a JSON blob instead of checking headers, which we aren't using or merging anyway.

6.06kB -> 5.89 kB min+gzip

Set of changes

  • Reimplement makeFetchSource with async generator
  • Remove headers regex check

Instead of the chunking now being deterministic of
how many results to issue, `incremental` is now an
array, which means we can flush results as fast as
possible.
This couldn't really have realistically worked anyway, since a
3xx response to a GraphQL request is out-of-spec.
@kitten kitten force-pushed the feat/fetch-source-refactor branch from 72ca2fc to 8a39fd6 Compare March 14, 2023 17:15
@kitten kitten force-pushed the feat/fetch-source-refactor branch from 8a39fd6 to a1ddb49 Compare March 14, 2023 17:25
@kitten kitten force-pushed the feat/fetch-source-refactor branch from 060153a to e109114 Compare March 14, 2023 17:43
@kitten kitten force-pushed the feat/fetch-source-refactor branch from 45f38f1 to 8ce67c3 Compare March 14, 2023 18:27
@kitten kitten force-pushed the feat/fetch-source-refactor branch 2 times, most recently from 7924a49 to bc8b587 Compare March 14, 2023 18:44
@kitten kitten force-pushed the feat/fetch-source-refactor branch from 4cd3e31 to eedc540 Compare March 14, 2023 18:48
@kitten kitten merged commit 81cf542 into main Mar 15, 2023
@kitten kitten deleted the feat/fetch-source-refactor branch March 15, 2023 11:00
@github-actions github-actions bot mentioned this pull request Mar 15, 2023
@github-actions github-actions bot mentioned this pull request Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants