Historically, RetryLink would keep a values array of all previous values, in case the operation would get an additional subscriber at a later point in time.
In practice, this could lead to a memory leak (#11393) and did not serve any further purpose, as the resulting observable would only be subscribed to by Apollo Client itself, and only once - it would be wrapped in a Concast before being exposed to the user, and that Concast would handle subscribers on its own.
Using canonizeResults can result in memory leaks so we generally do not recommend using this option anymore. A future version of Apollo Client will contain a similar feature without the risk of memory leaks.
#11254d08970d Thanks @benjamn! - Decouple canonicalStringify from ObjectCanon for better time and memory performance.
#11356cc4ac7e Thanks @phryneas! - Fix a potential memory leak in FragmentRegistry.transform and FragmentRegistry.findFragmentSpreads that would hold on to passed-in DocumentNodes for too long.
use LRU WeakCache instead of Map to keep a limited number of parsed results
cache is initiated lazily, only when needed
expose parse.resetCache() method
#11389139acd1 Thanks @phryneas! - documentTransform: use optimism and WeakCache instead of directly storing data on the Trie
#113587d939f8 Thanks @phryneas! - Fixes a potential memory leak in Concast that might have been triggered when Concast was used outside of Apollo Client.
#11344bd26676 Thanks @phryneas! - Add a resetCache method to DocumentTransform and hook InMemoryCache.addTypenameTransform up to InMemoryCache.gc
Historically, RetryLink would keep a values array of all previous values, in case the operation would get an additional subscriber at a later point in time.
In practice, this could lead to a memory leak (#11393) and did not serve any further purpose, as the resulting observable would only be subscribed to by Apollo Client itself, and only once - it would be wrapped in a Concast before being exposed to the user, and that Concast would handle subscribers on its own.
Using canonizeResults can result in memory leaks so we generally do not recommend using this option anymore. A future version of Apollo Client will contain a similar feature without the risk of memory leaks.
#11254d08970d Thanks @benjamn! - Decouple canonicalStringify from ObjectCanon for better time and memory performance.
#11356cc4ac7e Thanks @phryneas! - Fix a potential memory leak in FragmentRegistry.transform and FragmentRegistry.findFragmentSpreads that would hold on to passed-in DocumentNodes for too long.
use LRU WeakCache instead of Map to keep a limited number of parsed results
cache is initiated lazily, only when needed
expose parse.resetCache() method
#11389139acd1 Thanks @phryneas! - documentTransform: use optimism and WeakCache instead of directly storing data on the Trie
#113587d939f8 Thanks @phryneas! - Fixes a potential memory leak in Concast that might have been triggered when Concast was used outside of Apollo Client.
#11344bd26676 Thanks @phryneas! - Add a resetCache method to DocumentTransform and hook InMemoryCache.addTypenameTransform up to InMemoryCache.gc
Dependabot commands
You can trigger Dependabot actions by commenting on this MR
$dependabot recreate will recreate this MR rewriting all the manual changes and resolving conflicts
Bumps [@apollo/client](https://github.com/apollographql/apollo-client) from 3.8.10 to 3.9.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/apollographql/apollo-client/releases"><code>@apollo/client</code>'s releases</a>.</em></p>
<blockquote>
<h2>v3.9.0</h2>
<h3>Minor Changes</h3>
<h4>Memory optimizations</h4>
<ul>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11424">#11424</a> <a href="https://github.com/apollographql/apollo-client/commit/62f3b6d0e89611e27d9f29812ee60e5db5963fd6"><code>62f3b6d</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - Simplify RetryLink, fix potential memory leak</p>
<p>Historically, <code>RetryLink</code> would keep a <code>values</code> array of all previous values, in case the operation would get an additional subscriber at a later point in time.</p>
<p>In practice, this could lead to a memory leak (<a href="https://github.com/apollographql/apollo-client/pull/11393">#11393</a>) and did not serve any further purpose, as the resulting observable would only be subscribed to by Apollo Client itself, and only once - it would be wrapped in a <code>Concast</code> before being exposed to the user, and that <code>Concast</code> would handle subscribers on its own.</p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11435">#11435</a> <a href="https://github.com/apollographql/apollo-client/commit/5cce53e83b976f85d2d2b06e28cc38f01324fea1"><code>5cce53e</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - Deprecates <code>canonizeResults</code>.</p>
<p>Using <code>canonizeResults</code> can result in memory leaks so we generally do not recommend using this option anymore. A future version of Apollo Client will contain a similar feature without the risk of memory leaks.</p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11254">#11254</a> <a href="https://github.com/apollographql/apollo-client/commit/d08970d348cf4ad6d80c6baf85b4a4cd4034a3bb"><code>d08970d</code></a> Thanks <a href="https://github.com/benjamn"><code>@benjamn</code></a>! - Decouple <code>canonicalStringify</code> from <code>ObjectCanon</code> for better time and memory performance.</p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11356">#11356</a> <a href="https://github.com/apollographql/apollo-client/commit/cc4ac7e1917f046bcd177882727864eed40b910e"><code>cc4ac7e</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - Fix a potential memory leak in <code>FragmentRegistry.transform</code> and <code>FragmentRegistry.findFragmentSpreads</code> that would hold on to passed-in <code>DocumentNodes</code> for too long.</p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11370">#11370</a> <a href="https://github.com/apollographql/apollo-client/commit/25e2cb431c76ec5aa88202eaacbd98fad42edc7f"><code>25e2cb4</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - <code>parse</code> function: improve memory management</p>
<ul>
<li>use LRU <code>WeakCache</code> instead of <code>Map</code> to keep a limited number of parsed results</li>
<li>cache is initiated lazily, only when needed</li>
<li>expose <code>parse.resetCache()</code> method</li>
</ul>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11389">#11389</a> <a href="https://github.com/apollographql/apollo-client/commit/139acd1153afa1445b69dcb4e139668ab8c5889a"><code>139acd1</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - <code>documentTransform</code>: use <code>optimism</code> and <code>WeakCache</code> instead of directly storing data on the <code>Trie</code></p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11358">#11358</a> <a href="https://github.com/apollographql/apollo-client/commit/7d939f80fbc2c419c58a6c55b6a35ee7474d0379"><code>7d939f8</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - Fixes a potential memory leak in <code>Concast</code> that might have been triggered when <code>Concast</code> was used outside of Apollo Client.</p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11344">#11344</a> <a href="https://github.com/apollographql/apollo-client/commit/bd2667619700139af32a45364794d11f845ab6cf"><code>bd26676</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - Add a <code>resetCache</code> method to <code>DocumentTransform</code> and hook <code>InMemoryCache.addTypenameTransform</code> up to <code>InMemoryCache.gc</code></p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11367">#11367</a> <a href="https://github.com/apollographql/apollo-client/commit/30d17bfebe44dbfa7b78c8982cfeb49afd37129c"><code>30d17bf</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - <code>print</code>: use <code>WeakCache</code> instead of <code>WeakMap</code></p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11387">#11387</a> <a href="https://github.com/apollographql/apollo-client/commit/4dce8673b1757d8a3a4edd2996d780e86fad14e3"><code>4dce867</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - <code>QueryManager.transformCache</code>: use <code>WeakCache</code> instead of <code>WeakMap</code></p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11369">#11369</a> <a href="https://github.com/apollographql/apollo-client/commit/2a471646616e3af1b5c039e961f8d5717fad8f32"><code>2a47164</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - Persisted Query Link: improve memory management</p>
<ul>
<li>use LRU <code>WeakCache</code> instead of <code>WeakMap</code> to keep a limited number of hash results</li>
<li>hash cache is initiated lazily, only when needed</li>
<li>expose <code>persistedLink.resetHashCache()</code> method</li>
<li>reset hash cache if the upstream server reports it doesn't accept persisted queries</li>
</ul>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/10804">#10804</a> <a href="https://github.com/apollographql/apollo-client/commit/221dd99ffd1990f8bd0392543af35e9b08d0fed8"><code>221dd99</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - use WeakMap in React Native with Hermes</p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11355">#11355</a> <a href="https://github.com/apollographql/apollo-client/commit/7d8e18493cd13134726c6643cbf0fadb08be2d37"><code>7d8e184</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - InMemoryCache.gc now also triggers FragmentRegistry.resetCaches (if there is a FragmentRegistry)</p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11409">#11409</a> <a href="https://github.com/apollographql/apollo-client/commit/2e7203b3a9618952ddb522627ded7cceabd7f250"><code>2e7203b</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - Adds an experimental <code>ApolloClient.getMemoryInternals</code> helper</p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11343">#11343</a> <a href="https://github.com/apollographql/apollo-client/commit/776631de4500d56252f6f5fdaf29a81c41dfbdc7"><code>776631d</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - Add <code>reset</code> method to <code>print</code>, hook up to <code>InMemoryCache.gc</code></p>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/apollographql/apollo-client/blob/main/CHANGELOG.md"><code>@apollo/client</code>'s changelog</a>.</em></p>
<blockquote>
<h2>3.9.0</h2>
<h3>Minor Changes</h3>
<h4>Memory optimizations</h4>
<ul>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11424">#11424</a> <a href="https://github.com/apollographql/apollo-client/commit/62f3b6d0e89611e27d9f29812ee60e5db5963fd6"><code>62f3b6d</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - Simplify RetryLink, fix potential memory leak</p>
<p>Historically, <code>RetryLink</code> would keep a <code>values</code> array of all previous values, in case the operation would get an additional subscriber at a later point in time.</p>
<p>In practice, this could lead to a memory leak (<a href="https://github.com/apollographql/apollo-client/pull/11393">#11393</a>) and did not serve any further purpose, as the resulting observable would only be subscribed to by Apollo Client itself, and only once - it would be wrapped in a <code>Concast</code> before being exposed to the user, and that <code>Concast</code> would handle subscribers on its own.</p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11435">#11435</a> <a href="https://github.com/apollographql/apollo-client/commit/5cce53e83b976f85d2d2b06e28cc38f01324fea1"><code>5cce53e</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - Deprecates <code>canonizeResults</code>.</p>
<p>Using <code>canonizeResults</code> can result in memory leaks so we generally do not recommend using this option anymore. A future version of Apollo Client will contain a similar feature without the risk of memory leaks.</p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11254">#11254</a> <a href="https://github.com/apollographql/apollo-client/commit/d08970d348cf4ad6d80c6baf85b4a4cd4034a3bb"><code>d08970d</code></a> Thanks <a href="https://github.com/benjamn"><code>@benjamn</code></a>! - Decouple <code>canonicalStringify</code> from <code>ObjectCanon</code> for better time and memory performance.</p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11356">#11356</a> <a href="https://github.com/apollographql/apollo-client/commit/cc4ac7e1917f046bcd177882727864eed40b910e"><code>cc4ac7e</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - Fix a potential memory leak in <code>FragmentRegistry.transform</code> and <code>FragmentRegistry.findFragmentSpreads</code> that would hold on to passed-in <code>DocumentNodes</code> for too long.</p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11370">#11370</a> <a href="https://github.com/apollographql/apollo-client/commit/25e2cb431c76ec5aa88202eaacbd98fad42edc7f"><code>25e2cb4</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - <code>parse</code> function: improve memory management</p>
<ul>
<li>use LRU <code>WeakCache</code> instead of <code>Map</code> to keep a limited number of parsed results</li>
<li>cache is initiated lazily, only when needed</li>
<li>expose <code>parse.resetCache()</code> method</li>
</ul>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11389">#11389</a> <a href="https://github.com/apollographql/apollo-client/commit/139acd1153afa1445b69dcb4e139668ab8c5889a"><code>139acd1</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - <code>documentTransform</code>: use <code>optimism</code> and <code>WeakCache</code> instead of directly storing data on the <code>Trie</code></p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11358">#11358</a> <a href="https://github.com/apollographql/apollo-client/commit/7d939f80fbc2c419c58a6c55b6a35ee7474d0379"><code>7d939f8</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - Fixes a potential memory leak in <code>Concast</code> that might have been triggered when <code>Concast</code> was used outside of Apollo Client.</p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11344">#11344</a> <a href="https://github.com/apollographql/apollo-client/commit/bd2667619700139af32a45364794d11f845ab6cf"><code>bd26676</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - Add a <code>resetCache</code> method to <code>DocumentTransform</code> and hook <code>InMemoryCache.addTypenameTransform</code> up to <code>InMemoryCache.gc</code></p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11367">#11367</a> <a href="https://github.com/apollographql/apollo-client/commit/30d17bfebe44dbfa7b78c8982cfeb49afd37129c"><code>30d17bf</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - <code>print</code>: use <code>WeakCache</code> instead of <code>WeakMap</code></p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11387">#11387</a> <a href="https://github.com/apollographql/apollo-client/commit/4dce8673b1757d8a3a4edd2996d780e86fad14e3"><code>4dce867</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - <code>QueryManager.transformCache</code>: use <code>WeakCache</code> instead of <code>WeakMap</code></p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11369">#11369</a> <a href="https://github.com/apollographql/apollo-client/commit/2a471646616e3af1b5c039e961f8d5717fad8f32"><code>2a47164</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - Persisted Query Link: improve memory management</p>
<ul>
<li>use LRU <code>WeakCache</code> instead of <code>WeakMap</code> to keep a limited number of hash results</li>
<li>hash cache is initiated lazily, only when needed</li>
<li>expose <code>persistedLink.resetHashCache()</code> method</li>
<li>reset hash cache if the upstream server reports it doesn't accept persisted queries</li>
</ul>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/10804">#10804</a> <a href="https://github.com/apollographql/apollo-client/commit/221dd99ffd1990f8bd0392543af35e9b08d0fed8"><code>221dd99</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - use WeakMap in React Native with Hermes</p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11355">#11355</a> <a href="https://github.com/apollographql/apollo-client/commit/7d8e18493cd13134726c6643cbf0fadb08be2d37"><code>7d8e184</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - InMemoryCache.gc now also triggers FragmentRegistry.resetCaches (if there is a FragmentRegistry)</p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11409">#11409</a> <a href="https://github.com/apollographql/apollo-client/commit/2e7203b3a9618952ddb522627ded7cceabd7f250"><code>2e7203b</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - Adds an experimental <code>ApolloClient.getMemoryInternals</code> helper</p>
</li>
<li>
<p><a href="https://github.com/apollographql/apollo-client/pull/11343">#11343</a> <a href="https://github.com/apollographql/apollo-client/commit/776631de4500d56252f6f5fdaf29a81c41dfbdc7"><code>776631d</code></a> Thanks <a href="https://github.com/phryneas"><code>@phryneas</code></a>! - Add <code>reset</code> method to <code>print</code>, hook up to <code>InMemoryCache.gc</code></p>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/apollographql/apollo-client/commit/9f2ccdb9a4bfe03fa992e20e005415ee0d2eb487"><code>9f2ccdb</code></a> v3.9.0 (<a href="https://github.com/apollographql/apollo-client/issues/11540">#11540</a>)</li>
<li><a href="https://github.com/apollographql/apollo-client/commit/40685cf3e0da0f72698de9b9137b71ff68ad9188"><code>40685cf</code></a> chore: only attempt to create a version packages PR if still in prerelease mo...</li>
<li><a href="https://github.com/apollographql/apollo-client/commit/91dadd58c801a82268eccfe1c6df875844f2ff28"><code>91dadd5</code></a> Merge pull request <a href="https://github.com/apollographql/apollo-client/issues/11220">#11220</a> from apollographql/release-3.9</li>
<li><a href="https://github.com/apollographql/apollo-client/commit/2c836af2af6e5a623189d194cebda5ba01f9d115"><code>2c836af</code></a> Exit prerelease</li>
<li><a href="https://github.com/apollographql/apollo-client/commit/cae14755b06d759c9966892dff69031b2078b242"><code>cae1475</code></a> Merge remote-tracking branch 'origin/main' into release-3.9</li>
<li><a href="https://github.com/apollographql/apollo-client/commit/2ebb0c54a6c97e09f2d87fa8873dd0ca29d259ce"><code>2ebb0c5</code></a> Update getting started doc to use vite (<a href="https://github.com/apollographql/apollo-client/issues/11352">#11352</a>)</li>
<li><a href="https://github.com/apollographql/apollo-client/commit/68166a2ed312506d2f61f5d54b77e2893c1cf4b8"><code>68166a2</code></a> chore: use Node.js v20 in GitHub Actions workflows (<a href="https://github.com/apollographql/apollo-client/issues/11536">#11536</a>)</li>
<li><a href="https://github.com/apollographql/apollo-client/commit/3c119737f765494086496de3ef9e4b41b1acf4da"><code>3c11973</code></a> Update ROADMAP.md</li>
<li><a href="https://github.com/apollographql/apollo-client/commit/cd2a07c357394284755da16bff51e65eb366970b"><code>cd2a07c</code></a> chore(deps): update andstor/file-existence-action action to v3 (<a href="https://github.com/apollographql/apollo-client/issues/11535">#11535</a>)</li>
<li><a href="https://github.com/apollographql/apollo-client/commit/fca8c7b3865a5c829be7f796e77cc76e132dc315"><code>fca8c7b</code></a> chore(deps): update all dependencies - patch updates (<a href="https://github.com/apollographql/apollo-client/issues/11530">#11530</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/apollographql/apollo-client/compare/v3.8.10...v3.9.0">compare view</a></li>
</ul>
</details>
<br />
---
<details>
<summary>Dependabot commands</summary>
<br />
You can trigger Dependabot actions by commenting on this MR
- `$dependabot recreate` will recreate this MR rewriting all the manual changes and resolving conflicts
</details>
argoyle
(Migrated from gitlab.com)
merged commit into master2024-01-31 11:06:21 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Bumps @apollo/client from 3.8.10 to 3.9.0.
Release notes
Sourced from
@apollo/client's releases.... (truncated)
Changelog
Sourced from
@apollo/client's changelog.... (truncated)
Commits
9f2ccdbv3.9.0 (#11540)40685cfchore: only attempt to create a version packages PR if still in prerelease mo...91dadd5Merge pull request #11220 from apollographql/release-3.92c836afExit prereleasecae1475Merge remote-tracking branch 'origin/main' into release-3.92ebb0c5Update getting started doc to use vite (#11352)68166a2chore: use Node.js v20 in GitHub Actions workflows (#11536)3c11973Update ROADMAP.mdcd2a07cchore(deps): update andstor/file-existence-action action to v3 (#11535)fca8c7bchore(deps): update all dependencies - patch updates (#11530)Dependabot commands
You can trigger Dependabot actions by commenting on this MR
$dependabot recreatewill recreate this MR rewriting all the manual changes and resolving conflicts