apollographql / apollo-client-nextjs

Apollo Client support for the Next.js App Router
https://www.npmjs.com/package/@apollo/experimental-nextjs-app-support
MIT License
352 stars 25 forks source link

0.9.0 (7) - Changes to Data Transport #223

Closed phryneas closed 1 month ago

phryneas commented 1 month ago

As I don't want to change the shape of the DataTransportAbstraction immediately after we released it for the first time, this one would also need to go into 0.9.0.

This switches from two very separate "request started" and "request finished" events to a stream of events with a shared identifier between queries.

This has the benefit that in the future we can easily track which events are still "unhandled", e.g. for keeping the connection open for longer.

Also, for the first time we detect & communicate errors that happened in SSR to the browser, to restart queries there immediately.

As a positive side-effect of having a "query identifier", the query document is sent only once, not twice over. That already plays a bit into #210. (Technically, it's sent one more time per hook, so we're down from three times to two).

phryneas commented 1 month ago

I think this is ready for review now :)

relativeci[bot] commented 1 month ago

Job #14: Bundle Size — 1MiB (+0.76%).

37a3647(current) vs f823d31 main#11(baseline)

[!WARNING] Bundle contains 1 duplicate package – View duplicate packages

[!WARNING] Bundle introduced one new package: react-error-boundary – View changed packages

Bundle metrics  Change 7 changes Regression 3 regressions
                 Current
Job #14
     Baseline
Job #11
Regression  Initial JS 889.61KiB(+0.36%) 886.43KiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 53.39% 5.35%
Change  Chunks 24(+4.35%) 23
Change  Assets 45(+4.65%) 43
Change  Modules 511(+0.59%) 508
No change  Duplicate Modules 30 30
Regression  Duplicate Code 1.3%(+2.36%) 1.27%
Regression  Packages 29(+3.57%) 28
No change  Duplicate Packages 1 1

Bundle size by type  Change 2 changes Regression 2 regressions
|            |       Current
[Job #14](https://app.relative-ci.com/projects/fukE5WxC5RnzLcZncFJw/jobs/14-oaAos7ASBLkBnvAQPFYG?utm_source=github&utm_medium=pr-report "View job report") |      Baseline
[Job #11](https://app.relative-ci.com/projects/fukE5WxC5RnzLcZncFJw/jobs/11-gI8wlrT2NpsGTXoI6EuD?utm_source=github&utm_medium=pr-report "View baseline job report") | |:--|--:|--:| | Regression  [JS](https://app.relative-ci.com/projects/fukE5WxC5RnzLcZncFJw/jobs/14-oaAos7ASBLkBnvAQPFYG/assets?ba=%7B%22filters%22%3A%22ft.CSS-0_ft.JS-1_ft.IMG-0_ft.MEDIA-0_ft.FONT-0_ft.HTML-0_ft.OTHER-0%22%7D "View JS assets") | `1022.87KiB` (`+0.73%`) | `1015.48KiB` | | Regression  [Other](https://app.relative-ci.com/projects/fukE5WxC5RnzLcZncFJw/jobs/14-oaAos7ASBLkBnvAQPFYG/assets?ba=%7B%22filters%22%3A%22ft.CSS-0_ft.JS-0_ft.IMG-0_ft.MEDIA-0_ft.FONT-0_ft.HTML-0_ft.OTHER-1%22%7D "View Other assets") | `5.99KiB` (`+7.22%`) | `5.59KiB` |

View job #14 reportView pr/adjust-datatransport branch activityView project dashboard