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

lazily load SimulatePreloadedQuery #345

Merged
merged 9 commits into from
Sep 2, 2024

Conversation

phryneas
Copy link
Member

@phryneas phryneas commented Aug 19, 2024

This might be a solution for #341

Copy link

netlify bot commented Aug 19, 2024

Deploy Preview for apollo-client-nextjs-docmodel ready!

Name Link
🔨 Latest commit b58bdf7
🔍 Latest deploy log https://app.netlify.com/sites/apollo-client-nextjs-docmodel/deploys/66d176375f366a00087dcf49
😎 Deploy Preview https://deploy-preview-345--apollo-client-nextjs-docmodel.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@phryneas
Copy link
Member Author

/release:pr

Copy link

github-actions bot commented Aug 19, 2024

size-limit report 📦

Path Size
{ ApolloNextAppProvider, ApolloClient, InMemoryCache } from '@apollo/experimental-nextjs-app-support' (Browser ESM) 4.81 KB (0%)
{ WrapApolloProvider, ApolloClient, InMemoryCache } from '@apollo/client-react-streaming' (Browser ESM) 1.7 KB (0%)
{ buildManualDataTransport } from '@apollo/client-react-streaming/manual-transport' (Browser ESM) 2.87 KB (0%)
@apollo/client-react-streaming (Browser ESM) 2.41 KB (0%)
@apollo/client-react-streaming (SSR ESM) 7.25 KB (0%)
@apollo/client-react-streaming (RSC ESM) 7.07 KB (+10.84% 🔺)
@apollo/client-react-streaming/manual-transport (Browser ESM) 3.08 KB (0%)
@apollo/client-react-streaming/manual-transport (SSR ESM) 8.2 KB (0%)
@apollo/experimental-nextjs-app-support (Browser ESM) 5.39 KB (0%)
@apollo/experimental-nextjs-app-support (SSR ESM) 10.58 KB (0%)
@apollo/experimental-nextjs-app-support (RSC ESM) 7.13 KB (+10.65% 🔺)
@apollo/experimental-nextjs-app-support/rsc (RSC ESM) 6.38 KB (+12.19% 🔺)

Copy link

A new release has been made for this PR. You can install the package you need using one of

  • npm i @apollo/experimental-nextjs-app-support@0.0.0-commit-release.0.1724054066.da4c6f8
  • npm i @apollo/client-react-streaming@0.0.0-commit-release.0.1724054066.da4c6f8

@phryneas
Copy link
Member Author

Version da4c6f8 here reduces the immediately shipped addition to the client bundle to

    4678: function (e, t, n) {
      n.d(t, {
        SimulatePreloadedQuery: function () {
          return o;
        },
      });
      var r,
        i = n(2265);
      function o(e) {
        let { options: t, result: o, children: l, queryKey: a } = e;
        return (
          r ||
            (r = i.lazy(() =>
              n
                .e(997)
                .then(n.bind(n, 997))
                .then((e) => ({ default: e.SimulatePreloadedQuery }))
            )),
          i.createElement(r, { options: t, result: o, queryKey: a }, l)
        );
      }
    },

@phryneas
Copy link
Member Author

/release:pr

Copy link

A new release has been made for this PR. You can install the package you need using one of

  • npm i @apollo/experimental-nextjs-app-support@0.0.0-commit-release.0.1724056645.812b3ef
  • npm i @apollo/client-react-streaming@0.0.0-commit-release.0.1724056645.812b3ef

@phryneas
Copy link
Member Author

/release:pr

Copy link

relativeci bot commented Aug 19, 2024

#255 Bundle Size — 1.1MiB (-0.94%).

b58bdf7(current) vs cee4e66 main#253(baseline)

Warning

Bundle contains 1 duplicate package – View duplicate packages

Bundle metrics  Change 7 changes Improvement 2 improvements
                 Current
#255
     Baseline
#253
Improvement  Initial JS 923.89KiB(-1.78%) 940.58KiB
No change  Initial CSS 70B 70B
Change  Cache Invalidation 59.24% 0.03%
Change  Chunks 33(+3.13%) 32
Change  Assets 57(+1.79%) 56
Change  Modules 588(-1.84%) 599
Improvement  Duplicate Modules 99(-10.81%) 111
Change  Duplicate Code 6.23%(-17.81%) 7.58%
No change  Packages 26 26
No change  Duplicate Packages 1 1
Bundle size by type  Change 2 changes Regression 1 regression Improvement 1 improvement
                 Current
#255
     Baseline
#253
Improvement  JS 1.09MiB (-0.95%) 1.1MiB
Regression  Other 8.78KiB (+0.62%) 8.73KiB
No change  CSS 70B 70B

Bundle analysis reportBranch pr/lazy-load-SimulatePreloadedQu...Project dashboard


Generated by RelativeCIDocumentationReport issue

Copy link

A new release has been made for this PR. You can install the package you need using one of

  • npm i @apollo/experimental-nextjs-app-support@0.0.0-commit-release.0.1724057095.215fb1d
  • npm i @apollo/client-react-streaming@0.0.0-commit-release.0.1724057095.215fb1d

@phryneas
Copy link
Member Author

/release:pr

Copy link

A new release has been made for this PR. You can install the package you need using one of

  • npm i @apollo/experimental-nextjs-app-support@0.0.0-commit-release.0.1724057834.81b5532
  • npm i @apollo/client-react-streaming@0.0.0-commit-release.0.1724057834.81b5532

@phryneas
Copy link
Member Author

phryneas commented Aug 19, 2024

Yeah... down to

4678: function (e, t, n) {
      n.d(t, {
        SimulatePreloadedQuery: function () {
          return r;
        },
      });
      var r = n(2265).lazy(() => n.e(997).then(n.bind(n, 997)));
    },

❌ this one errored

@phryneas
Copy link
Member Author

/release:pr

Copy link

A new release has been made for this PR. You can install the package you need using one of

  • npm i @apollo/experimental-nextjs-app-support@0.0.0-commit-release.0.1724059607.3b1a1ef
  • npm i @apollo/client-react-streaming@0.0.0-commit-release.0.1724059607.3b1a1ef

@phryneas
Copy link
Member Author

This version now is

4678: function (e, t, n) {
      n.d(t, {
        SimulatePreloadedQuery: function () {
          return o;
        },
      });
      var r,
        i = n(2265),
        o = (e) => (
          r || (r = i.lazy(() => n.e(997).then(n.bind(n, 997)))),
          i.createElement(r, { ...e })
        );
    },

@phryneas phryneas requested a review from a team as a code owner August 30, 2024 07:35
@phryneas
Copy link
Member Author

I'm good to go with this one now, @alessbell and @jerelmiller, could one of you please take a look and give this a quick review?

@phryneas phryneas changed the title experiment: lazily load SimulatePreloadedQuery lazily load SimulatePreloadedQuery Sep 2, 2024
@phryneas phryneas merged commit 5a46eff into main Sep 2, 2024
19 checks passed
@phryneas phryneas deleted the pr/lazy-load-SimulatePreloadedQuery branch September 2, 2024 10:10
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