<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <id>https://dataclient.io/es/blog</id>
    <title>Data Client Blog</title>
    <updated>2026-11-18T00:00:00.000Z</updated>
    <generator>https://github.com/jpmonette/feed</generator>
    <link rel="alternate" href="https://dataclient.io/es/blog"/>
    <subtitle>Data Client Blog</subtitle>
    <entry>
        <title type="html"><![CDATA[v0.19: Controller.set() por lotes, TypeScript más rápido]]></title>
        <id>https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set</id>
        <link href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set"/>
        <updated>2026-11-18T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Escribe muchas entidades en una sola actualización del store con Controller.set([Entity], rows), y verifica los tipos del código de endpoints unas 2x más rápido]]></summary>
        <content type="html"><![CDATA[<p>v0.19 permite que un <a class="" href="https://dataclient.io/es/docs/concepts/managers">Manager</a> escriba un lote completo de filas transmitidas en una sola actualización del store, comprueba los tipos
del código de endpoints cerca de 2 veces más rápido y corrige una tanda de problemas de TypeScript y Vue.</p>
<p><strong><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#batch-set">Controller.set() por lotes</a></strong> escribe un flujo completo de filas, como los precios de un ticker que llegan por un websocket, en una sola
actualización del store con <code>ctrl.set([Ticker], rows)</code>. Eso es <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#batch-set-performance">hasta 95 veces más rápido</a> que un <code>set()</code> por fila.</p>
<p>Prueba ambos botones a continuación. Esta comprobación en el navegador parte de un store vacío y mide el tiempo de un <code>Promise.all</code> de 500 llamadas a <code>set()</code>
frente a un único <code>set()</code> por lotes. Ambos caminos son un solo commit de React, y cada uno escribe 500 precios nuevos.</p>
<div data-playground="true" class="playgroundQueryContainer_vBqa"><div class="playgroundContainer_sLUA row_YGZs" data-store-host="true"><div class="playgroundTextEdit_rt2K"><div class="playgroundHeader_Zx4K noupper_WDCF tabControls_trxh"><div class="tabs_m54V" role="tablist" aria-orientation="horizontal" aria-label="Archivos"><div role="tab" aria-selected="false" tabindex="-1" class="tab_bTGw">Ticker</div><div role="tab" aria-selected="false" tabindex="-1" class="tab_bTGw">Timing</div><div role="tab" aria-selected="false" tabindex="-1" class="tab_bTGw">PriceHeader</div><div role="tab" aria-selected="true" tabindex="0" class="tab_bTGw selected_QXZk">PriceStream</div></div></div><div class="editorDocs_INVk"><div class="playgroundEditor_lYwu hidden_Hh8i"></div><div class="playgroundEditor_lYwu hidden_Hh8i"></div><div class="playgroundEditor_lYwu hidden_Hh8i"></div><div class="playgroundEditor_lYwu"><div><pre class="prism-code language-tsx" style="margin:0;outline:none;padding:10px;font-family:inherit;color:#bfc7d5;background-color:transparent" spellcheck="false"><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token punctuation" style="color:#c792ea">{ </span>useController <span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'@data-client/react'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token punctuation" style="color:#c792ea">{ </span><span class="token class-name" style="color:#ffcb6b">Ticker</span><span class="token punctuation" style="color:#c792ea">, </span>newPrices <span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'./Ticker'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token punctuation" style="color:#c792ea">{ </span>useTimed<span class="token punctuation" style="color:#c792ea">, </span><span class="token class-name" style="color:#ffcb6b">Timing </span><span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'./Timing'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token class-name" style="color:#ffcb6b">PriceHeader </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'./PriceHeader'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">
</span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">function </span><span class="token class-name" style="color:#ffcb6b">PriceStream</span><span class="token punctuation" style="color:#c792ea">() {
</span></span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">const </span>ctrl <span class="token punctuation" style="color:#c792ea">= </span>useController<span class="token punctuation" style="color:#c792ea">();
</span></span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">const </span><span class="token punctuation" style="color:#c792ea">[</span>perRowMs<span class="token punctuation" style="color:#c792ea">, </span>perRow<span class="token punctuation" style="color:#c792ea">] = </span>useTimed<span class="token punctuation" style="color:#c792ea">(</span>newPrices<span class="token punctuation" style="color:#c792ea">, </span>rows <span class="token punctuation" style="color:#c792ea">=&gt;
</span></span><span class="token-line">    <span class="token class-name" style="color:#ffcb6b">Promise</span><span class="token punctuation" style="color:#c792ea">.</span>all<span class="token punctuation" style="color:#c792ea">(
</span></span><span class="token-line">      rows<span class="token punctuation" style="color:#c792ea">.</span>map<span class="token punctuation" style="color:#c792ea">(</span>row <span class="token punctuation" style="color:#c792ea">=&gt; </span>ctrl<span class="token punctuation" style="color:#c792ea">.</span><span class="token keyword" style="color:#7da4f6;font-style:italic">set</span><span class="token punctuation" style="color:#c792ea">(</span><span class="token class-name" style="color:#ffcb6b">Ticker</span><span class="token punctuation" style="color:#c792ea">, { </span>product_id<span class="token punctuation" style="color:#c792ea">: </span>row<span class="token punctuation" style="color:#c792ea">.</span>product_id <span class="token punctuation" style="color:#c792ea">}, </span>row<span class="token punctuation" style="color:#c792ea">)),
</span></span><span class="token-line">    <span class="token punctuation" style="color:#c792ea">),
</span></span><span class="token-line">  <span class="token punctuation" style="color:#c792ea">);
</span></span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">const </span><span class="token punctuation" style="color:#c792ea">[</span>batchMs<span class="token punctuation" style="color:#c792ea">, </span>batch<span class="token punctuation" style="color:#c792ea">] = </span>useTimed<span class="token punctuation" style="color:#c792ea">(</span>newPrices<span class="token punctuation" style="color:#c792ea">, </span>rows <span class="token punctuation" style="color:#c792ea">=&gt;
</span></span><span class="token-line">    ctrl<span class="token punctuation" style="color:#c792ea">.</span><span class="token keyword" style="color:#7da4f6;font-style:italic">set</span><span class="token punctuation" style="color:#c792ea">([</span><span class="token class-name" style="color:#ffcb6b">Ticker</span><span class="token punctuation" style="color:#c792ea">], </span>rows<span class="token punctuation" style="color:#c792ea">),
</span></span><span class="token-line">  <span class="token punctuation" style="color:#c792ea">);
</span></span><span class="token-line">
</span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">return </span><span class="token punctuation" style="color:#c792ea">(
</span></span><span class="token-line">    &lt;&gt;
</span><span class="token-line">      <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token class-name" style="color:#ffcb6b">PriceHeader </span>/&gt;
</span><span class="token-line">      <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token tag" style="color:#ff5590">dl </span><span class="token attr-name" style="color:#ffcb6b">className</span><span class="token punctuation" style="color:#c792ea">=</span><span class="token string" style="color:#b6d986">"stats"</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">        <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token class-name" style="color:#ffcb6b">Timing label</span><span class="token punctuation" style="color:#c792ea">=</span><span class="token string" style="color:#b6d986">"500 set() calls" </span><span class="token attr-name" style="color:#ffcb6b">ms</span><span class="token punctuation" style="color:#c792ea">={</span>perRowMs<span class="token punctuation" style="color:#c792ea">} </span>/&gt;
</span><span class="token-line">        <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token class-name" style="color:#ffcb6b">Timing label</span><span class="token punctuation" style="color:#c792ea">=</span><span class="token string" style="color:#b6d986">"1 batch set()" </span><span class="token attr-name" style="color:#ffcb6b">ms</span><span class="token punctuation" style="color:#c792ea">={</span>batchMs<span class="token punctuation" style="color:#c792ea">} </span>/&gt;
</span><span class="token-line">      <span class="token punctuation" style="color:#c792ea">&lt;/</span><span class="token tag" style="color:#ff5590">dl</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">      <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token tag" style="color:#ff5590">div </span><span class="token attr-name" style="color:#ffcb6b">className</span><span class="token punctuation" style="color:#c792ea">=</span><span class="token string" style="color:#b6d986">"buttonGroup"</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">        <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token tag" style="color:#ff5590">button </span><span class="token attr-name" style="color:#ffcb6b">onClick</span><span class="token punctuation" style="color:#c792ea">={</span>perRow<span class="token punctuation" style="color:#c792ea">}&gt;</span>set<span class="token punctuation" style="color:#c792ea">() </span>per row<span class="token punctuation" style="color:#c792ea">&lt;/</span><span class="token tag" style="color:#ff5590">button</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">        <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token tag" style="color:#ff5590">button </span><span class="token attr-name" style="color:#ffcb6b">onClick</span><span class="token punctuation" style="color:#c792ea">={</span>batch<span class="token punctuation" style="color:#c792ea">}&gt;</span>batch set<span class="token punctuation" style="color:#c792ea">()&lt;/</span><span class="token tag" style="color:#ff5590">button</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">      <span class="token punctuation" style="color:#c792ea">&lt;/</span><span class="token tag" style="color:#ff5590">div</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">    &lt;/&gt;
</span><span class="token-line">  <span class="token punctuation" style="color:#c792ea">);
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">}
</span></span><span class="token-line">render<span class="token punctuation" style="color:#c792ea">(&lt;</span><span class="token class-name" style="color:#ffcb6b">PriceStream </span>/&gt;<span class="token punctuation" style="color:#c792ea">);
</span></span></pre></div></div></div></div><div class="previewWrapper_edd2 wide-embed-part"><div class="playgroundHeader_Zx4K previewHeader_MW_M"><span class="liveLabel_MHnJ"><span class="liveLabelText_k6qc">Vista previa en vivo</span></span><span class="routerSlot_CTii"></span><span class="previewControls_oxCt"><button type="button" class="clean-btn headerButton_h2KM resetButton_knTA" title="Reiniciar la vista previa" aria-label="Reiniciar la vista previa" disabled=""><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 12a9 9 0 1 0 2.64-6.36L3 8.3"></path><path d="M3 3v5.3h5.3"></path></svg></button></span></div><div class="playgroundResult_tefG"><div class="playground-preview playgroundPreview_rk9R"><div class="sheet_FVCk sheet" aria-busy="true"><div class="skeletonPage" role="status" aria-label="Loading"><span class="skeleton"></span><span class="skeleton"></span><span class="skeleton"></span><span class="skeleton"></span></div></div></div><div class="quickLookHost_EhLO stageHues_MizR"></div></div></div><div id="_R_1g2qllq9_" class="storeHost_N0SU"><div class="storeDrawer_Jaf2"><div class="drawerTabs_MT7c" role="tablist" aria-orientation="vertical"><button type="button" role="tab" class="clean-btn storeTab_EY4O" title="Mostrar acciones" aria-label="Acciones" aria-selected="false" tabindex="-1" aria-controls="_R_1g2qllq9_" data-store-toggle="actions"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13 12h8M13 18h8M13 6h8M3 12h1M3 18h1M3 6h1M8 12h1M8 18h1M8 6h1"></path></svg></button><button type="button" role="tab" class="clean-btn storeTab_EY4O" title="Mostrar el store" aria-label="Store" aria-selected="false" tabindex="0" aria-controls="_R_1g2qllq9_" data-store-toggle="store"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><ellipse cx="12" cy="5" rx="8" ry="3"></ellipse><path d="M4 5v14c0 1.66 3.58 3 8 3s8-1.34 8-3V5"></path><path d="M4 12c0 1.66 3.58 3 8 3s8-1.34 8-3"></path></svg></button></div></div></div></div></div>
<figure class="perfChart_LYCy"><figcaption class="text--center text--bold margin-bottom--sm">setMany de Node en un store de 500 entidades</figcaption><div class="bars_HVEW" style="--perf-one:1.0485436893203883%"><div class="row_OlYf" aria-hidden="true"><span></span><span class="oneLabel_y_xM">1x</span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">50 rows</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:20.97087378640777%;--perf-split:5%"></span></span><span class="text--bold">20x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">One set() per row<!-- --> <!-- -->10.8<!-- --> <!-- -->ms<!-- --> → <!-- -->set([Ticker], rows)<!-- --> <strong>0.54<!-- --> <!-- -->ms</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">500 rows</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:100%;--perf-split:1.0485436893203883%"></span></span><span class="text--bold">95x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">One set() per row<!-- --> <!-- -->103<!-- --> <!-- -->ms<!-- --> → <!-- -->set([Ticker], rows)<!-- --> <strong>1.08<!-- --> <!-- -->ms</strong></span></span></div></div></figure>
<p><strong><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#faster-types">TypeScript más rápido</a></strong>: los editores y <code>tsc</code> comprueban el código de <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint">RestEndpoint</a> y
<a class="" href="https://dataclient.io/es/rest/api/resource">resource()</a> cerca de 2 veces más rápido y con un 40% menos de memoria, y siguen reportando todos los errores que reportaban
antes.</p>
<figure class="perfChart_LYCy"><figcaption class="text--center text--bold margin-bottom--sm">Comprobación de 150 RestEndpoints con rutas largas</figcaption><div class="bars_HVEW" style="--perf-one:41.66666666666667%"><div class="row_OlYf" aria-hidden="true"><span></span><span class="oneLabel_y_xM">1x</span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">TypeScript 6</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:80.5976430976431%;--perf-split:51.69712793733681%"></span></span><span class="text--bold">1.9x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">v0.18<!-- --> <!-- -->3.83<!-- --> <!-- -->s<!-- --> → <!-- -->v0.19<!-- --> <strong>1.98<!-- --> <!-- -->s</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">TypeScript 7</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:90.57971014492755%;--perf-split:45.99999999999999%"></span></span><span class="text--bold">2.2x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">v0.18<!-- --> <!-- -->1.5<!-- --> <!-- -->s<!-- --> → <!-- -->v0.19<!-- --> <strong>0.69<!-- --> <!-- -->s</strong></span></span></div></div></figure>
<p><strong>Más en v0.19:</strong></p>
<ul>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#performance">Rendimiento</a>: <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#devtools-perf">Redux DevTools más rápido</a>, <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#native-gc">pausas de GC más cortas en React Native</a> y <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#smaller-chunks">bundles divididos más pequeños</a></li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#client">Cliente</a>: <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#set-invalidate">eliminar una entidad con set()</a>, <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#fetch-read-prehandled">las lecturas sin await no necesitan <code>.catch()</code></a>, <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#loading-error-fixes"><code>&lt;Activity&gt;</code> sobre DataProvider</a> y <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#loading-error-states">correcciones de carga y error</a></li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#platforms">Plataformas</a>: <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#platforms">React Native 0.87 y Babel 8</a></li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#vue">Vue</a>: <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#vue-gc">recolección de basura por defecto</a>, <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#vue-stale-while-revalidate">stale-while-revalidate</a> y <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#vue-getter-args">argumentos getter</a></li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#collection-updates">Collections</a>: <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#push-list">listas de elementos</a> en cada actualización y <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#collection-order">cada elemento se muestra una sola vez</a></li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#validation">Validación</a>: <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#typed-set">valores tipados de <code>set()</code></a>, <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#extend-process-params">parámetros de <code>process()</code></a> y <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#typed-optimistic-response">respuestas optimistas</a>; correcciones de <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#testing">pruebas</a> y de <a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#warnings">advertencias</a></li>
</ul>
<p><strong><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#migration-guide">Cambios incompatibles:</a></strong></p>
<ul>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#migrate-all">Para todos los usuarios</a>
<ul>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#nextjs-pages-router">El Pages Router de Next.js no es compatible</a>; usa el App Router (<a href="https://github.com/reactive/data-client/pull/4648" target="_blank" rel="noopener noreferrer" class="">#4648</a>)</li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#typescript-4">Se requiere TypeScript 4.0 o posterior</a>: se eliminan las declaraciones de TypeScript 3.x (<a href="https://github.com/reactive/data-client/pull/4151" target="_blank" rel="noopener noreferrer" class="">#4151</a>)</li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#managers-function"><code>managers</code> es una función que crea los Managers de cada store</a>; <code>npx @data-client/codemods v0.19 src/</code> convierte los arrays (<a href="https://github.com/reactive/data-client/pull/4601" target="_blank" rel="noopener noreferrer" class="">#4601</a>)</li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise">Controller.fetchIfStale() siempre devuelve una Promise</a>, así que las precargas no necesitan <code>.catch()</code> (<a href="https://github.com/reactive/data-client/pull/4657" target="_blank" rel="noopener noreferrer" class="">#4657</a>)</li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#dc-global"><code>__DC_CONTROLLERS__</code> ahora es <code>__DC__</code></a> para los scripts de depuración (<a href="https://github.com/reactive/data-client/pull/4435" target="_blank" rel="noopener noreferrer" class="">#4435</a>)</li>
</ul>
</li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#custom-managers">Para autores de Managers personalizados</a>
<ul>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#manager-middleware">Los Managers deben definir <code>middleware</code></a>: se elimina <code>getMiddleware()</code> (<a href="https://github.com/reactive/data-client/pull/4378" target="_blank" rel="noopener noreferrer" class="">#4378</a>, <a href="https://github.com/reactive/data-client/pull/4382" target="_blank" rel="noopener noreferrer" class="">#4382</a>)</li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#manager-cleanup"><code>cleanup()</code> de un Manager ya no significa que el store haya desaparecido</a>: inicia los temporizadores y las conexiones en <code>init()</code>, y se elimina <code>NetworkManager.cleanupDate</code> (<a href="https://github.com/reactive/data-client/pull/4593" target="_blank" rel="noopener noreferrer" class="">#4593</a>)</li>
</ul>
</li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#migrate-tests">Para autores de pruebas</a>
<ul>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#test-react-0.19">@data-client/test requiere @data-client/react 0.19</a> (<a href="https://github.com/reactive/data-client/pull/4414" target="_blank" rel="noopener noreferrer" class="">#4414</a>, <a href="https://github.com/reactive/data-client/pull/4601" target="_blank" rel="noopener noreferrer" class="">#4601</a>)</li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#test-react-native">Las pruebas de React Native necesitan @testing-library/react-native</a> (<a href="https://github.com/reactive/data-client/pull/4595" target="_blank" rel="noopener noreferrer" class="">#4595</a>)</li>
</ul>
</li>
</ul>
<p><strong><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#future-releases">Prepárate para futuras versiones:</a></strong></p>
<ul>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#future-pk-args">Tipa <code>args</code> como <code>readonly</code> en las sobrescrituras de <code>Entity.pk()</code></a></li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#future-create-data-client">Usa <code>DataClientPlugin</code> en lugar de <code>createDataClient()</code> de Vue</a></li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#future-wait-for-next-update">Reemplaza <code>waitForNextUpdate()</code> en las pruebas de Vue</a></li>
</ul>
<p><strong><a class="" href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#adopt-features">Adopta las nuevas funcionalidades:</a></strong> <code>npx @data-client/codemods v0.19 src/ --improvements=only</code> agrupa en lotes los bucles de <code>set()</code> y elimina los workarounds que 0.19 vuelve innecesarios</p>
<!-- -->
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="performance">Rendimiento<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#performance" class="hash-link" aria-label="Enlace directo al Rendimiento" title="Enlace directo al Rendimiento" translate="no">​</a></h2>
<p>TypeScript se ejecuta con cada pulsación de tecla, el store se actualiza con cada mensaje transmitido y tu bundle se carga en cada visita a una página.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="batch-set">Controller.set() por lotes<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#batch-set" class="hash-link" aria-label="Enlace directo al Controller.set() por lotes" title="Enlace directo al Controller.set() por lotes" translate="no">​</a></h3>
<p><code>react</code> <code>vue</code></p>
<p>Un <a class="" href="https://dataclient.io/es/docs/concepts/managers">Manager</a> que recibe un flujo de filas (como los precios de un ticker por un websocket) ahora puede escribirlas
todas con un solo <a class="" href="https://dataclient.io/es/docs/api/Controller#set-array">Controller.set()</a> pasando un schema de <a class="" href="https://dataclient.io/es/rest/api/Array">Array</a>.
Antes de v0.19, <code>[Ticker]</code> era un error de TypeScript, así que el workaround habitual era un <code>set()</code> por fila:</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">ws<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function-variable function" style="color:rgb(130, 170, 255)">onmessage </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> event <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">const</span> rows <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token constant" style="color:rgb(130, 170, 255)">JSON</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">parse</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>event<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>data<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">for </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">const</span> row <span class="token keyword" style="font-style:italic">of</span> rows<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">    ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">set</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>Ticker<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> product_id<span class="token operator" style="color:rgb(137, 221, 255)">:</span> row<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>product_id <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span> row<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">ws<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function-variable function" style="color:rgb(130, 170, 255)">onmessage </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> event <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">const</span> rows <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token constant" style="color:rgb(130, 170, 255)">JSON</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">parse</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>event<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>data<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">set</span><span class="token punctuation" style="color:rgb(199, 146, 234)">([</span>Ticker<span class="token punctuation" style="color:rgb(199, 146, 234)">],</span> rows<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div></code></pre></div></div></div></div></div></figure>
<p>Cada fila se combina con su entidad almacenada, y las entidades que no están en la lista no se tocan. Los schemas Array no aceptan <code>args</code> ni
función actualizadora. Para agrupar en lotes tipos de Entity mezclados, eliminaciones o filas indexadas por id, pasa un schema <a class="" href="https://dataclient.io/es/rest/api/Union">Union</a>,
<a class="" href="https://dataclient.io/es/rest/api/Invalidate#batch-invalidation">Invalidate</a> o <a class="" href="https://dataclient.io/es/rest/api/Values">Values</a>; consulta
<a class="" href="https://dataclient.io/es/docs/api/Controller#set-array">Controller.set()</a> para ver ejemplos.
<a href="https://github.com/reactive/data-client/pull/4103" target="_blank" rel="noopener noreferrer" class="">#4103</a></p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="batch-set-performance">Rendimiento<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#batch-set-performance" class="hash-link" aria-label="Enlace directo al Rendimiento" title="Enlace directo al Rendimiento" translate="no">​</a></h4>
<p>Cada <code>set()</code> es una actualización independiente del store, y cada actualización del store copia la tabla de ese tipo de entidad. Escribir las filas una
por una repite esa copia para cada fila, así que el costo crece tanto con el tamaño del lote como con el del store. Un lote
paga esa copia una sola vez.</p>
<p>El gráfico al inicio de esta publicación es el benchmark <code>setMany</code> de Node en
<a href="https://github.com/reactive/data-client/blob/master/examples/benchmark/core.js" target="_blank" rel="noopener noreferrer" class="">examples/benchmark/core.js</a>:
un store que ya contiene 500 entidades, y luego un <code>set()</code> síncrono por fila frente a un solo <code>set([Ticker], rows)</code>.
Mide la actualización del store: <strong>20 veces</strong> más rápido con 50 filas y <strong>95 veces</strong> más rápido con 500 filas.
<a href="https://github.com/reactive/data-client/pull/4103" target="_blank" rel="noopener noreferrer" class="">#4103</a></p>
<center><p><a href="https://reactive.github.io/data-client/dev/bench/" target="_blank" rel="noopener noreferrer" class="">Benchmarks a lo largo del tiempo</a> | <a href="https://github.com/reactive/data-client/blob/master/examples/benchmark/core.js" target="_blank" rel="noopener noreferrer" class="">Ver el benchmark setMany</a></p></center>
<p>En un <a class="" href="https://dataclient.io/es/docs/concepts/managers">Manager</a>, acumula los mensajes entrantes y envía cada lote con un solo <code>set()</code>, como se describe en
<a class="" href="https://dataclient.io/es/docs/concepts/managers#batching">Agrupar actualizaciones de alta frecuencia</a>. El <code>StreamManager</code> de la app coin ahora
envía así los mensajes del ticker de Coinbase.</p>
<center><video width="600" controls="" muted="" playsinline="" loop="" aria-label="Redux DevTools de dos copias del StreamManager de la app coin que reciben tres ráfagas de 500 mensajes de ticker. Llamar a set() por cada mensaje registra 1,500 acciones set, mientras que acumular los mensajes y enviarlos con set([Ticker], rows) registra 3." style="width:100%"><source src="/es/videos/blog/batch-set-devtools.webm" type="video/webm">Redux DevTools de dos copias del StreamManager de la app coin que reciben tres ráfagas de 500 mensajes de ticker. Llamar a set() por cada mensaje registra 1,500 acciones set, mientras que acumular los mensajes y enviarlos con set([Ticker], rows) registra 3.</video></center>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">StreamManager.ts</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">handleMessage</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>msg<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>msg<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token keyword" style="font-style:italic">type </span><span class="token class-name keyword" style="color:rgb(255, 203, 107);font-style:italic">in </span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>entities<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>buffer<span class="token punctuation" style="color:rgb(199, 146, 234)">[</span>msg<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>type<span class="token punctuation" style="color:rgb(199, 146, 234)">] </span><span class="token operator" style="color:rgb(137, 221, 255)">??= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{})[</span>msg<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>product_id<span class="token punctuation" style="color:rgb(199, 146, 234)">] </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> msg<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>flushTimeout <span class="token operator" style="color:rgb(137, 221, 255)">??= </span><span class="token function" style="color:rgb(130, 170, 255)">setTimeout</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>flush<span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token number" style="color:rgb(247, 140, 108)">50</span><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token function-variable function" style="color:rgb(130, 170, 255)">flush </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">() </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">const</span> buffer <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>buffer<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>buffer <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{};</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>flushTimeout <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">undefined</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">for </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">const type </span><span class="token class-name keyword" style="color:rgb(255, 203, 107);font-style:italic">in</span> buffer<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>controller<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">set</span><span class="token punctuation" style="color:rgb(199, 146, 234)">([</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>entities<span class="token punctuation" style="color:rgb(199, 146, 234)">[</span>type<span class="token punctuation" style="color:rgb(199, 146, 234)">]],</span> Object<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">values</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>buffer<span class="token punctuation" style="color:rgb(199, 146, 234)">[</span>type<span class="token punctuation" style="color:rgb(199, 146, 234)">]));</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div></code></pre></div></div>
<div class="card_wNtI"><p class="cardTitle_q8VY">Explora el ejemplo coin-app</p><div class="cardLinks_EoYh"><a href="https://stackblitz.com/github/reactive/data-client/tree/master/examples/coin-app?file=src%2Fresources%2FStreamManager.ts%2Csrc%2FgetManagers.ts%2Csrc%2Fresources%2FTicker.ts" target="_blank" rel="noopener noreferrer" class="button button--primary">Abrir en StackBlitz</a><a href="https://github.com/reactive/data-client/tree/master/examples/coin-app" target="_blank" rel="noopener noreferrer" class="button button--secondary">Ver código fuente</a></div></div><div class="wrapper_ZhQy"><span class="loading_rblT" aria-hidden="true">Cargando la demo…</span><iframe width="100%" height="600" title="Demo de coin-app en StackBlitz" class="frame_PtfY"></iframe></div><p style="text-align:center"><a class="button button--secondary button--sm" href="https://dataclient.io/es/demos">Más demos</a></p>
<div class="theme-admonition theme-admonition-tip admonition_WCGJ alert alert--success"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>consejo</div><div class="admonitionContent_pbrs"><p>Si filtras las acciones de <a class="" href="https://dataclient.io/es/docs/api/DevToolsManager">DevToolsManager</a> por schema, el <code>action.schema</code> de una escritura por lotes
es el schema Array, así que compara con <code>action.schema[0]</code> para <code>[Ticker]</code> en lugar de con la Entity en sí.</p></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="devtools-perf">Redux DevTools más rápido<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#devtools-perf" class="hash-link" aria-label="Enlace directo al Redux DevTools más rápido" title="Enlace directo al Redux DevTools más rápido" translate="no">​</a></h3>
<p><code>react</code> <code>vue</code></p>
<p>Con la extensión <a class="" href="https://dataclient.io/es/docs/getting-started/debugging">Redux DevTools</a> abierta, cada actualización del store en desarrollo
serializa todo el store para la extensión, y cada marca de tiempo se formateaba de la forma lenta. Los stores grandes o las
actualizaciones frecuentes, como el sondeo (polling), los datos en tiempo real o muchas llamadas a <code>controller.set()</code>, hacían que la página se entrecortara. Ahora cada actualización
se serializa <strong>40-60 veces más rápido</strong>, y las marcas de tiempo siguen leyéndose como <code>10:42:07.123 AM</code>
(<a href="https://github.com/reactive/data-client/pull/4163" target="_blank" rel="noopener noreferrer" class="">#4163</a>). Las compilaciones de producción no incluyen DevTools, así que no
se ven afectadas.</p>
<figure class="perfChart_LYCy"><figcaption class="text--center text--bold margin-bottom--sm">Serialización de DevTools por actualización del store</figcaption><div class="bars_HVEW" style="--perf-one:1.6666666666666663%"><div class="row_OlYf" aria-hidden="true"><span></span><span class="oneLabel_y_xM">1x</span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">50 entities</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:100%;--perf-split:1.6666666666666663%"></span></span><span class="text--bold">60x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">v0.18<!-- --> <!-- -->18.6<!-- --> <!-- -->ms<!-- --> → <!-- -->v0.19<!-- --> <strong>0.31<!-- --> <!-- -->ms</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">500 entities</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:67%;--perf-split:2.487562189054726%"></span></span><span class="text--bold">40x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">v0.18<!-- --> <!-- -->201<!-- --> <!-- -->ms<!-- --> → <!-- -->v0.19<!-- --> <strong>5<!-- --> <!-- -->ms</strong></span></span></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="native-gc">Pausas de GC más cortas en React Native<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#native-gc" class="hash-link" aria-label="Enlace directo al Pausas de GC más cortas en React Native" title="Enlace directo al Pausas de GC más cortas en React Native" translate="no">​</a></h3>
<p><code>react</code></p>
<p>Las apps de React Native ya no se congelan entre 0.5 y 3 s seguidos mientras leen un resultado grande que no deja de actualizarse, como unos
pocos miles de entidades unidas con precios en vivo (<a href="https://github.com/reactive/data-client/pull/4594" target="_blank" rel="noopener noreferrer" class="">#4594</a>). La
lectura más larga, pausas incluidas, ahora es entre 10 y 90 veces más rápida.</p>
<figure class="perfChart_LYCy"><figcaption class="text--center text--bold margin-bottom--sm">Aceleración de la lectura más larga en Hermes, pausas de GC incluidas</figcaption><div class="bars_HVEW" style="--perf-one:1.1056511056511056%"><div class="row_OlYf" aria-hidden="true"><span></span><span class="oneLabel_y_xM">1x</span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">Long nested list, first read</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:11.481761481761483%;--perf-split:9.62962962962963%"></span></span><span class="text--bold">10x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">Before<!-- --> <!-- -->405<!-- --> <!-- -->ms<!-- --> → <!-- -->After<!-- --> <strong>39<!-- --> <!-- -->ms</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">Long and short reads, entity cache only</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:100%;--perf-split:1.1056511056511056%"></span></span><span class="text--bold">90x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">Before<!-- --> <!-- -->407<!-- --> <!-- -->ms<!-- --> → <!-- -->After<!-- --> <strong>4.5<!-- --> <!-- -->ms</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">50-deep bidirectional chain</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:51.880551880551884%;--perf-split:2.1311475409836063%"></span></span><span class="text--bold">47x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">Before<!-- --> <!-- -->549<!-- --> <!-- -->ms<!-- --> → <!-- -->After<!-- --> <strong>11.7<!-- --> <!-- -->ms</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">500 one-entity reads</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:19.4690738168999%;--perf-split:5.679012345679013%"></span></span><span class="text--bold">18x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">Before<!-- --> <!-- -->243<!-- --> <!-- -->ms<!-- --> → <!-- -->After<!-- --> <strong>13.8<!-- --> <!-- -->ms</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">All() query key</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:63.180063180063186%;--perf-split:1.7499999999999998%"></span></span><span class="text--bold">57x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">Before<!-- --> <!-- -->200<!-- --> <!-- -->ms<!-- --> → <!-- -->After<!-- --> <strong>3.5<!-- --> <!-- -->ms</strong></span></span></div></div></figure>
<p>Cada congelamiento era una pausa de recolección de basura (GC) en Hermes, el motor de JavaScript de React Native. La caché de memoización de Data Client
anidaba un <code>WeakMap</code> por cada dependencia, y Hermes se pausaba en cada nivel. En React Native, la caché ahora tiene un solo nivel.</p>
<p>La caché también ocupa hasta un 10% menos de memoria. Medimos el heap que mantiene en Node, así que los tamaños en Hermes difieren.</p>
<div class="scroll_C2fg"><table class="perfTable_gnxQ"><thead><tr><th></th><th>Memory the cache holds</th></tr></thead><tbody><tr><th scope="row">Streaming join<div class="description_oO4J">3,736 symbols joined to live tickers</div></th><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:90.08264462809919%"></span></div><span class="better_Bdvc">-10%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">9.68<!-- -->MB<!-- --> →<!-- --> <strong>8.72<!-- -->MB</strong></span></span></td></tr><tr><th scope="row">Large refetch<div class="description_oO4J">10,000 rows refetched 20 times</div></th><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:92.45411284840243%"></span></div><span class="better_Bdvc">-8%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">14.71<!-- -->MB<!-- --> →<!-- --> <strong>13.6<!-- -->MB</strong></span></span></td></tr><tr><th scope="row">Trade tape<div class="description_oO4J">100 rows of streaming trades</div></th><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:96.23430962343095%"></span></div><span class="better_Bdvc">-4%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">2.39<!-- -->MB<!-- --> →<!-- --> <strong>2.3<!-- -->MB</strong></span></span></td></tr></tbody></table></div>
<p>Las lecturas entre pausas también son hasta 2.7 veces más rápidas. Las lecturas pequeñas en caché (las filas rojas de 0.8x) son la excepción: son
un 20% más lentas.</p>
<figure class="perfChart_LYCy"><figcaption class="text--center text--bold margin-bottom--sm">Aceleración por lectura en Hermes, entre pausas</figcaption><div class="bars_HVEW" style="--perf-one:37.17253839205058%"><div class="row_OlYf" aria-hidden="true"><span></span><span class="oneLabel_y_xM">1x</span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">500-row screen, after a store change</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:100%;--perf-split:37.17253839205058%"></span></span><span class="text--bold">2.7x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">Before<!-- --> <!-- -->4428<!-- --> <!-- -->µs<!-- --> → <!-- -->After<!-- --> <strong>1646<!-- --> <!-- -->µs</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">500-row screen, same store again</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:82.22270081420461%;--perf-split:45.20958083832335%"></span></span><span class="text--bold">2.2x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">Before<!-- --> <!-- -->668<!-- --> <!-- -->µs<!-- --> → <!-- -->After<!-- --> <strong>302<!-- --> <!-- -->µs</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">Long nested list, cached</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:45.719508898251995%;--perf-split:81.30563798219585%"></span></span><span class="text--bold">1.2x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">Before<!-- --> <!-- -->337<!-- --> <!-- -->µs<!-- --> → <!-- -->After<!-- --> <strong>274<!-- --> <!-- -->µs</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">All() query, cached</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:50.86768411543764%;--perf-split:73.07692307692307%"></span></span><span class="text--bold">1.4x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">Before<!-- --> <!-- -->364<!-- --> <!-- -->µs<!-- --> → <!-- -->After<!-- --> <strong>266<!-- --> <!-- -->µs</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">500 one-entity reads, cached</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:30.892457371778686%;--perf-split:120.3288490284006%"></span><span class="shortfall_TA8N" style="left:30.892457371778686%;width:6.280081020271901%"></span></span><span class="worse_OhAz">0.8x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">Before<!-- --> <!-- -->669<!-- --> <!-- -->µs<!-- --> → <!-- -->After<!-- --> <strong>805<!-- --> <!-- -->µs</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">500 one-entity queries, cached</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:31.37832495292824%;--perf-split:118.4656556645852%"></span><span class="shortfall_TA8N" style="left:31.37832495292824%;width:5.794213439122345%"></span></span><span class="worse_OhAz">0.8x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">Before<!-- --> <!-- -->1121<!-- --> <!-- -->µs<!-- --> → <!-- -->After<!-- --> <strong>1328<!-- --> <!-- -->µs</strong></span></span></div></div></figure>
<p>Medimos una compilación de release en un emulador de Android, con la mediana de 5 arranques. Las compilaciones web no cambian.</p>
<center><p><a href="https://github.com/reactive/data-client/pull/4594#benchmarks" target="_blank" rel="noopener noreferrer" class="">Detalles del benchmark</a> | <a href="https://github.com/reactive/data-client/blob/master/examples/benchmark/normalizr.js" target="_blank" rel="noopener noreferrer" class="">Ver los benchmarks de lectura</a></p></center>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="faster-types">TypeScript más rápido<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#faster-types" class="hash-link" aria-label="Enlace directo al TypeScript más rápido" title="Enlace directo al TypeScript más rápido" translate="no">​</a></h3>
<p><code>rest</code> <code>endpoint</code> <code>graphql</code></p>
<p>TypeScript vuelve a comprobar tu código con cada pulsación de tecla en el editor y en cada compilación de CI. En apps con muchos endpoints,
los tipos pesados de las bibliotecas se notan como autocompletado lento, subrayados rojos que tardan segundos en aparecer y compilaciones más lentas.
v0.19 hace que <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint">RestEndpoint</a>, <a class="" href="https://dataclient.io/es/rest/api/resource">resource()</a> y <code>.extend()</code> sean mucho más baratos
de comprobar, sin cambios de código de tu parte. TypeScript sigue reportando todos los errores que reportaba antes
(<a href="https://github.com/reactive/data-client/pull/4173" target="_blank" rel="noopener noreferrer" class="">#4173</a>).</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="faster-types-results">Resultados<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#faster-types-results" class="hash-link" aria-label="Enlace directo al Resultados" title="Enlace directo al Resultados" translate="no">​</a></h4>
<p>Nuestra prueba de estrés más pesada, un archivo de 150 RestEndpoints con rutas largas, <code>.extend()</code> y <code>.paginated()</code>, ahora se comprueba
<strong>2 veces más rápido en TypeScript 6</strong> y <strong>2.2 veces más rápido en TypeScript 7</strong> (gráfico al inicio de esta publicación), usando cerca de un <strong>40% menos de memoria</strong>. Todas las cifras comparan
los paquetes publicados v0.18.1 con v0.19; los tiempos de comprobación son el mejor de 10 ejecuciones.</p>
<figure class="perfChart_LYCy"><figcaption class="text--center text--bold margin-bottom--sm">Memoria para el mismo archivo</figcaption><div class="bars_HVEW" style="--perf-one:41.66666666666667%"><div class="row_OlYf" aria-hidden="true"><span></span><span class="oneLabel_y_xM">1x</span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">TypeScript 6</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:72.07740916271722%;--perf-split:57.80821917808219%"></span></span><span class="text--bold">1.7x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">v0.18<!-- --> <!-- -->365<!-- --> <!-- -->MB<!-- --> → <!-- -->v0.19<!-- --> <strong>211<!-- --> <!-- -->MB</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">TypeScript 7</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:71.61458333333334%;--perf-split:58.18181818181818%"></span></span><span class="text--bold">1.7x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">v0.18<!-- --> <!-- -->220<!-- --> <!-- -->MB<!-- --> → <!-- -->v0.19<!-- --> <strong>128<!-- --> <!-- -->MB</strong></span></span></div></div></figure>
<p>El código con muchos endpoints hace mucho menos trabajo de tipos. Las instanciaciones de tipos son la unidad de trabajo de TypeScript: son
deterministas, así que se comparan limpiamente entre máquinas. Union hace más trabajo que en v0.18, porque v0.19 ahora
<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#typed-set" class="">comprueba los tipos de los valores de set()</a> (ver más abajo).</p>
<figure class="perfChart_LYCy"><figcaption class="text--center text--bold margin-bottom--sm">Instanciaciones de tipos por prueba de estrés</figcaption><div class="bars_HVEW" style="--perf-one:41.48418491484185%"><div class="row_OlYf" aria-hidden="true"><span></span><span class="oneLabel_y_xM">1x</span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">Long paths</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:100%;--perf-split:41.48418491484185%"></span></span><span class="text--bold">2.4x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">v0.18<!-- --> <!-- -->822<!-- --> <!-- -->K<!-- --> → <!-- -->v0.19<!-- --> <strong>341<!-- --> <!-- -->K</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">Typical app</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:62.53586084177651%;--perf-split:66.33663366336634%"></span></span><span class="text--bold">1.5x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">v0.18<!-- --> <!-- -->20.2<!-- --> <!-- -->K<!-- --> → <!-- -->v0.19<!-- --> <strong>13.4<!-- --> <!-- -->K</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">React hooks</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:49.30497387419728%;--perf-split:84.13793103448275%"></span></span><span class="text--bold">1.2x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">v0.18<!-- --> <!-- -->145<!-- --> <!-- -->K<!-- --> → <!-- -->v0.19<!-- --> <strong>122<!-- --> <!-- -->K</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">Vue</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:54.90295931647145%;--perf-split:75.5591054313099%"></span></span><span class="text--bold">1.3x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">v0.18<!-- --> <!-- -->62.6<!-- --> <!-- -->K<!-- --> → <!-- -->v0.19<!-- --> <strong>47.3<!-- --> <!-- -->K</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">300 fields</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:55.09618309002433%;--perf-split:75.29411764705883%"></span></span><span class="text--bold">1.3x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">v0.18<!-- --> <!-- -->17<!-- --> <!-- -->K<!-- --> → <!-- -->v0.19<!-- --> <strong>12.8<!-- --> <!-- -->K</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">Schemas</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:49.29641309115144%;--perf-split:84.15254237288136%"></span></span><span class="text--bold">1.2x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">v0.18<!-- --> <!-- -->118<!-- --> <!-- -->K<!-- --> → <!-- -->v0.19<!-- --> <strong>99.3<!-- --> <!-- -->K</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">Union</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:23.189917033141402%;--perf-split:178.88888888888889%"></span><span class="shortfall_TA8N" style="left:23.189917033141402%;width:18.294267881700442%"></span></span><span class="worse_OhAz">0.6x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">v0.18<!-- --> <!-- -->9<!-- --> <!-- -->K<!-- --> → <!-- -->v0.19<!-- --> <strong>16.1<!-- --> <!-- -->K</strong></span></span></div></div></figure>
<p>Pasa el cursor o toca una celda para ver las cifras exactas.</p>
<div class="scroll_C2fg"><table class="perfTable_gnxQ"><thead><tr><th></th><th>TS 6 check time</th><th>TS 7 check time</th><th>TS 6 memory</th></tr></thead><tbody><tr><th scope="row">Long paths<div class="description_oO4J">150 RestEndpoints with 6-param paths, <code>.extend()</code> and <code>.paginated()</code></div></th><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:51.697127937336816%"></span></div><span class="better_Bdvc">-48%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">3.83<!-- -->s<!-- --> →<!-- --> <strong>1.98<!-- -->s</strong></span></span></td><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:46%"></span></div><span class="better_Bdvc">-54%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">1.5<!-- -->s<!-- --> →<!-- --> <strong>0.69<!-- -->s</strong></span></span></td><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:57.80821917808219%"></span></div><span class="better_Bdvc">-42%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">365<!-- -->MB<!-- --> →<!-- --> <strong>211<!-- -->MB</strong></span></span></td></tr><tr><th scope="row">Typical app<div class="description_oO4J">A few resources with <code>.extend()</code>, <code>.paginated()</code> and hooks</div></th><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:100%"></span></div><span class="same_qjOp">same</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">0.42<!-- -->s<!-- --> →<!-- --> <strong>0.42<!-- -->s</strong></span></span></td><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:85.48387096774194%"></span></div><span class="better_Bdvc">-15%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">0.062<!-- -->s<!-- --> →<!-- --> <strong>0.053<!-- -->s</strong></span></span></td><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:97.24770642201835%"></span><span class="barAfter_V9wC" style="width:100%"></span></div><span class="worse_ycwO">+3%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">106<!-- -->MB<!-- --> →<!-- --> <strong>109<!-- -->MB</strong></span></span></td></tr><tr><th scope="row">React hooks<div class="description_oO4J">40 resources through every hook, plus <code>ctrl.fetch()</code> and <code>ctrl.set()</code></div></th><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:90.3225806451613%"></span></div><span class="better_Bdvc">-10%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">1.24<!-- -->s<!-- --> →<!-- --> <strong>1.12<!-- -->s</strong></span></span></td><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:92.6829268292683%"></span></div><span class="better_Bdvc">-7%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">0.41<!-- -->s<!-- --> →<!-- --> <strong>0.38<!-- -->s</strong></span></span></td><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:94.01197604790418%"></span></div><span class="better_Bdvc">-6%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">167<!-- -->MB<!-- --> →<!-- --> <strong>157<!-- -->MB</strong></span></span></td></tr><tr><th scope="row">Vue<div class="description_oO4J">The same 40 resources through every composable</div></th><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:100%"></span></div><span class="same_qjOp">same</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">0.68<!-- -->s<!-- --> →<!-- --> <strong>0.68<!-- -->s</strong></span></span></td><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:88.23529411764704%"></span></div><span class="better_Bdvc">-12%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">0.17<!-- -->s<!-- --> →<!-- --> <strong>0.15<!-- -->s</strong></span></span></td><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:95.86206896551724%"></span></div><span class="better_Bdvc">-4%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">145<!-- -->MB<!-- --> →<!-- --> <strong>139<!-- -->MB</strong></span></span></td></tr><tr><th scope="row">300 fields<div class="description_oO4J">One Entity with 300 fields, read and updated 100 times</div></th><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:86.36363636363636%"></span></div><span class="better_Bdvc">-14%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">0.44<!-- -->s<!-- --> →<!-- --> <strong>0.38<!-- -->s</strong></span></span></td><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:60.465116279069775%"></span></div><span class="better_Bdvc">-40%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">0.086<!-- -->s<!-- --> →<!-- --> <strong>0.052<!-- -->s</strong></span></span></td><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:90.990990990991%"></span></div><span class="better_Bdvc">-9%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">111<!-- -->MB<!-- --> →<!-- --> <strong>101<!-- -->MB</strong></span></span></td></tr><tr><th scope="row">Schemas<div class="description_oO4J">All, Query, Invalidate, Array, Object and Collection</div></th><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:97.27272727272727%"></span></div><span class="better_Bdvc">-3%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">1.1<!-- -->s<!-- --> →<!-- --> <strong>1.07<!-- -->s</strong></span></span></td><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:86.11111111111111%"></span></div><span class="better_Bdvc">-14%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">0.36<!-- -->s<!-- --> →<!-- --> <strong>0.31<!-- -->s</strong></span></span></td><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:96.15384615384616%"></span></div><span class="better_Bdvc">-4%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">156<!-- -->MB<!-- --> →<!-- --> <strong>150<!-- -->MB</strong></span></span></td></tr><tr><th scope="row">Union<div class="description_oO4J">A 30-member Union in a Collection and Values</div></th><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:97.61904761904762%"></span></div><span class="better_Bdvc">-2%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">0.42<!-- -->s<!-- --> →<!-- --> <strong>0.41<!-- -->s</strong></span></span></td><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:95.77464788732397%"></span></div><span class="better_Bdvc">-4%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">0.071<!-- -->s<!-- --> →<!-- --> <strong>0.068<!-- -->s</strong></span></span></td><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:94.39252336448598%"></span></div><span class="better_Bdvc">-6%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">107<!-- -->MB<!-- --> →<!-- --> <strong>101<!-- -->MB</strong></span></span></td></tr><tr><th scope="row">set() values<div class="description_oO4J">1000 <code>ctrl.set()</code> calls on a 30-member Union, a Collection of it and a 300-field Entity</div></th><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:71.81208053691276%"></span></div><span class="better_Bdvc">-28%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">1.49<!-- -->s<!-- --> →<!-- --> <strong>1.07<!-- -->s</strong></span></span></td><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:46.29629629629629%"></span></div><span class="better_Bdvc">-54%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">0.54<!-- -->s<!-- --> →<!-- --> <strong>0.25<!-- -->s</strong></span></span></td><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:74.43181818181817%"></span></div><span class="better_Bdvc">-26%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">176<!-- -->MB<!-- --> →<!-- --> <strong>131<!-- -->MB</strong></span></span></td></tr><tr><th scope="row">set() updaters<div class="description_oO4J">1000 <code>ctrl.set(Union, args, prev =&gt; ...)</code> updaters on a 30-member Union</div></th><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:95.8100558659218%"></span></div><span class="better_Bdvc">-4%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">3.58<!-- -->s<!-- --> →<!-- --> <strong>3.43<!-- -->s</strong></span></span></td><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:90.27027027027026%"></span><span class="barAfter_V9wC" style="width:100%"></span></div><span class="worse_ycwO">+11%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">1.67<!-- -->s<!-- --> →<!-- --> <strong>1.85<!-- -->s</strong></span></span></td><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:99.21875%"></span><span class="barAfter_V9wC" style="width:100%"></span></div><span class="worse_ycwO">+1%</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">381<!-- -->MB<!-- --> →<!-- --> <strong>384<!-- -->MB</strong></span></span></td></tr></tbody></table></div>
<p>Las filas de set() miden los <a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#typed-set" class="">valores tipados de set()</a>, que v0.18 no comprobaba en absoluto. Los valores simples se siguen comprobando
más rápido que antes, y los actualizadores sobre Unions grandes se comprueban en casi el mismo tiempo aunque TypeScript ahora
comprueba el valor de retorno de cada actualizador (<a href="https://github.com/reactive/data-client/pull/4179" target="_blank" rel="noopener noreferrer" class="">#4179</a>).</p>
<p>Los archivos pequeños están dominados por el costo fijo de arranque de TypeScript (cargar solo <code>lib.dom.d.ts</code> toma cerca de 100MB), así que
su tiempo y su memoria casi no cambian. El ahorro se acumula a medida que crece el código.</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="faster-types-how">Qué cambió<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#faster-types-how" class="hash-link" aria-label="Enlace directo al Qué cambió" title="Enlace directo al Qué cambió" translate="no">​</a></h4>
<ul>
<li class=""><code>.extend()</code> y <code>.paginated()</code> se comparten entre todos los endpoints en lugar de recrearse para cada tipo de endpoint.</li>
<li class="">Las opciones del endpoint se infieren como tipos de objeto simples, así que TypeScript deja de reconstruirlas en cada uso.</li>
<li class="">Los parámetros de ruta como <code>/users/:id</code> se leen en una sola pasada.</li>
</ul>
<p>Antes de publicar, desactivamos todos los <code>@ts-expect-error</code> de la suite de pruebas en TypeScript 4.0 a 7 y confirmamos que
cada error sigue apareciendo en el mismo lugar.</p>
<p>En TypeScript 5.x y anteriores, un método <code>process(value, params)</code> pasado a <code>.extend()</code> tampoco vuelve a fallar con
"implicitly has an 'any' type" bajo <code>strict</code>.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="smaller-chunks">Bundles divididos más pequeños<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#smaller-chunks" class="hash-link" aria-label="Enlace directo al Bundles divididos más pequeños" title="Enlace directo al Bundles divididos más pequeños" translate="no">​</a></h3>
<p>Las apps que dividen su bundle por página o por proveedor con webpack, rspack o Turbopack ahora envían menos código de Data Client
(<a href="https://github.com/reactive/data-client/pull/4487" target="_blank" rel="noopener noreferrer" class="">#4487</a>). JavaScript comprimido con Brotli de una app de dos páginas con rutas
diferidas, compilada desde 0.19 sin y con este cambio:</p>
<div class="scroll_C2fg"><table class="perfTable_gnxQ"><thead><tr><th></th><th>Total JS</th></tr></thead><tbody><tr><th scope="row">rspack 2<div class="description_oO4J">tracks webpack</div></th><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:98.97675740623507%"></span></div><span class="better_Bdvc">-792 B</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">77401<!-- -->B<!-- --> →<!-- --> <strong>76609<!-- -->B</strong></span></span></td></tr><tr><th scope="row">Next.js 16 (Turbopack)</th><td class="anchor_tRSI" tabindex="0"><div class="cell_YlFy"><div class="bars_qVXI" aria-hidden="true"><span class="barBefore_uor8" style="width:100%"></span><span class="barAfter_V9wC" style="width:99.7909431548163%"></span></div><span class="better_Bdvc">-366 B</span></div><span class="tip_ZJ8Q tip_kDq8"><span class="bubble_XBbb">175072<!-- -->B<!-- --> →<!-- --> <strong>174706<!-- -->B</strong></span></span></td></tr></tbody></table></div>
<p>Vite y las apps de un solo bundle se mantienen con un tamaño parecido.</p>
<p>Este ahorro nos permitió enviar más funcionalidad en 0.19 con casi el mismo tamaño. Frente a 0.18.2, la misma app cambia
−171 B con rspack, +257 B con Turbopack y +480 B con Vite.</p>
<p>Todos los archivos de Data Client estaban marcados con <code>sideEffects: false</code>. Por eso los bundlers omitían el archivo index de cada paquete y enlazaban
cada importación, como <code>Entity</code> o <code>resource</code>, con el archivo que la define. Con Data Client dividido en chunks,
webpack dividía entonces cada paquete en varios grupos y envolvía el código que comparten. Ahora los archivos de entrada de
<code>@data-client/rest</code>, <code>endpoint</code>, <code>graphql</code>, <code>core</code>, <code>normalizr</code> y <code>react</code> están marcados como con efectos secundarios.
Los bundlers entran a cada paquete por su index y lo fusionan en un solo módulo. El código que no usas, como
<a class="" href="https://dataclient.io/es/rest/api/Lazy">Lazy</a>, se sigue eliminando.</p>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="client">Cliente<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#client" class="hash-link" aria-label="Enlace directo al Cliente" title="Enlace directo al Cliente" translate="no">​</a></h2>
<p>Toda app con <code>@data-client/react</code> o <code>@data-client/vue</code> escribe en el store con Controller y lo lee con hooks o composables. Estos cambios simplifican las escrituras y mantienen la pantalla sincronizada con el store.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="set-invalidate">Eliminar una entidad con set()<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#set-invalidate" class="hash-link" aria-label="Enlace directo al Eliminar una entidad con set()" title="Enlace directo al Eliminar una entidad con set()" translate="no">​</a></h3>
<p><code>react</code> <code>vue</code></p>
<p>Pasar un schema <a class="" href="https://dataclient.io/es/rest/api/Invalidate">Invalidate</a> a <a class="" href="https://dataclient.io/es/docs/api/Controller#set-array">Controller.set()</a> elimina la
entidad que identifica su fila, pero la forma individual era un error de TypeScript, así que el código la envolvía en un lote de una fila. Ahora
pasa la comprobación de tipos, con la fila tipada por los campos de la Entity
(<a href="https://github.com/reactive/data-client/pull/4230" target="_blank" rel="noopener noreferrer" class="">#4230</a>):</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">set</span><span class="token punctuation" style="color:rgb(199, 146, 234)">([</span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">Invalidate</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>Todo<span class="token punctuation" style="color:rgb(199, 146, 234)">)], [{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'5' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}]);</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">set</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">Invalidate</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>Todo<span class="token punctuation" style="color:rgb(199, 146, 234)">), {</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'5' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div></div></div></div></figure>
<p>Como <code>set()</code> por lotes, no acepta <code>args</code> ni función actualizadora.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="poll-schema">Corrección: las listas con sondeo se actualizan con las mutaciones<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#poll-schema" class="hash-link" aria-label="Enlace directo al Corrección: las listas con sondeo se actualizan con las mutaciones" title="Enlace directo al Corrección: las listas con sondeo se actualizan con las mutaciones" translate="no">​</a></h3>
<p><code>react</code> <code>vue</code></p>
<p>Un endpoint al que se le da un <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#pollfrequency">pollFrequency</a> con <code>.extend()</code> ahora conserva su schema cuando
hace sondeo. Así, una lista de <a class="" href="https://dataclient.io/es/docs/api/useLive">useLive()</a> con sondeo se actualiza de inmediato con las mutaciones y las actualizaciones optimistas,
en lugar de esperar al siguiente sondeo (<a href="https://github.com/reactive/data-client/pull/4437" target="_blank" rel="noopener noreferrer" class="">#4437</a>).</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="dc-actions">Acciones recientes en <code>__DC__</code><a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#dc-actions" class="hash-link" aria-label="Enlace directo al dc-actions" title="Enlace directo al dc-actions" translate="no">​</a></h3>
<p><code>react</code> <code>vue</code></p>
<p>En desarrollo, <code>__DC__.actions</code> lista las acciones recientes del store, incluidos los fetch hechos mientras cargaba la página.
Los agentes de programación y la consola del navegador pueden ver lo que hizo el store sin la extensión Redux DevTools, y
<code>__DC__.controller</code> lee el store con los métodos de <a class="" href="https://dataclient.io/es/docs/api/Controller">Controller</a> que ya conocen. Los stores con
el mismo nombre de devtools ahora reciben claves propias, como <code>'Data Client: My App (2)'</code>, en lugar de que el segundo oculte al primero.
Esto reemplaza a <code>__DC_CONTROLLERS__</code>; consulta las <a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#dc-global" class="">notas de actualización</a> (<a href="https://github.com/reactive/data-client/pull/4393" target="_blank" rel="noopener noreferrer" class="">#4393</a>).</p>
<div class="language-js codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Browser DevTools console</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-js codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">__DC__<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>actions<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">slice</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">-</span><span class="token number" style="color:rgb(247, 140, 108)">10</span><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="loading-error-states">Estados de carga y error<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#loading-error-states" class="hash-link" aria-label="Enlace directo al Estados de carga y error" title="Enlace directo al Estados de carga y error" translate="no">​</a></h3>
<p>La pantalla debe coincidir con los datos: sin spinner interminable, sin un error viejo después de que un reintento tiene éxito, sin un elemento eliminado renderizado como presente.</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="deleted-entity-undefined">Corrección: las entidades eliminadas se leen como undefined<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#deleted-entity-undefined" class="hash-link" aria-label="Enlace directo al Corrección: las entidades eliminadas se leen como undefined" title="Enlace directo al Corrección: las entidades eliminadas se leen como undefined" translate="no">​</a></h4>
<p><code>react</code> <code>vue</code></p>
<p>Cuando se eliminaba una entidad y fallaba su refetch, <a class="" href="https://dataclient.io/es/docs/api/useCache">useCache()</a> y <a class="" href="https://dataclient.io/es/docs/api/useDLE">useDLE()</a>
(React y Vue) devolvían un <code>Symbol</code> interno como dato. Un <code>Symbol</code> es truthy, así que la guarda habitual de "aún no cargado" lo
dejaba pasar y el componente se renderizaba como si tuviera una entidad
(<a href="https://github.com/reactive/data-client/pull/4150" target="_blank" rel="noopener noreferrer" class="">#4150</a>):</p>
<div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">function </span><span class="token function" style="color:rgb(130, 170, 255)">TodoDetail</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">number </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}) {</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">const</span> todo <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useCache</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>TodoResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line">  <span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// a deleted todo used to get past this guard, so todo.title.trim() threw</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">!</span>todo<span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token keyword" style="font-style:italic">return </span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">TodoPlaceholder </span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">/&gt;;</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">return </span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag" style="color:rgb(255, 85, 114)">h3</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;{</span>todo<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>title<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">trim</span><span class="token punctuation" style="color:rgb(199, 146, 234)">()}&lt;/</span><span class="token tag" style="color:rgb(255, 85, 114)">h3</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;;</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div>
<p>Ahora <code>data</code> es <code>undefined</code>, igual que su tipo y que <a class="" href="https://dataclient.io/es/docs/api/Controller#get">Controller.get()</a>. Lo mismo aplica a
<a class="" href="https://dataclient.io/es/docs/api/Controller#getResponse">Controller.getResponse()</a>, por ejemplo en <a class="" href="https://dataclient.io/es/docs/api/Manager">Managers</a> personalizados.</p>
<p>Si usabas un workaround, ya puedes quitarlo. Basta con una comprobación simple de truthiness:</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">function </span><span class="token function" style="color:rgb(130, 170, 255)">TodoDetail</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">number </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}) {</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">const</span> todo <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useCache</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>TodoResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">!</span>todo <span class="token operator" style="color:rgb(137, 221, 255)">|| </span><span class="token keyword" style="font-style:italic">typeof</span> todo <span class="token operator" style="color:rgb(137, 221, 255)">=== </span><span class="token string" style="color:rgb(195, 232, 141)">'symbol'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token keyword" style="font-style:italic">return </span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">TodoPlaceholder </span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">/&gt;;</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">return </span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag" style="color:rgb(255, 85, 114)">h3</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;{</span>todo<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>title<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">trim</span><span class="token punctuation" style="color:rgb(199, 146, 234)">()}&lt;/</span><span class="token tag" style="color:rgb(255, 85, 114)">h3</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;;</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">function </span><span class="token function" style="color:rgb(130, 170, 255)">TodoDetail</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">number </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}) {</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">const</span> todo <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useCache</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>TodoResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">!</span>todo<span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token keyword" style="font-style:italic">return </span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">TodoPlaceholder </span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">/&gt;;</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">return </span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag" style="color:rgb(255, 85, 114)">h3</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;{</span>todo<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>title<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">trim</span><span class="token punctuation" style="color:rgb(199, 146, 234)">()}&lt;/</span><span class="token tag" style="color:rgb(255, 85, 114)">h3</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;;</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<p>Para mostrar algo específico cuando falló el refetch (por ejemplo un 404 tras la eliminación), lee <code>error</code> de
<a class="" href="https://dataclient.io/es/docs/api/useDLE">useDLE()</a> en lugar de inspeccionar <code>data</code>.</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="loading-error-fixes">Otros cambios<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#loading-error-fixes" class="hash-link" aria-label="Enlace directo al Otros cambios" title="Enlace directo al Otros cambios" translate="no">​</a></h4>
<ul>
<li class=""><code>react</code> <a class="" href="https://dataclient.io/es/docs/api/Controller#fetch">Controller.fetch()</a> de un endpoint sin <code>sideEffect</code> nunca rechaza sin manejar, así que una lectura a la que no haces await no necesita <code>.catch()</code>: los componentes que leen ese endpoint muestran su error almacenado. Las mutaciones siguen rechazando. Esto también evita la advertencia de rechazo no manejado de React Native cuando falla un refetch al enfocar la pantalla. <a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#fetch-read-prehandled" class="">Notas de actualización</a> (<a href="https://github.com/reactive/data-client/pull/4670" target="_blank" rel="noopener noreferrer" class="">#4670</a>)</li>
<li class=""><code>react</code> Se admite React <a href="https://react.dev/reference/react/Activity" target="_blank" rel="noopener noreferrer" class=""><code>&lt;Activity&gt;</code></a> por encima de <a class="" href="https://dataclient.io/es/docs/api/DataProvider">DataProvider</a>. Antes, ocultar <code>DataProvider</code> descartaba respuestas, fetches y suscripciones, lo que dejaba <a class="" href="https://dataclient.io/es/docs/api/useSuspense">useSuspense()</a> cargando para siempre. La mayoría de las apps deberían seguir poniendo <code>DataProvider</code> en la raíz, por encima de <code>&lt;Activity&gt;</code>, lo que funciona como antes. La respuesta a un fetch iniciado antes de <a class="" href="https://dataclient.io/es/docs/api/Controller#resetEntireStore">resetEntireStore()</a> siempre se descarta, así que los managers personalizados deben pasar el <code>fetchedAt</code> propio del fetch a <a class="" href="https://dataclient.io/es/docs/api/Controller#resolve">controller.resolve()</a>; el codemod de v0.19 hace esto donde un Manager resuelve <code>action.endpoint</code> bajo una comprobación de <code>actionTypes.FETCH</code> (<a href="https://github.com/reactive/data-client/pull/4593" target="_blank" rel="noopener noreferrer" class="">#4593</a>)</li>
<li class=""><code>react</code> <code>vue</code> <strong>Corrección:</strong> <a class="" href="https://dataclient.io/es/docs/api/useLoading">useLoading()</a> borra <code>error</code> cuando se vuelve a llamar a la función envuelta, así que un formulario ya no muestra un error viejo después de que un envío posterior tiene éxito. Cuando las llamadas se superponen, <code>loading</code> y <code>error</code> de React y Vue siguen la última llamada, y una llamada que termina dentro de un <code>&lt;Activity&gt;</code> oculto muestra su resultado cuando se hace visible (<a href="https://github.com/reactive/data-client/pull/4614" target="_blank" rel="noopener noreferrer" class="">#4614</a>)</li>
<li class=""><code>react</code> <code>vue</code> <strong>Corrección:</strong> Un resultado en caché ya no sigue mostrando como ausente una entidad anidada después de que esa entidad fuera <code>INVALID</code> o <code>null</code> y vuelva a ser válida (<a href="https://github.com/reactive/data-client/pull/4460" target="_blank" rel="noopener noreferrer" class="">#4460</a>)</li>
<li class=""><code>react</code> <strong>Corrección:</strong> <a class="" href="https://dataclient.io/es/docs/api/useCancelling">useCancelling()</a> ya no aborta la petición que espera su propio componente cuando se vuelve a renderizar estando suspendido, lo que podía dejar cargando para siempre a las peticiones lentas (<a href="https://github.com/reactive/data-client/pull/4516" target="_blank" rel="noopener noreferrer" class="">#4516</a>)</li>
<li class=""><code>react</code> <strong>Corrección:</strong> <a class="" href="https://dataclient.io/es/docs/api/ExternalDataProvider">ExternalDataProvider</a> y el <a class="" href="https://dataclient.io/es/docs/guides/redux"><code>DataProvider</code> de Redux</a> renderizan las actualizaciones despachadas desde los Effects de montaje de los hijos, como un <code>controller.fetch()</code> optimista, en lugar de esperar al siguiente cambio del store (<a href="https://github.com/reactive/data-client/pull/4663" target="_blank" rel="noopener noreferrer" class="">#4663</a>)</li>
</ul>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="platforms">Plataformas<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#platforms" class="hash-link" aria-label="Enlace directo al Plataformas" title="Enlace directo al Plataformas" translate="no">​</a></h2>
<p>Actualizar Data Client no debería frenar tu configuración de React Native, Babel o imágenes.</p>
<ul>
<li class=""><code>react</code> Se admite React Native 0.87. Eliminó <code>InteractionManager</code>, así que las apps con esa versión fallaban en cuanto un componente llamaba a <code>useSuspense()</code>, <code>useFetch()</code> o <code>useDLE()</code>. En 0.87 y posteriores, Data Client espera tiempo de inactividad con <code>requestIdleCallback()</code>, como recomienda React Native (<a href="https://github.com/reactive/data-client/pull/4355" target="_blank" rel="noopener noreferrer" class="">#4355</a>)</li>
<li class=""><code>all</code> Se admite <code>@babel/runtime</code> 8: las apps con Babel 8 comparten su runtime con Data Client en lugar de instalar una segunda copia. Las apps con Babel 7 siguen funcionando (<a href="https://github.com/reactive/data-client/pull/4209" target="_blank" rel="noopener noreferrer" class="">#4209</a>)</li>
<li class=""><code>img</code> Se admite <code>@data-client/react</code> 0.19 (<a href="https://github.com/reactive/data-client/pull/4636" target="_blank" rel="noopener noreferrer" class="">#4636</a>)</li>
<li class=""><code>react</code> <strong>Corrección:</strong> Las apps de React Native ya no se congelan entre 0.5 y 3 s seguidos mientras leen un resultado grande cuyas entidades siguen actualizándose. Consulta <a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#native-gc" class="">Pausas de GC más cortas en React Native</a> (<a href="https://github.com/reactive/data-client/pull/4594" target="_blank" rel="noopener noreferrer" class="">#4594</a>)</li>
<li class=""><code>react</code> <strong>Corrección:</strong> En React Native, <a class="" href="https://dataclient.io/es/docs/api/useSuspense">useSuspense()</a>, <a class="" href="https://dataclient.io/es/docs/api/useFetch">useFetch()</a> y <a class="" href="https://dataclient.io/es/docs/api/useDLE">useDLE()</a> vuelven a obtener los datos al enfocar la pantalla solo cuando los datos actuales están obsoletos o son inválidos, en lugar de volver a obtener datos frescos en cada reenfoque (<a href="https://github.com/reactive/data-client/pull/4378" target="_blank" rel="noopener noreferrer" class="">#4378</a>)</li>
<li class=""><code>img</code> <strong>Corrección:</strong> El <code>import</code> de Node, y las herramientas que se ejecutan sobre él como Vitest, cargan la compilación ESM de <code>@data-client/img</code> en lugar de CommonJS (<a href="https://github.com/reactive/data-client/pull/4617" target="_blank" rel="noopener noreferrer" class="">#4617</a>)</li>
</ul>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="vue">Vue<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#vue" class="hash-link" aria-label="Enlace directo al Vue" title="Enlace directo al Vue" translate="no">​</a></h2>
<p>Los composables de Vue ahora manejan la caché, la recolección de basura y los errores como los hooks de React, así que un patrón que conoces de React funciona igual en Vue.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="vue-gc">Recolección de basura por defecto<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#vue-gc" class="hash-link" aria-label="Enlace directo al Recolección de basura por defecto" title="Enlace directo al Recolección de basura por defecto" translate="no">​</a></h3>
<p><code>vue</code></p>
<p>El <a class="" href="https://dataclient.io/es/vue/api/DataClientPlugin#gcPolicy">DataClientPlugin</a> de Vue solo eliminaba los datos sin uso si pasabas tú mismo un <code>gcPolicy</code>.
Ahora por defecto es <code>new GCPolicy()</code>, igual que el <a class="" href="https://dataclient.io/es/docs/api/DataProvider">DataProvider</a> de React, así que puedes
quitar la opción a menos que la personalices (<a href="https://github.com/reactive/data-client/pull/4148" target="_blank" rel="noopener noreferrer" class="">#4148</a>).</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> DataClientPlugin<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> GCPolicy <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/vue'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">app<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">use</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>DataClientPlugin<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> gcPolicy<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">GCPolicy</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() });</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> DataClientPlugin <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/vue'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">app<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">use</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>DataClientPlugin<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div></div></div></div></figure>
<p>Los datos se eliminan solo cuando ningún componente montado los lee <em>y</em> han pasado el doble de su tiempo de vigencia desde que se
obtuvieron (al menos dos minutos). Un barrido revisa cada cinco minutos. Todo lo que un componente vuelva a leer antes de eso
vuelve a estar en uso.</p>
<center><div style="max-width:640px"></div></center>
<p>Un componente que se monta después de la eliminación trata los datos como nunca obtenidos: <a class="" href="https://dataclient.io/es/vue/api/useSuspense">useSuspense()</a> los obtiene
de nuevo, mientras que <a class="" href="https://dataclient.io/es/vue/api/useCache">useCache()</a> devuelve <code>undefined</code>. Para conservar los datos sin uso por más tiempo o barrer con menos frecuencia,
pasa tu propio <a class="" href="https://dataclient.io/es/vue/api/DataClientPlugin#gcPolicy">gcPolicy</a>.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="vue-stale-while-revalidate">Stale-while-revalidate<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#vue-stale-while-revalidate" class="hash-link" aria-label="Enlace directo al Stale-while-revalidate" title="Enlace directo al Stale-while-revalidate" translate="no">​</a></h3>
<p><code>vue</code></p>
<p>Cuando un componente se monta con datos <a class="" href="https://dataclient.io/es/docs/concepts/expiry-policy#stale">obsoletos</a> pero todavía válidos, el
<a class="" href="https://dataclient.io/es/vue/api/useSuspense">useSuspense()</a> de Vue ahora los renderiza de inmediato y vuelve a obtenerlos en segundo plano, como React. Antes,
mostraba el fallback de <code>&lt;Suspense&gt;</code> hasta que terminaba el refetch (<a href="https://github.com/reactive/data-client/pull/4169" target="_blank" rel="noopener noreferrer" class="">#4169</a>).</p>
<center><video width="720" controls="" muted="" playsinline="" loop="" aria-label="Dos componentes de Vue lado a lado, antes y después de v0.19. Ambos muestran Loading en el primer montaje. Tras desmontar y esperar a que el precio quede obsoleto, volver a montar muestra Loading otra vez en la versión anterior, mientras que la versión nueva muestra de inmediato el precio obsoleto y lo vuelve a obtener en segundo plano."><source src="/es/videos/blog/vue-suspense-stale.mp4" type="video/mp4">Dos componentes de Vue lado a lado, antes y después de v0.19. Ambos muestran Loading en el primer montaje. Tras desmontar y esperar a que el precio quede obsoleto, volver a montar muestra Loading otra vez en la versión anterior, mientras que la versión nueva muestra de inmediato el precio obsoleto y lo vuelve a obtener en segundo plano.</video></center>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="vue-getter-args">Corrección: argumentos getter<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#vue-getter-args" class="hash-link" aria-label="Enlace directo al Corrección: argumentos getter" title="Enlace directo al Corrección: argumentos getter" translate="no">​</a></h3>
<p><code>vue</code></p>
<p>Los composables de Vue como <a class="" href="https://dataclient.io/es/vue/api/useSuspense">useSuspense()</a> y <a class="" href="https://dataclient.io/es/vue/api/useLive">useLive()</a> estaban tipados para aceptar una
función getter como argumento, pero pasaban la función misma al endpoint en lugar de llamarla. Ahora los getters
funcionan igual que los refs y <code>computed</code>, y el composable vuelve a obtener los datos cuando cambia cualquier cosa que lea el getter
(<a href="https://github.com/reactive/data-client/pull/4115" target="_blank" rel="noopener noreferrer" class="">#4115</a>). Quita el envoltorio <code>computed()</code> si solo lo usabas para hacer reactivos los
argumentos:</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> computed <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'vue'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> props <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token generic-function function" style="color:rgb(130, 170, 255)">defineProps</span><span class="token generic-function generic class-name operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token generic-function generic class-name punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token generic-function generic class-name" style="color:rgb(255, 203, 107)"> id</span><span class="token generic-function generic class-name operator" style="color:rgb(137, 221, 255)">: </span><span class="token generic-function generic class-name builtin" style="color:rgb(130, 170, 255)">number </span><span class="token generic-function generic class-name punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token generic-function generic class-name operator" style="color:rgb(137, 221, 255)">&gt;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> article <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">await </span><span class="token function" style="color:rgb(130, 170, 255)">useSuspense</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  ArticleResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">computed</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(() </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> id<span class="token operator" style="color:rgb(137, 221, 255)">:</span> props<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>id <span class="token punctuation" style="color:rgb(199, 146, 234)">})),</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> props <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token generic-function function" style="color:rgb(130, 170, 255)">defineProps</span><span class="token generic-function generic class-name operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token generic-function generic class-name punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token generic-function generic class-name" style="color:rgb(255, 203, 107)"> id</span><span class="token generic-function generic class-name operator" style="color:rgb(137, 221, 255)">: </span><span class="token generic-function generic class-name builtin" style="color:rgb(130, 170, 255)">number </span><span class="token generic-function generic class-name punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token generic-function generic class-name operator" style="color:rgb(137, 221, 255)">&gt;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> article <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">await </span><span class="token function" style="color:rgb(130, 170, 255)">useSuspense</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>ArticleResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">, () </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  id<span class="token operator" style="color:rgb(137, 221, 255)">:</span> props<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>id<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}));</span><br></div></code></pre></div></div></div></div></div></figure>
<p>Esto aplica a todos los composables que reciben argumentos de endpoint: <a class="" href="https://dataclient.io/es/vue/api/useSuspense">useSuspense()</a>,
<a class="" href="https://dataclient.io/es/vue/api/useLive">useLive()</a>, <a class="" href="https://dataclient.io/es/vue/api/useCache">useCache()</a>, <a class="" href="https://dataclient.io/es/vue/api/useDLE">useDLE()</a>,
<a class="" href="https://dataclient.io/es/vue/api/useFetch">useFetch()</a>, <a class="" href="https://dataclient.io/es/vue/api/useQuery">useQuery()</a> y <a class="" href="https://dataclient.io/es/vue/api/useSubscription">useSubscription()</a>.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="vue-fixes">Otros cambios de Vue<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#vue-fixes" class="hash-link" aria-label="Enlace directo al Otros cambios de Vue" title="Enlace directo al Otros cambios de Vue" translate="no">​</a></h3>
<ul>
<li class=""><code>vue</code> Se exporta <code>GCPolicy</code> desde <code>@data-client/vue</code>, así que un <code>gcPolicy</code> personalizado ya no necesita <code>@data-client/core</code> (<a href="https://github.com/reactive/data-client/pull/4143" target="_blank" rel="noopener noreferrer" class="">#4143</a>)</li>
<li class=""><code>vue</code> Se exporta <code>__INTERNAL__</code>, como en <code>@data-client/react</code>, para que las herramientas puedan usar <code>createReducer</code> e <code>initialState</code> sin depender de <code>@data-client/core</code> (<a href="https://github.com/reactive/data-client/pull/4270" target="_blank" rel="noopener noreferrer" class="">#4270</a>)</li>
<li class=""><code>vue</code> <strong>Corrección:</strong> <a class="" href="https://dataclient.io/es/vue/api/useSuspense">useSuspense()</a> y <a class="" href="https://dataclient.io/es/vue/api/useLive">useLive()</a> conservan los datos anteriores mientras cargan los argumentos nuevos, en lugar de devolver <code>undefined</code> (<a href="https://github.com/reactive/data-client/pull/4131" target="_blank" rel="noopener noreferrer" class="">#4131</a>)</li>
<li class=""><code>vue</code> <strong>Corrección:</strong> <a class="" href="https://dataclient.io/es/vue/api/useSuspense">useSuspense()</a> y <a class="" href="https://dataclient.io/es/vue/api/useLive">useLive()</a> envían los errores de fetch posteriores a un cambio de argumentos a <code>onErrorCaptured()</code> en lugar de a un rechazo de promesa no manejado (<a href="https://github.com/reactive/data-client/pull/4135" target="_blank" rel="noopener noreferrer" class="">#4135</a>)</li>
<li class=""><code>vue</code> <strong>Corrección:</strong> <a class="" href="https://dataclient.io/es/vue/api/useSuspense">useSuspense()</a>, <a class="" href="https://dataclient.io/es/vue/api/useDLE">useDLE()</a> y <a class="" href="https://dataclient.io/es/vue/api/useFetch">useFetch()</a> ya no vuelven a obtener datos obsoletos en cada actualización del store, así que un <code>controller.set()</code> no se sobrescribe (<a href="https://github.com/reactive/data-client/pull/4134" target="_blank" rel="noopener noreferrer" class="">#4134</a>)</li>
<li class=""><code>vue</code> <strong>Corrección:</strong> <a class="" href="https://dataclient.io/es/vue/api/useDLE">useDLE()</a> y <a class="" href="https://dataclient.io/es/vue/api/useCache">useCache()</a> conservan los datos <code>invalidIfStale</code> caducados durante actualizaciones del store no relacionadas, en lugar de quedarse cargando (<a href="https://github.com/reactive/data-client/pull/4142" target="_blank" rel="noopener noreferrer" class="">#4142</a>)</li>
<li class=""><code>vue</code> <strong>Corrección:</strong> <a class="" href="https://dataclient.io/es/vue/api/useFetch">useFetch()</a> evita que sus datos se recolecten como basura mientras está montado, como <a class="" href="https://dataclient.io/es/vue/api/useSuspense">useSuspense()</a>, así que un <code>gcPolicy</code> configurado ya no expulsa datos precargados que los componentes leen después (<a href="https://github.com/reactive/data-client/pull/4152" target="_blank" rel="noopener noreferrer" class="">#4152</a>)</li>
<li class=""><code>vue</code> <strong>Corrección:</strong> <a class="" href="https://dataclient.io/es/vue/api/useFetch">useFetch()</a> está tipado como el <code>Ref</code> de solo lectura que devuelve, así que <code>promise.resolved</code> (siempre <code>undefined</code>) ahora es un error de TypeScript; lee <code>promise.value.resolved</code> en su lugar (<a href="https://github.com/reactive/data-client/pull/4114" target="_blank" rel="noopener noreferrer" class="">#4114</a>)</li>
<li class=""><code>vue</code> <strong>Corrección:</strong> <code>DataClientPlugin</code> se instala en versiones de Vue anteriores a 3.5 en lugar de lanzar <code>app.onUnmount is not a function</code> (<a href="https://github.com/reactive/data-client/pull/4146" target="_blank" rel="noopener noreferrer" class="">#4146</a>)</li>
</ul>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="collection-updates">Actualizaciones de Collection<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#collection-updates" class="hash-link" aria-label="Enlace directo al Actualizaciones de Collection" title="Enlace directo al Actualizaciones de Collection" translate="no">​</a></h2>
<p>Las listas fallan en los bordes: un elemento aparece dos veces, cae en el lugar equivocado, o una respuesta tardía descarta una actualización.</p>
<p><a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#push">push</a>, <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#unshift">unshift</a>, <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#remove">remove</a>,
<a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#move">move</a> y <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#getpage">getPage</a> ahora manejan todos los casos: un elemento o
una lista, una <a class="" href="https://dataclient.io/es/rest/api/Collection">Collection</a> simple u ordenada, y respuestas en cualquier orden.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="push-list">Listas de elementos<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#push-list" class="hash-link" aria-label="Enlace directo al Listas de elementos" title="Enlace directo al Listas de elementos" translate="no">​</a></h3>
<p><code>rest</code> <code>endpoint</code> <code>graphql</code> <code>react</code> <code>vue</code></p>
<p>Envía un array a <code>push</code> o <code>unshift</code> para crear todos los elementos, o a <code>remove</code> para eliminarlos. Ahora el array llega al
servidor como JSON en lugar de <code>"[object Object]"</code>, y el <code>resource().create</code> obsoleto también acepta un array
(<a href="https://github.com/reactive/data-client/pull/4262" target="_blank" rel="noopener noreferrer" class="">#4262</a>).</p>
<p><a class="" href="https://dataclient.io/es/docs/api/Controller#fetch">Controller.fetch()</a> tipaba el resultado como un solo elemento, aunque es un array. Leer el array
era un error de TypeScript, mientras que <code>created.id</code> compilaba y era <code>undefined</code> en tiempo de ejecución. Ahora el resultado es un array, así que el
cast puede desaparecer (<a href="https://github.com/reactive/data-client/pull/4421" target="_blank" rel="noopener noreferrer" class="">#4421</a>):</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> useController <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> TodoResource<span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token keyword" style="font-style:italic">type </span><span class="token class-name" style="color:rgb(255, 203, 107)">Todo </span><span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'./TodoResource'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export function </span><span class="token function" style="color:rgb(130, 170, 255)">useImportTodos</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">const</span> ctrl <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useController</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">return async </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>titles<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[]) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">const</span> todos <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">await</span> ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">      TodoResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>getList<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>push<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      titles<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">map</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>title <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> title <span class="token punctuation" style="color:rgb(199, 146, 234)">})),</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">)) </span><span class="token keyword" style="font-style:italic">as </span><span class="token builtin" style="color:rgb(130, 170, 255)">unknown </span><span class="token keyword" style="font-style:italic">as</span> Todo<span class="token punctuation" style="color:rgb(199, 146, 234)">[];</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return</span> todos<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">map</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>todo <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> todo<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>id<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> useController <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> TodoResource <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'./TodoResource'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export function </span><span class="token function" style="color:rgb(130, 170, 255)">useImportTodos</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">const</span> ctrl <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useController</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">return async </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>titles<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[]) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">const</span> todos <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">await</span> ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">      TodoResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>getList<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>push<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      titles<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">map</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>title <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> title <span class="token punctuation" style="color:rgb(199, 146, 234)">})),</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return</span> todos<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">map</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>todo <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> todo<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>id<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<p>Una lista se tipa como array en cualquier endpoint cuyo schema sea el <code>push</code> o <code>unshift</code> de una Collection, como el
<code>resource().create</code> obsoleto o tu propio <code>new RestEndpoint()</code> con un schema <a class="" href="https://dataclient.io/es/rest/api/Collection#push">Collection.push</a>. Un
solo elemento, <code>FormData</code> o un body tipado <code>any</code> se sigue tipando como un solo elemento.</p>
<p><a class="" href="https://dataclient.io/es/docs/api/Controller#set">Controller.set()</a> con <a class="" href="https://dataclient.io/es/rest/api/Collection#push">Collection.push</a> o <code>unshift</code> ahora recibe
los args de la Collection, que eligen las listas a las que agregar, y una fila o una lista de filas. Antes, recibía los
campos de la Entity, así que los args necesitaban un cast y cada fila su propia llamada:</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">function </span><span class="token function" style="color:rgb(130, 170, 255)">addTodos</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>ctrl<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Controller<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> userId<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> todos<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Todo<span class="token punctuation" style="color:rgb(199, 146, 234)">[]) {</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">for </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">const</span> todo <span class="token keyword" style="font-style:italic">of</span> todos<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">    ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">set</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>TodoResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>getList<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>push<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> userId <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">as </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> todo<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">function </span><span class="token function" style="color:rgb(130, 170, 255)">addTodos</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>ctrl<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Controller<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> userId<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> todos<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Todo<span class="token punctuation" style="color:rgb(199, 146, 234)">[]) {</span><br></div><div class="token-line">  ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">set</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>TodoResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>getList<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>push<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> userId <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span> todos<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<p>Un actualizador (<code>previous =&gt; value</code>) ahora es un error de TypeScript ahí, ya que una fila agregada no tiene valor previo y
la función nunca se ejecutaba. Llamado sin args, <code>push</code> agrega solo a las listas sin claves de filtro, en lugar de lanzar un error y
descartar la escritura cuando hay una lista filtrada en el store.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="query-collection-push">Corrección: Collections ordenadas y lazy<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#query-collection-push" class="hash-link" aria-label="Enlace directo al Corrección: Collections ordenadas y lazy" title="Enlace directo al Corrección: Collections ordenadas y lazy" translate="no">​</a></h3>
<p><code>rest</code></p>
<p>Envolver una <a class="" href="https://dataclient.io/es/rest/api/Collection">Collection</a> en una <a class="" href="https://dataclient.io/es/rest/api/Query">Query</a> para ordenarla o filtrarla hacía que
<a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#push">push</a>, <code>unshift</code> y <code>remove</code> rechazaran todos los bodies excepto <code>FormData</code>, aunque agregan a la
lista en tiempo de ejecución. Ahora el body se tipa desde la Entity de la Collection, así que el cast puede desaparecer y un campo incorrecto es un
error de TypeScript. Lo mismo aplica a una Collection envuelta en <a class="" href="https://dataclient.io/es/rest/api/Lazy">Lazy</a>
(<a href="https://github.com/reactive/data-client/pull/4226" target="_blank" rel="noopener noreferrer" class="">#4226</a>).</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> useController <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> getPosts <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'./getPosts'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export function </span><span class="token function" style="color:rgb(130, 170, 255)">useAddPost</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">const</span> ctrl <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useController</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">return </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>title<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> author<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span><br></div><div class="token-line">    ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>getPosts<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>push<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> group<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'react' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}, {</span> title<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> author <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">as </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> useController <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> getPosts <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'./getPosts'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export function </span><span class="token function" style="color:rgb(130, 170, 255)">useAddPost</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">const</span> ctrl <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useController</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">return </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>title<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> author<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span><br></div><div class="token-line">    ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>getPosts<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>push<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> group<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'react' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}, {</span> title<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> author <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<p>donde <code>getPosts</code> ordena su Collection con una Query:</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">getPosts.ts</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> Collection<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> Entity<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> Query<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> RestEndpoint <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export class </span><span class="token class-name" style="color:rgb(255, 203, 107)">Post </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  id <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  title <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  group <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  author <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export const</span> getPosts <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/:group/posts'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  searchParams<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{} </span><span class="token keyword" style="font-style:italic">as </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> orderBy<span class="token operator" style="color:rgb(137, 221, 255)">?: </span><span class="token string" style="color:rgb(195, 232, 141)">'title' </span><span class="token operator" style="color:rgb(137, 221, 255)">| </span><span class="token string" style="color:rgb(195, 232, 141)">'author' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">Query</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">Collection</span><span class="token punctuation" style="color:rgb(199, 146, 234)">([</span>Post<span class="token punctuation" style="color:rgb(199, 146, 234)">], {</span> nonFilterArgumentKeys<span class="token operator" style="color:rgb(137, 221, 255)">: </span>/orderBy/ <span class="token punctuation" style="color:rgb(199, 146, 234)">}),</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>posts<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> orderBy <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> orderBy<span class="token operator" style="color:rgb(137, 221, 255)">?: </span><span class="token string" style="color:rgb(195, 232, 141)">'title' </span><span class="token operator" style="color:rgb(137, 221, 255)">| </span><span class="token string" style="color:rgb(195, 232, 141)">'author' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{}) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span><br></div><div class="token-line">      orderBy <span class="token operator" style="color:rgb(137, 221, 255)">?</span><br></div><div class="token-line">        <span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token operator" style="color:rgb(137, 221, 255)">...</span>posts<span class="token punctuation" style="color:rgb(199, 146, 234)">].</span><span class="token function" style="color:rgb(130, 170, 255)">sort</span><span class="token punctuation" style="color:rgb(199, 146, 234)">((</span>a<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> b<span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> a<span class="token punctuation" style="color:rgb(199, 146, 234)">[</span>orderBy<span class="token punctuation" style="color:rgb(199, 146, 234)">].</span><span class="token function" style="color:rgb(130, 170, 255)">localeCompare</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>b<span class="token punctuation" style="color:rgb(199, 146, 234)">[</span>orderBy<span class="token punctuation" style="color:rgb(199, 146, 234)">]))</span><br></div><div class="token-line">      <span class="token operator" style="color:rgb(137, 221, 255)">:</span> posts<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">),</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="collection-order">Corrección: elementos vueltos a agregar y respuestas tardías<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#collection-order" class="hash-link" aria-label="Enlace directo al Corrección: elementos vueltos a agregar y respuestas tardías" title="Enlace directo al Corrección: elementos vueltos a agregar y respuestas tardías" translate="no">​</a></h3>
<p><code>rest</code> <code>endpoint</code> <code>graphql</code></p>
<p>Las actualizaciones de Collection ahora muestran cada elemento una sola vez, en su lugar. No necesitas cambiar código.</p>
<ul>
<li class="">Un elemento que eliminas y luego vuelves a agregar con <code>push</code> o <code>unshift</code> se muestra una vez, no dos
(<a href="https://github.com/reactive/data-client/pull/4487" target="_blank" rel="noopener noreferrer" class="">#4487</a>).</li>
<li class="">Una actualización que se resuelve después de un refetch más reciente de su lista se sigue aplicando a esa lista
(<a href="https://github.com/reactive/data-client/pull/4566" target="_blank" rel="noopener noreferrer" class="">#4566</a>). <code>push</code> agrega al final, <code>remove</code> y <code>move</code> cambian solo
su elemento, y <code>getPage</code> agrega debajo de la primera página.</li>
<li class="">Un create muestra su elemento una sola vez cuando un fetch de la lista empieza justo después, en el mismo milisegundo, y ya tiene el
elemento (<a href="https://github.com/reactive/data-client/pull/4677" target="_blank" rel="noopener noreferrer" class="">#4677</a>).</li>
</ul>
<p>Elimina la taza y luego deshaz. La repetición de v0.18 la lista dos veces. El carrito en vivo de v0.19 la lista una sola vez:</p>
<div data-playground="true" class="playgroundQueryContainer_vBqa"><div class="playgroundContainer_sLUA row_YGZs" data-comparing="true" data-store-host="true"><!--&--><div class="previewWrapper_edd2 beforeFolder_PLjB" data-before="true"><div class="playgroundHeader_Zx4K previewHeader_MW_M"><span class="liveLabel_MHnJ beforeLabel_bjkP">v0.18</span></div><div class="playgroundResult_tefG"><div class="playground-preview playgroundPreview_rk9R" inert=""><div class="sheet_FVCk sheet"><header class="appHeader"><h1 class="appTitle">Daily Grind</h1><span class="meta">3<!-- --> in cart</span></header><div class="list"><div class="listItem"><div>House blend<div class="meta">2<!-- --> × <!-- -->$16.00</div></div><span class="value">$32.00</span><button type="button" class="cancel" aria-label="Remove House blend"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"></path></svg></button></div><div class="listItem"><div>Ceramic mug<div class="meta">1<!-- --> × <!-- -->$12.00</div></div><span class="value">$12.00</span><button type="button" class="cancel" aria-label="Remove Ceramic mug"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"></path></svg></button></div><div class="listItem"><div>Paper filters<div class="meta">1<!-- --> × <!-- -->$4.00</div></div><span class="value">$4.00</span><button type="button" class="cancel" aria-label="Remove Paper filters"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"></path></svg></button></div></div><div class="toaster" role="status"></div></div></div><div class="endScreen_rnDE" inert=""><div class="endControls_PI48"><button type="button" class="clean-btn endButton_gK5Z" data-autorun-control="true"><svg viewBox="0 0 24 24" width="0.85em" height="0.85em" aria-hidden="true"><path d="M7 4.5v15l12.5-7.5z" fill="currentColor"></path></svg>Reproducir</button><button type="button" class="clean-btn endButton_gK5Z"><svg viewBox="0 0 24 24" width="1.15em" height="1.15em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m8 7-5 5 5 5M16 7l5 5-5 5M14 4l-4 16"></path></svg>Mostrar el código</button></div></div></div></div><!--/&--><div class="playgroundTextEdit_rt2K"><div class="playgroundHeader_Zx4K noupper_WDCF tabControls_trxh"><div class="tabs_m54V" role="tablist" aria-orientation="horizontal" aria-label="Archivos"><div role="tab" aria-selected="false" tabindex="-1" class="tab_bTGw">v0.18</div><div role="tab" aria-selected="false" tabindex="-1" class="tab_bTGw">resources/Cart</div><div role="tab" aria-selected="true" tabindex="0" class="tab_bTGw selected_QXZk">CartPage</div></div></div><div class="editorDocs_INVk"><div class="playgroundEditor_lYwu hidden_Hh8i"></div><div class="playgroundEditor_lYwu"><pre>import { useController, useSuspense } from '@data-client/react';
import { type CartItem, CartResource, usd } from './resources/Cart';

function CartPage() {
  const ctrl = useController();
  const items = useSuspense(CartResource.getList);
  const remove = (item: CartItem) =&gt; {
    ctrl.fetch(CartResource.delete, { id: item.id });
    toast.info(`${item.product.name} removed`, {
      label: 'Undo',
      onClick: () =&gt; ctrl.fetch(CartResource.getList.push, item),
    });
  };

  return (
    &lt;&gt;
      &lt;header className="appHeader"&gt;
        &lt;h1 className="appTitle"&gt;Daily Grind&lt;/h1&gt;
        &lt;span className="meta"&gt;{items.length} in cart&lt;/span&gt;
      &lt;/header&gt;
      &lt;div className="list"&gt;
        &lt;Reorder layoutDependency={items}&gt;
          {items.map(item =&gt; (
            &lt;CartRow key={item.id} item={item} onRemove={remove} /&gt;
          ))}
        &lt;/Reorder&gt;
      &lt;/div&gt;
      &lt;Toaster /&gt;
    &lt;/&gt;
  );
}

function CartRow({ item, onRemove }: Props) {
  return (
    &lt;div className="listItem" ref={useReorderItem(item.id)}&gt;
      &lt;div&gt;
        {item.product.name}
        &lt;div className="meta"&gt;
          {item.quantity} × {usd(item.product.price)}
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;span className="value"&gt;{usd(item.total)}&lt;/span&gt;
      &lt;CancelButton
        label={`Remove ${item.product.name}`}
        onClick={() =&gt; onRemove(item)}
      /&gt;
    &lt;/div&gt;
  );
}
interface Props {
  item: CartItem;
  onRemove: (item: CartItem) =&gt; void;
}
render(&lt;CartPage /&gt;);</pre></div></div></div><div class="previewWrapper_edd2 wide-embed-part"><div class="playgroundHeader_Zx4K previewHeader_MW_M"><span class="liveLabel_MHnJ"><span class="liveLabelText_k6qc">Vista previa en vivo</span></span><span class="routerSlot_CTii"></span><span class="previewControls_oxCt"><button type="button" class="clean-btn headerButton_h2KM fixturesToggle_OTR0" title="Fixtures" aria-label="Fixtures" aria-expanded="false" aria-controls="_R_dkballq9_"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 20V4"></path><path d="m3 8 4-4 4 4"></path><path d="M17 4v16"></path><path d="m21 16-4 4-4-4"></path></svg></button><button type="button" class="clean-btn headerButton_h2KM resetButton_knTA" title="Reiniciar la vista previa" aria-label="Reiniciar la vista previa" disabled=""><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 12a9 9 0 1 0 2.64-6.36L3 8.3"></path><path d="M3 3v5.3h5.3"></path></svg></button></span></div><div class="fixturesAnchor_fieO"><div id="_R_dkballq9_" class="fixturesPopover_bQwj wide-embed-part"></div></div><div class="playgroundResult_tefG"><div class="playground-preview playgroundPreview_rk9R"><div class="sheet_FVCk sheet" aria-busy="true"><div class="skeletonPage" role="status" aria-label="Loading"><span class="skeleton"></span><span class="skeleton"></span><span class="skeleton"></span><span class="skeleton"></span></div></div></div><div class="quickLookHost_EhLO stageHues_MizR"></div></div></div><div id="_R_4ballq9_" class="storeHost_N0SU"><div class="storeDrawer_Jaf2"><div class="drawerTabs_MT7c" role="tablist" aria-orientation="vertical"><button type="button" role="tab" class="clean-btn storeTab_EY4O" title="Mostrar acciones" aria-label="Acciones" aria-selected="false" tabindex="-1" aria-controls="_R_4ballq9_" data-store-toggle="actions"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13 12h8M13 18h8M13 6h8M3 12h1M3 18h1M3 6h1M8 12h1M8 18h1M8 6h1"></path></svg></button><button type="button" role="tab" class="clean-btn storeTab_EY4O" title="Mostrar el store" aria-label="Store" aria-selected="false" tabindex="0" aria-controls="_R_4ballq9_" data-store-toggle="store"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><ellipse cx="12" cy="5" rx="8" ry="3"></ellipse><path d="M4 5v14c0 1.66 3.58 3 8 3s8-1.34 8-3V5"></path><path d="M4 12c0 1.66 3.58 3 8 3s8-1.34 8-3"></path></svg></button></div></div></div></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="rest-changes">Otros cambios de REST<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#rest-changes" class="hash-link" aria-label="Enlace directo al Otros cambios de REST" title="Enlace directo al Otros cambios de REST" translate="no">​</a></h3>
<ul>
<li class=""><code>rest</code> <strong>Corrección:</strong> Un endpoint <code>DELETE</code> que declara <code>body</code> lo envía. Antes, la petición salía sin body y el último argumento pasaba a ser parámetros de URL (<code>DELETE /posts?0=5&amp;1=13</code>). Si llamas a un endpoint así sin body, quita <code>body</code> o define <code>body: undefined</code> (<a href="https://github.com/reactive/data-client/pull/4528" target="_blank" rel="noopener noreferrer" class="">#4528</a>)</li>
<li class=""><code>rest</code> <strong>Corrección:</strong> el <code>delete</code> de <a class="" href="https://dataclient.io/es/rest/api/resource">resource()</a> ejecuta el <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#process">process()</a> de tu clase <code>Endpoint</code>, o la opción <code>process</code> del resource. Antes, <code>delete</code> definía su propio <code>process()</code>, que reemplazaba al de la clase base, así que una clase base que desenvolvía <code>{ "data": ... }</code> o convertía el formato de las claves devolvía el body sin procesar solo en <code>delete</code>. Un body vacío, o uno que tu <code>process()</code> vacía, sigue convirtiéndose en los params (<a href="https://github.com/reactive/data-client/pull/4698" target="_blank" rel="noopener noreferrer" class="">#4698</a>)</li>
</ul>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="validation">Validación<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#validation" class="hash-link" aria-label="Enlace directo al Validación" title="Enlace directo al Validación" translate="no">​</a></h2>
<p>Los errores son más baratos de corregir cuando los detecta TypeScript, una prueba o una advertencia de desarrollo, antes de que los vea un usuario.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="types">Seguridad de tipos<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#types" class="hash-link" aria-label="Enlace directo al Seguridad de tipos" title="Enlace directo al Seguridad de tipos" translate="no">​</a></h3>
<p>Un valor incorrecto que compila aparece después como datos erróneos o <code>undefined</code>. Un cast sobre código correcto oculta el siguiente error real.</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="typed-set">Valores tipados de set()<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#typed-set" class="hash-link" aria-label="Enlace directo al Valores tipados de set()" title="Enlace directo al Valores tipados de set()" translate="no">​</a></h4>
<p><code>react</code> <code>vue</code></p>
<p><a class="" href="https://dataclient.io/es/docs/api/Controller#set">Controller.set()</a> antes aceptaba cualquier valor para un schema, así que un error tipográfico o un
tipo de campo incorrecto solo aparecía como datos erróneos en tiempo de ejecución. Ahora los valores se tipan según el schema: una
<a class="" href="https://dataclient.io/es/rest/api/Entity">Entity</a> recibe sus campos, mientras que una <a class="" href="https://dataclient.io/es/rest/api/Collection">Collection</a>, <a class="" href="https://dataclient.io/es/rest/api/All">All</a> o
Array recibe una lista de filas. Todos los campos son opcionales, ya que <code>set()</code> se combina con lo que ya está almacenado, y
los números y las cadenas son intercambiables, igual que en las respuestas de la API.
<a href="https://github.com/reactive/data-client/pull/4133" target="_blank" rel="noopener noreferrer" class="">#4133</a></p>
<p>Pasa el cursor sobre los subrayados rojos para ver cada error.</p>
<div class="playgroundQueryContainer_vBqa"><div class="playgroundContainer_sLUA standaloneEditor_OHub row_YGZs"><div class="playgroundTextEdit_rt2K"><div class="playgroundHeader_Zx4K noupper_WDCF tabControls_trxh small_xksL"><div class="tabs_m54V" role="tablist" aria-orientation="horizontal" aria-label="Archivos"><div role="tab" aria-selected="false" tabindex="-1" class="tab_bTGw">Todo</div><div role="tab" aria-selected="true" tabindex="0" class="tab_bTGw selected_QXZk">updateTodos</div></div></div><div class="editorDocs_INVk"><div class="playgroundEditor_lYwu hidden_Hh8i"></div><div class="playgroundEditor_lYwu"><div><pre class="prism-code language-ts" style="margin:0;outline:none;padding:10px;font-family:inherit;color:#bfc7d5;background-color:transparent" spellcheck="false"><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import type </span><span class="token punctuation" style="color:#c792ea">{ </span><span class="token class-name" style="color:#ffcb6b">Controller </span><span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'@data-client/react'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token punctuation" style="color:#c792ea">{ </span>schema <span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'@data-client/rest'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token punctuation" style="color:#c792ea">{ </span><span class="token class-name" style="color:#ffcb6b">Todo</span><span class="token punctuation" style="color:#c792ea">, </span><span class="token class-name" style="color:#ffcb6b">TodoResource </span><span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'./Todo'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">
</span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">export function </span>updateTodos<span class="token punctuation" style="color:#c792ea">(</span>ctrl<span class="token punctuation" style="color:#c792ea">: </span><span class="token class-name" style="color:#ffcb6b">Controller</span><span class="token punctuation" style="color:#c792ea">) {
</span></span><span class="token-line">  <span class="token comment" style="color:#697098;font-style:italic">// ✅ rows are partial Todos; ids may be strings or numbers
</span></span><span class="token-line">  ctrl<span class="token punctuation" style="color:#c792ea">.</span><span class="token keyword" style="color:#7da4f6;font-style:italic">set</span><span class="token punctuation" style="color:#c792ea">(</span><span class="token class-name" style="color:#ffcb6b">TodoResource</span><span class="token punctuation" style="color:#c792ea">.</span>getList<span class="token punctuation" style="color:#c792ea">.</span>schema<span class="token punctuation" style="color:#c792ea">, [{ </span>id<span class="token punctuation" style="color:#c792ea">: </span><span class="token string" style="color:#b6d986">'5'</span><span class="token punctuation" style="color:#c792ea">, </span>completed<span class="token punctuation" style="color:#c792ea">: </span><span class="token keyword" style="color:#7da4f6;font-style:italic">true </span><span class="token punctuation" style="color:#c792ea">}]);
</span></span><span class="token-line">  ctrl<span class="token punctuation" style="color:#c792ea">.</span><span class="token keyword" style="color:#7da4f6;font-style:italic">set</span><span class="token punctuation" style="color:#c792ea">(</span><span class="token class-name" style="color:#ffcb6b">Todo</span><span class="token punctuation" style="color:#c792ea">, { </span>id<span class="token punctuation" style="color:#c792ea">: </span><span class="token number" style="color:#f78c6c">5 </span><span class="token punctuation" style="color:#c792ea">}, </span>todo <span class="token punctuation" style="color:#c792ea">=&gt; ({ </span>completed<span class="token punctuation" style="color:#c792ea">: !</span>todo<span class="token punctuation" style="color:#c792ea">.</span>completed <span class="token punctuation" style="color:#c792ea">}));
</span></span><span class="token-line">  ctrl<span class="token punctuation" style="color:#c792ea">.</span><span class="token keyword" style="color:#7da4f6;font-style:italic">set</span><span class="token punctuation" style="color:#c792ea">([</span><span class="token class-name" style="color:#ffcb6b">Todo</span><span class="token punctuation" style="color:#c792ea">], [{ </span>id<span class="token punctuation" style="color:#c792ea">: </span><span class="token number" style="color:#f78c6c">1</span><span class="token punctuation" style="color:#c792ea">, </span>title<span class="token punctuation" style="color:#c792ea">: </span><span class="token string" style="color:#b6d986">'first' </span><span class="token punctuation" style="color:#c792ea">}, { </span>id<span class="token punctuation" style="color:#c792ea">: </span><span class="token number" style="color:#f78c6c">2 </span><span class="token punctuation" style="color:#c792ea">}]);
</span></span><span class="token-line">
</span><span class="token-line">  <span class="token comment" style="color:#697098;font-style:italic">// ❌ All takes a list of rows
</span></span><span class="token-line">  ctrl<span class="token punctuation" style="color:#c792ea">.</span><span class="token keyword" style="color:#7da4f6;font-style:italic">set</span><span class="token punctuation" style="color:#c792ea">(</span><span class="token keyword" style="color:#7da4f6;font-style:italic">new </span>schema<span class="token punctuation" style="color:#c792ea">.</span><span class="token class-name" style="color:#ffcb6b">All</span><span class="token punctuation" style="color:#c792ea">(</span><span class="token class-name" style="color:#ffcb6b">Todo</span><span class="token punctuation" style="color:#c792ea">), </span><span class="token number" style="color:#f78c6c">42</span><span class="token punctuation" style="color:#c792ea">);
</span></span><span class="token-line">  <span class="token comment" style="color:#697098;font-style:italic">// ❌ completed is a boolean
</span></span><span class="token-line">  ctrl<span class="token punctuation" style="color:#c792ea">.</span><span class="token keyword" style="color:#7da4f6;font-style:italic">set</span><span class="token punctuation" style="color:#c792ea">(</span><span class="token class-name" style="color:#ffcb6b">Todo</span><span class="token punctuation" style="color:#c792ea">, { </span>id<span class="token punctuation" style="color:#c792ea">: </span><span class="token number" style="color:#f78c6c">5 </span><span class="token punctuation" style="color:#c792ea">}, { </span>id<span class="token punctuation" style="color:#c792ea">: </span><span class="token number" style="color:#f78c6c">5</span><span class="token punctuation" style="color:#c792ea">, </span>completed<span class="token punctuation" style="color:#c792ea">: </span><span class="token string" style="color:#b6d986">'yes' </span><span class="token punctuation" style="color:#c792ea">});
</span></span><span class="token-line">  <span class="token comment" style="color:#697098;font-style:italic">// ❌ Todo has no done field
</span></span><span class="token-line">  ctrl<span class="token punctuation" style="color:#c792ea">.</span><span class="token keyword" style="color:#7da4f6;font-style:italic">set</span><span class="token punctuation" style="color:#c792ea">(</span><span class="token class-name" style="color:#ffcb6b">TodoResource</span><span class="token punctuation" style="color:#c792ea">.</span>getList<span class="token punctuation" style="color:#c792ea">.</span>schema<span class="token punctuation" style="color:#c792ea">, [{ </span>id<span class="token punctuation" style="color:#c792ea">: </span><span class="token number" style="color:#f78c6c">5</span><span class="token punctuation" style="color:#c792ea">, </span>done<span class="token punctuation" style="color:#c792ea">: </span><span class="token keyword" style="color:#7da4f6;font-style:italic">true </span><span class="token punctuation" style="color:#c792ea">}]);
</span></span><span class="token-line">  <span class="token comment" style="color:#697098;font-style:italic">// ❌ updaters must return Todo fields
</span></span><span class="token-line">  ctrl<span class="token punctuation" style="color:#c792ea">.</span><span class="token keyword" style="color:#7da4f6;font-style:italic">set</span><span class="token punctuation" style="color:#c792ea">(</span><span class="token class-name" style="color:#ffcb6b">Todo</span><span class="token punctuation" style="color:#c792ea">, { </span>id<span class="token punctuation" style="color:#c792ea">: </span><span class="token number" style="color:#f78c6c">5 </span><span class="token punctuation" style="color:#c792ea">}, </span>todo <span class="token punctuation" style="color:#c792ea">=&gt; ({ </span>title<span class="token punctuation" style="color:#c792ea">: </span>todo<span class="token punctuation" style="color:#c792ea">.</span>completed <span class="token punctuation" style="color:#c792ea">}));
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">}
</span></span></pre></div></div></div></div></div></div>
<p>Una <a class="" href="https://dataclient.io/es/rest/api/Query">Query</a> recibe la entrada del schema que envuelve, ya que <code>set()</code> normaliza ese schema en lugar de
revertir <code>process()</code>. Cuando cada miembro declara su discriminador como literal (como <code>readonly type = 'post'</code>), una fila de
<a class="" href="https://dataclient.io/es/rest/api/Union">Union</a> se comprueba contra el miembro que selecciona, así que no puede mezclar campos de miembros distintos; consulta <a class="" href="https://dataclient.io/es/docs/api/Controller#set">Unions</a>.</p>
<p>Si código que antes compilaba ahora falla aquí, estaba escribiendo datos que su schema no describe. Corrige el valor,
o amplía los tipos de campo de la Entity si los datos realmente pueden tener esa forma.</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="extend-process-params">Parámetros tipados de process()<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#extend-process-params" class="hash-link" aria-label="Enlace directo al Parámetros tipados de process()" title="Enlace directo al Parámetros tipados de process()" translate="no">​</a></h4>
<p><code>rest</code></p>
<p>A un método <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#process">process()</a> pasado a <code>new RestEndpoint()</code>,
<a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#extend">.extend()</a> o <a class="" href="https://dataclient.io/es/rest/api/resource#extend">resource().extend()</a> se le tipaban los <code>params</code> como
<code>any</code>, así que leer un parámetro que el endpoint no tiene compilaba y devolvía <code>undefined</code> en tiempo de ejecución. Ahora <code>params</code> y
<code>body</code> se tipan desde el endpoint, incluido un <code>path</code> definido en la misma llamada a <code>.extend()</code>
(<a href="https://github.com/reactive/data-client/pull/4183" target="_blank" rel="noopener noreferrer" class="">#4183</a>, <a href="https://github.com/reactive/data-client/pull/4184" target="_blank" rel="noopener noreferrer" class="">#4184</a>):</p>
<div class="playgroundQueryContainer_vBqa"><div class="playgroundContainer_sLUA standaloneEditor_OHub row_YGZs"><div class="playgroundTextEdit_rt2K"><div class="editorDocs_INVk"><div class="playgroundEditor_lYwu"><div><pre class="prism-code language-ts" style="margin:0;outline:none;padding:10px;font-family:inherit;color:#bfc7d5;background-color:transparent" spellcheck="false"><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token punctuation" style="color:#c792ea">{ </span><span class="token class-name" style="color:#ffcb6b">RestEndpoint </span><span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'@data-client/rest'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">
</span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">const </span>getUser <span class="token punctuation" style="color:#c792ea">= </span><span class="token keyword" style="color:#7da4f6;font-style:italic">new </span><span class="token class-name" style="color:#ffcb6b">RestEndpoint</span><span class="token punctuation" style="color:#c792ea">({ </span>path<span class="token punctuation" style="color:#c792ea">: </span><span class="token string" style="color:#b6d986">'/users/:id' </span><span class="token punctuation" style="color:#c792ea">});
</span></span><span class="token-line">
</span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">export const </span>getUserById <span class="token punctuation" style="color:#c792ea">= </span>getUser<span class="token punctuation" style="color:#c792ea">.</span>extend<span class="token punctuation" style="color:#c792ea">({
</span></span><span class="token-line">  path<span class="token punctuation" style="color:#c792ea">: </span><span class="token string" style="color:#b6d986">'/users/by-id/:userId'</span><span class="token punctuation" style="color:#c792ea">,
</span></span><span class="token-line">  process<span class="token punctuation" style="color:#c792ea">(</span>value<span class="token punctuation" style="color:#c792ea">, </span>params<span class="token punctuation" style="color:#c792ea">) {
</span></span><span class="token-line">    <span class="token keyword" style="color:#7da4f6;font-style:italic">const </span>userId<span class="token punctuation" style="color:#c792ea">: </span><span class="token keyword" style="color:#7da4f6;font-style:italic">string </span><span class="token punctuation" style="color:#c792ea">| </span><span class="token keyword" style="color:#7da4f6;font-style:italic">number </span><span class="token punctuation" style="color:#c792ea">= </span>params<span class="token punctuation" style="color:#c792ea">.</span>userId<span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">    <span class="token comment" style="color:#697098;font-style:italic">// @ts-expect-error 'id' is not a param of '/users/by-id/:userId'
</span></span><span class="token-line">    params<span class="token punctuation" style="color:#c792ea">.</span>id<span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">    <span class="token keyword" style="color:#7da4f6;font-style:italic">return </span><span class="token punctuation" style="color:#c792ea">{ ...</span>value<span class="token punctuation" style="color:#c792ea">, </span>userId <span class="token punctuation" style="color:#c792ea">};
</span></span><span class="token-line">  <span class="token punctuation" style="color:#c792ea">},
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">});
</span></span></pre></div></div></div></div></div></div>
<p>Cuando todos los params son opcionales, <code>params</code> puede ser <code>undefined</code>, así que léelo con <code>params?.page</code>.</p>
<p>Esto puede hacer aparecer nuevos errores de TypeScript en métodos <code>process()</code> existentes. Cada uno marca una lectura que podría ser <code>undefined</code>
o lanzar un error en tiempo de ejecución, así que corrige el nombre del parámetro o agrega la comprobación que falta.</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="typed-optimistic-response">Respuestas optimistas tipadas<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#typed-optimistic-response" class="hash-link" aria-label="Enlace directo al Respuestas optimistas tipadas" title="Enlace directo al Respuestas optimistas tipadas" translate="no">​</a></h4>
<p><code>rest</code> <code>endpoint</code> <code>graphql</code></p>
<p><a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#getoptimisticresponse">getOptimisticResponse()</a> podía devolver cualquier cosa a menos que el endpoint tuviera
un <code>process()</code> tipado, así que un tipo de campo incorrecto solo aparecía como datos erróneos en la interfaz hasta que respondía el servidor. Ahora el valor
devuelto se comprueba contra el schema del endpoint, como un <a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#typed-set" class="">valor tipado de set()</a>: una Entity acepta cualquiera de sus
campos, y una <a class="" href="https://dataclient.io/es/rest/api/Collection">Collection</a> acepta una lista de ellos
(<a href="https://github.com/reactive/data-client/pull/4198" target="_blank" rel="noopener noreferrer" class="">#4198</a>):</p>
<div class="playgroundQueryContainer_vBqa"><div class="playgroundContainer_sLUA standaloneEditor_OHub row_YGZs"><div class="playgroundTextEdit_rt2K"><div class="editorDocs_INVk"><div class="playgroundEditor_lYwu"><div><pre class="prism-code language-ts" style="margin:0;outline:none;padding:10px;font-family:inherit;color:#bfc7d5;background-color:transparent" spellcheck="false"><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token punctuation" style="color:#c792ea">{ </span><span class="token class-name" style="color:#ffcb6b">Entity</span><span class="token punctuation" style="color:#c792ea">, </span><span class="token class-name" style="color:#ffcb6b">RestEndpoint </span><span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'@data-client/rest'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">
</span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">class </span><span class="token class-name" style="color:#ffcb6b">Todo </span><span class="token keyword" style="color:#7da4f6;font-style:italic">extends </span><span class="token class-name" style="color:#ffcb6b">Entity </span><span class="token punctuation" style="color:#c792ea">{
</span></span><span class="token-line">  id <span class="token punctuation" style="color:#c792ea">= </span><span class="token number" style="color:#f78c6c">0</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">  title <span class="token punctuation" style="color:#c792ea">= </span><span class="token string" style="color:#b6d986">''</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">  completed <span class="token punctuation" style="color:#c792ea">= </span><span class="token keyword" style="color:#7da4f6;font-style:italic">false</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">}
</span></span><span class="token-line">
</span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">export const </span>toggleTodo <span class="token punctuation" style="color:#c792ea">= </span><span class="token keyword" style="color:#7da4f6;font-style:italic">new </span><span class="token class-name" style="color:#ffcb6b">RestEndpoint</span><span class="token punctuation" style="color:#c792ea">({
</span></span><span class="token-line">  path<span class="token punctuation" style="color:#c792ea">: </span><span class="token string" style="color:#b6d986">'/todos/:id'</span><span class="token punctuation" style="color:#c792ea">,
</span></span><span class="token-line">  method<span class="token punctuation" style="color:#c792ea">: </span><span class="token string" style="color:#b6d986">'PATCH'</span><span class="token punctuation" style="color:#c792ea">,
</span></span><span class="token-line">  schema<span class="token punctuation" style="color:#c792ea">: </span><span class="token class-name" style="color:#ffcb6b">Todo</span><span class="token punctuation" style="color:#c792ea">,
</span></span><span class="token-line">  <span class="token comment" style="color:#697098;font-style:italic">// @ts-expect-error completed is a boolean; 'false' is truthy, so the checkbox would stay checked
</span></span><span class="token-line">  getOptimisticResponse<span class="token punctuation" style="color:#c792ea">(</span>snap<span class="token punctuation" style="color:#c792ea">, { </span>id <span class="token punctuation" style="color:#c792ea">}) {
</span></span><span class="token-line">    <span class="token keyword" style="color:#7da4f6;font-style:italic">const </span>todo <span class="token punctuation" style="color:#c792ea">= </span>snap<span class="token punctuation" style="color:#c792ea">.</span><span class="token keyword" style="color:#7da4f6;font-style:italic">get</span><span class="token punctuation" style="color:#c792ea">(</span><span class="token class-name" style="color:#ffcb6b">Todo</span><span class="token punctuation" style="color:#c792ea">, { </span>id <span class="token punctuation" style="color:#c792ea">});
</span></span><span class="token-line">    <span class="token keyword" style="color:#7da4f6;font-style:italic">if </span><span class="token punctuation" style="color:#c792ea">(!</span>todo<span class="token punctuation" style="color:#c792ea">) </span><span class="token keyword" style="color:#7da4f6;font-style:italic">throw </span>snap<span class="token punctuation" style="color:#c792ea">.</span>abort<span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">    <span class="token keyword" style="color:#7da4f6;font-style:italic">return </span><span class="token punctuation" style="color:#c792ea">{ </span>id<span class="token punctuation" style="color:#c792ea">, </span>completed<span class="token punctuation" style="color:#c792ea">: </span>todo<span class="token punctuation" style="color:#c792ea">.</span>completed <span class="token punctuation" style="color:#c792ea">? </span><span class="token string" style="color:#b6d986">'false' </span><span class="token punctuation" style="color:#c792ea">: </span><span class="token string" style="color:#b6d986">'true' </span><span class="token punctuation" style="color:#c792ea">};
</span></span><span class="token-line">  <span class="token punctuation" style="color:#c792ea">},
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">});
</span></span></pre></div></div></div></div></div></div>
<p>Esto puede hacer aparecer nuevos errores de TypeScript en métodos <code>getOptimisticResponse()</code> existentes. Cada uno marca un valor que se
almacenaría con el tipo incorrecto hasta que responda el servidor, así que devuelve el tipo real del campo (aquí <code>!todo.completed</code>).</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="endpoint-signal">Signal tipado en Endpoint<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#endpoint-signal" class="hash-link" aria-label="Enlace directo al Signal tipado en Endpoint" title="Enlace directo al Signal tipado en Endpoint" translate="no">​</a></h4>
<p><code>endpoint</code> <code>rest</code> <code>graphql</code></p>
<p>Ahora todo <a class="" href="https://dataclient.io/es/rest/api/Endpoint#signal">Endpoint</a> tipa <code>this.signal</code>, así que una llamada de SDK envuelta puede cancelarse
sin declararlo. Pásalo desde la función fetch y manténlo fuera de los argumentos, que son la
clave de caché (<a href="https://github.com/reactive/data-client/pull/4658" target="_blank" rel="noopener noreferrer" class="">#4658</a>):</p>
<div class="playgroundQueryContainer_vBqa"><div class="playgroundContainer_sLUA standaloneEditor_OHub row_YGZs"><div class="playgroundTextEdit_rt2K"><div class="editorDocs_INVk"><div class="playgroundEditor_lYwu"><div><pre class="prism-code language-ts" style="margin:0;outline:none;padding:10px;font-family:inherit;color:#bfc7d5;background-color:transparent" spellcheck="false"><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token punctuation" style="color:#c792ea">{ </span><span class="token class-name" style="color:#ffcb6b">Endpoint</span><span class="token punctuation" style="color:#c792ea">, </span><span class="token class-name" style="color:#ffcb6b">Entity </span><span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'@data-client/rest'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">
</span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">class </span><span class="token class-name" style="color:#ffcb6b">Post </span><span class="token keyword" style="color:#7da4f6;font-style:italic">extends </span><span class="token class-name" style="color:#ffcb6b">Entity </span><span class="token punctuation" style="color:#c792ea">{
</span></span><span class="token-line">  id <span class="token punctuation" style="color:#c792ea">= </span><span class="token number" style="color:#f78c6c">0</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">  title <span class="token punctuation" style="color:#c792ea">= </span><span class="token string" style="color:#b6d986">''</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">}
</span></span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">declare const </span>client<span class="token punctuation" style="color:#c792ea">: {
</span></span><span class="token-line">  getPosts<span class="token punctuation" style="color:#c792ea">(</span>options<span class="token punctuation" style="color:#c792ea">: { </span>page<span class="token punctuation" style="color:#c792ea">: </span><span class="token keyword" style="color:#7da4f6;font-style:italic">number</span><span class="token punctuation" style="color:#c792ea">; </span>signal?: <span class="token class-name" style="color:#ffcb6b">AbortSignal </span><span class="token punctuation" style="color:#c792ea">}): </span><span class="token class-name" style="color:#ffcb6b">Promise</span><span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token class-name" style="color:#ffcb6b">Post</span><span class="token punctuation" style="color:#c792ea">[]&gt;;
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">};
</span></span><span class="token-line">
</span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">export const </span>getPosts <span class="token punctuation" style="color:#c792ea">= </span><span class="token keyword" style="color:#7da4f6;font-style:italic">new </span><span class="token class-name" style="color:#ffcb6b">Endpoint</span><span class="token punctuation" style="color:#c792ea">(
</span></span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">function </span><span class="token punctuation" style="color:#c792ea">({ </span>page <span class="token punctuation" style="color:#c792ea">}: { </span>page<span class="token punctuation" style="color:#c792ea">: </span><span class="token keyword" style="color:#7da4f6;font-style:italic">number </span><span class="token punctuation" style="color:#c792ea">}) {
</span></span><span class="token-line">    <span class="token keyword" style="color:#7da4f6;font-style:italic">return </span>client<span class="token punctuation" style="color:#c792ea">.</span>getPosts<span class="token punctuation" style="color:#c792ea">({ </span>page<span class="token punctuation" style="color:#c792ea">, </span>signal<span class="token punctuation" style="color:#c792ea">: </span><span class="token keyword" style="color:#7da4f6;font-style:italic">this</span><span class="token punctuation" style="color:#c792ea">.</span>signal <span class="token punctuation" style="color:#c792ea">});
</span></span><span class="token-line">  <span class="token punctuation" style="color:#c792ea">},
</span></span><span class="token-line">  <span class="token punctuation" style="color:#c792ea">{ </span>name<span class="token punctuation" style="color:#c792ea">: </span><span class="token string" style="color:#b6d986">'getPosts'</span><span class="token punctuation" style="color:#c792ea">, </span>schema<span class="token punctuation" style="color:#c792ea">: [</span><span class="token class-name" style="color:#ffcb6b">Post</span><span class="token punctuation" style="color:#c792ea">] },
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">);
</span></span></pre></div></div></div></div></div></div>
<p><a class="" href="https://dataclient.io/es/docs/api/useCancelling">useCancelling()</a> y <code>extend({ signal })</code> lo definen.</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="create-formdata">Corrección: FormData en resource().create<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#create-formdata" class="hash-link" aria-label="Enlace directo al Corrección: FormData en resource().create" title="Enlace directo al Corrección: FormData en resource().create" translate="no">​</a></h4>
<p><code>rest</code></p>
<p>El <code>create</code> de <a class="" href="https://dataclient.io/es/rest/api/resource">resource()</a> envía un body <code>FormData</code> tal cual, como <code>update</code>, <code>partialUpdate</code> y
<a class="" href="https://dataclient.io/es/rest/api/resource#push">getList.push</a>, pero su tipo solo permitía un objeto, así que enviar un formulario necesitaba un cast
(<a href="https://github.com/reactive/data-client/pull/4235" target="_blank" rel="noopener noreferrer" class="">#4235</a>). Quita el cast:</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag" style="color:rgb(255, 85, 114)">form</span><br></div><div class="token-line">  <span class="token tag attr-name" style="color:rgb(255, 203, 107)">onSubmit</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(199, 146, 234)">={</span><span class="token tag script language-javascript" style="color:rgb(255, 85, 114)">e </span><span class="token tag script language-javascript arrow operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line"><span class="token tag script language-javascript" style="color:rgb(255, 85, 114)">    e</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token tag script language-javascript method function property-access" style="color:rgb(130, 170, 255)">preventDefault</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">();</span><br></div><div class="token-line"><span class="token tag script language-javascript" style="color:rgb(255, 85, 114)">    ctrl</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token tag script language-javascript method function property-access" style="color:rgb(130, 170, 255)">fetch</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token tag script language-javascript maybe-class-name" style="color:rgb(255, 85, 114)">PostResource</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token tag script language-javascript property-access" style="color:rgb(255, 85, 114)">create</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token tag script language-javascript keyword" style="color:rgb(255, 85, 114);font-style:italic">new </span><span class="token tag script language-javascript class-name" style="color:rgb(255, 203, 107)">FormData</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token tag script language-javascript" style="color:rgb(255, 85, 114)">e</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token tag script language-javascript property-access" style="color:rgb(255, 85, 114)">currentTarget</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token tag script language-javascript keyword" style="color:rgb(255, 85, 114);font-style:italic">as </span><span class="token tag script language-javascript builtin" style="color:rgb(130, 170, 255)">any</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">}}</span><br></div><div class="token-line"><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div></code></pre></div></div><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag" style="color:rgb(255, 85, 114)">form</span><br></div><div class="token-line">  <span class="token tag attr-name" style="color:rgb(255, 203, 107)">onSubmit</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(199, 146, 234)">={</span><span class="token tag script language-javascript" style="color:rgb(255, 85, 114)">e </span><span class="token tag script language-javascript arrow operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line"><span class="token tag script language-javascript" style="color:rgb(255, 85, 114)">    e</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token tag script language-javascript method function property-access" style="color:rgb(130, 170, 255)">preventDefault</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">();</span><br></div><div class="token-line"><span class="token tag script language-javascript" style="color:rgb(255, 85, 114)">    ctrl</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token tag script language-javascript method function property-access" style="color:rgb(130, 170, 255)">fetch</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token tag script language-javascript maybe-class-name" style="color:rgb(255, 85, 114)">PostResource</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token tag script language-javascript property-access" style="color:rgb(255, 85, 114)">create</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token tag script language-javascript keyword" style="color:rgb(255, 85, 114);font-style:italic">new </span><span class="token tag script language-javascript class-name" style="color:rgb(255, 203, 107)">FormData</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token tag script language-javascript" style="color:rgb(255, 85, 114)">e</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token tag script language-javascript property-access" style="color:rgb(255, 85, 114)">currentTarget</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">));</span><br></div><div class="token-line">  <span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">}}</span><br></div><div class="token-line"><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div></code></pre></div></div></div></div></div></figure>
<p><code>create</code> está obsoleto; <a class="" href="https://dataclient.io/es/rest/api/resource#push">getList.push</a> es su reemplazo y también acepta <code>FormData</code>.</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="union-body">Corrección: bodies de Union<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#union-body" class="hash-link" aria-label="Enlace directo al Corrección: bodies de Union" title="Enlace directo al Corrección: bodies de Union" translate="no">​</a></h4>
<p><code>rest</code></p>
<p>Un <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint">RestEndpoint</a> cuyo <code>body</code> se tipaba como una union, como una unión discriminada de zod o
<code>A &amp; (B | C)</code>, rechazaba todos los valores de esa union, así que llamarlo necesitaba un cast
(<a href="https://github.com/reactive/data-client/pull/4591" target="_blank" rel="noopener noreferrer" class="">#4591</a>). Quita el cast:</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">type </span><span class="token class-name" style="color:rgb(255, 203, 107)">Register </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> email<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string </span><span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">&amp; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> teamId<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string </span><span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">| </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> teamName<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> register <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/auth/register'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  method<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'POST'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  body<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{} </span><span class="token keyword" style="font-style:italic">as</span> Register<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">function </span><span class="token function" style="color:rgb(130, 170, 255)">signUp</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>ctrl<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Controller<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> input<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Register<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">return</span> ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>register<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> input <span class="token keyword" style="font-style:italic">as </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">type </span><span class="token class-name" style="color:rgb(255, 203, 107)">Register </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> email<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string </span><span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">&amp; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> teamId<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string </span><span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">| </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> teamName<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> register <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/auth/register'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  method<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'POST'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  body<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{} </span><span class="token keyword" style="font-style:italic">as</span> Register<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">function </span><span class="token function" style="color:rgb(130, 170, 255)">signUp</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>ctrl<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Controller<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> input<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Register<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">return</span> ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>register<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> input<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<p>Antes de v0.19, TypeScript solo aceptaba un body que coincidiera con todos los miembros de la union a la vez. Un <code>body</code> de union agregado
con <code>.extend({ body })</code> se tipaba como <code>never</code>, así que solo compilaba con un cast.</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="entity-pk-args">Corrección: las clases Entity pasan la comprobación como EntityInterface<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#entity-pk-args" class="hash-link" aria-label="Enlace directo al Corrección: las clases Entity pasan la comprobación como EntityInterface" title="Enlace directo al Corrección: las clases Entity pasan la comprobación como EntityInterface" translate="no">​</a></h4>
<p><code>endpoint</code> <code>rest</code> <code>graphql</code></p>
<p>Los helpers tipados para aceptar cualquier Entity con <code>EntityInterface</code> rechazaban las clases Entity, porque
<a class="" href="https://dataclient.io/es/rest/api/Entity#pk">Entity.pk()</a> tipaba sus <code>args</code> como un array mutable. Ahora es <code>readonly any[]</code>, así que esto
pasa la comprobación de tipos (<a href="https://github.com/reactive/data-client/pull/4149" target="_blank" rel="noopener noreferrer" class="">#4149</a>):</p>
<div class="playgroundQueryContainer_vBqa"><div class="playgroundContainer_sLUA standaloneEditor_OHub row_YGZs"><div class="playgroundTextEdit_rt2K"><div class="editorDocs_INVk"><div class="playgroundEditor_lYwu"><div><pre class="prism-code language-ts" style="margin:0;outline:none;padding:10px;font-family:inherit;color:#bfc7d5;background-color:transparent" spellcheck="false"><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token punctuation" style="color:#c792ea">{ </span><span class="token class-name" style="color:#ffcb6b">Entity </span><span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'@data-client/rest'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import type </span><span class="token punctuation" style="color:#c792ea">{ </span><span class="token class-name" style="color:#ffcb6b">EntityInterface </span><span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'@data-client/react'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">
</span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">class </span><span class="token class-name" style="color:#ffcb6b">User </span><span class="token keyword" style="color:#7da4f6;font-style:italic">extends </span><span class="token class-name" style="color:#ffcb6b">Entity </span><span class="token punctuation" style="color:#c792ea">{
</span></span><span class="token-line">  id <span class="token punctuation" style="color:#c792ea">= </span><span class="token string" style="color:#b6d986">''</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">  name <span class="token punctuation" style="color:#c792ea">= </span><span class="token string" style="color:#b6d986">''</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">}
</span></span><span class="token-line">
</span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">function </span>entityName<span class="token punctuation" style="color:#c792ea">(</span>schema<span class="token punctuation" style="color:#c792ea">: </span><span class="token class-name" style="color:#ffcb6b">EntityInterface</span><span class="token punctuation" style="color:#c792ea">) {
</span></span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">return </span>schema<span class="token punctuation" style="color:#c792ea">.</span>key<span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">}
</span></span><span class="token-line">
</span><span class="token-line">entityName<span class="token punctuation" style="color:#c792ea">(</span><span class="token class-name" style="color:#ffcb6b">User</span><span class="token punctuation" style="color:#c792ea">);
</span></span></pre></div></div></div></div></div></div>
<p>Si sobrescribes <code>static pk()</code> y tipas <code>args</code> como un array mutable, sigue compilando, pero una futura versión incompatible
exigirá <code>readonly</code>; <a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#future-pk-args" class="">actualízalo ahora</a>.</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="type-fixes">Otros cambios de tipos<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#type-fixes" class="hash-link" aria-label="Enlace directo al Otros cambios de tipos" title="Enlace directo al Otros cambios de tipos" translate="no">​</a></h4>
<ul>
<li class=""><code>react</code> <code>vue</code> <a class="" href="https://dataclient.io/es/docs/api/useQuery">useQuery()</a> acepta <code>null</code> para omitir, como los otros hooks, así que <code>useQuery(Todo, id ? { id } : null)</code> pasa la comprobación de tipos y devuelve <code>undefined</code> hasta que <code>id</code> esté definido (<a href="https://github.com/reactive/data-client/pull/4661" target="_blank" rel="noopener noreferrer" class="">#4661</a>)</li>
<li class=""><code>react</code> <code>vue</code> <strong>Corrección:</strong> Una subclase de <code>Controller</code> pasada a <a class="" href="https://dataclient.io/es/docs/api/DataProvider#Controller">DataProvider</a> o <a class="" href="https://dataclient.io/es/vue/api/DataClientPlugin#Controller">DataClientPlugin</a> ya no necesita un cast para pasar la comprobación de tipos (<a href="https://github.com/reactive/data-client/pull/4228" target="_blank" rel="noopener noreferrer" class="">#4228</a>)</li>
<li class=""><code>react</code> <strong>Corrección:</strong> El <code>store</code> de <a class="" href="https://dataclient.io/es/docs/guides/redux">prepareStore()</a> se puede pasar al <code>&lt;Provider&gt;</code> de react-redux sin un cast, y tiene <code>dispatch()</code> en su tipo (<a href="https://github.com/reactive/data-client/pull/4238" target="_blank" rel="noopener noreferrer" class="">#4238</a>)</li>
<li class=""><code>rest</code> <strong>Corrección:</strong> <a class="" href="https://dataclient.io/es/rest/api/resource#extend">resource().extend()</a> con un objeto de sobrescrituras de endpoints conserva en su tipo los endpoints agregados antes con <code>.extend('name', options)</code>, así que usarlos ya no es un error de TypeScript (<a href="https://github.com/reactive/data-client/pull/4184" target="_blank" rel="noopener noreferrer" class="">#4184</a>)</li>
<li class=""><code>rest</code> <strong>Corrección:</strong> La <a class="" href="https://dataclient.io/es/docs/api/useSuspense#conditional">obtención condicional</a> funciona para un <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint">RestEndpoint</a> sin parámetros de ruta ni de búsqueda: acepta <code>{}</code>, así que <code>useSuspense(getTeams, showTeams ? {} : null)</code> ya no es un error de TypeScript (<a href="https://github.com/reactive/data-client/pull/4612" target="_blank" rel="noopener noreferrer" class="">#4612</a>)</li>
<li class=""><code>react</code> <code>vue</code> <strong>Corrección:</strong> El <code>meta.promise</code> de una acción FETCH se tipa como <code>Promise</code>, así que un <a class="" href="https://dataclient.io/es/docs/api/Manager">Manager</a> puede llamar a <code>.finally()</code> y <code>.catch()</code> sobre él. Estaba tipado como <code>PromiseLike</code>, que solo tiene <code>.then()</code> (<a href="https://github.com/reactive/data-client/pull/4227" target="_blank" rel="noopener noreferrer" class="">#4227</a>)</li>
<li class=""><code>react</code> <code>vue</code> <strong>Corrección:</strong> <code>ExpiryStatus</code> compila con <code>isolatedModules</code> de TypeScript (el valor por defecto en las apps de Vite y Next.js), en lugar de fallar con <code>TS2748: Cannot access ambient const enums</code> (<a href="https://github.com/reactive/data-client/pull/4671" target="_blank" rel="noopener noreferrer" class="">#4671</a>)</li>
<li class=""><code>endpoint</code> <code>rest</code> <code>graphql</code> <strong>Corrección:</strong> Los documentos al pasar el cursor en el editor para <code>Entity.maxEntityDepth</code> muestran su valor por defecto real, 64, no 128 (<a href="https://github.com/reactive/data-client/pull/4224" target="_blank" rel="noopener noreferrer" class="">#4224</a>)</li>
</ul>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="typescript-versions">Corrección: TypeScript 4.0–4.5 y 7<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#typescript-versions" class="hash-link" aria-label="Enlace directo al Corrección: TypeScript 4.0–4.5 y 7" title="Enlace directo al Corrección: TypeScript 4.0–4.5 y 7" translate="no">​</a></h4>
<p><code>all</code></p>
<ul>
<li class="">Se corrige la resolución de módulos de TypeScript 7 para los <code>exports</code> de los paquetes; las importaciones ahora se resuelven a archivos de declaración (<a href="https://github.com/reactive/data-client/pull/4019" target="_blank" rel="noopener noreferrer" class="">#4019</a>)</li>
<li class="">Se corrigen los errores <code>Cannot find name 'NoInfer'</code> y de <code>export type</code> en TypeScript 4.x con <code>skipLibCheck</code> desactivado (<a href="https://github.com/reactive/data-client/pull/4138" target="_blank" rel="noopener noreferrer" class="">#4138</a>)</li>
<li class="">Se corrigen los errores de tipos de <code>Entity</code>, <code>Endpoint</code>, <code>Union</code> y <code>RestEndpoint</code> en TypeScript 4.0–4.5 con <code>skipLibCheck</code> desactivado (<a href="https://github.com/reactive/data-client/pull/4140" target="_blank" rel="noopener noreferrer" class="">#4140</a>)</li>
<li class="">Se corrigen los errores <code>',' expected</code> al importar <code>@data-client/react/redux</code>, <code>@data-client/react/nextjs</code> o <code>@data-client/test</code> en TypeScript 4.0–4.4 (<a href="https://github.com/reactive/data-client/pull/4232" target="_blank" rel="noopener noreferrer" class="">#4232</a>)</li>
<li class="">Se corrige que <code>act</code> y <code>renderHook</code> de <code>@data-client/test</code> se tiparan como <code>any</code> en TypeScript 4.0–4.4 (<a href="https://github.com/reactive/data-client/pull/4251" target="_blank" rel="noopener noreferrer" class="">#4251</a>)</li>
</ul>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="testing">Pruebas<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#testing" class="hash-link" aria-label="Enlace directo al Pruebas" title="Enlace directo al Pruebas" translate="no">​</a></h3>
<p>Una prueba que se cuelga, o que pasa estando todavía suspendida, oculta errores reales.</p>
<ul>
<li class=""><code>test</code> <a class="" href="https://dataclient.io/es/docs/api/renderDataHook">renderDataHook()</a> funciona con React Native Testing Library 14 y sigue siendo síncrono, así que las llamadas a <code>renderDataHook()</code> no necesitan <code>await</code> (<a href="https://github.com/reactive/data-client/pull/4374" target="_blank" rel="noopener noreferrer" class="">#4374</a>)</li>
<li class=""><code>test</code> <code>react</code> <code>vue</code> Los <a class="" href="https://dataclient.io/es/docs/api/Fixtures">Fixtures</a> respetan el AbortSignal del fetch, rechazando con un <code>AbortError</code> como <code>fetch()</code>, y los interceptores de <a class="" href="https://dataclient.io/es/docs/api/Fixtures#fetchResponse">fetchResponse()</a> pueden ser asíncronos (<a href="https://github.com/reactive/data-client/pull/4516" target="_blank" rel="noopener noreferrer" class="">#4516</a>)</li>
<li class=""><code>test</code> <strong>Corrección:</strong> <a class="" href="https://dataclient.io/es/docs/api/renderDataHook#optionsmanagers">renderDataHook()</a> acepta una opción <code>managers</code>, así que una prueba puede ejecutar su propio <a class="" href="https://dataclient.io/es/docs/api/Manager">Manager</a>; antes, la opción se ignoraba (<a href="https://github.com/reactive/data-client/pull/4602" target="_blank" rel="noopener noreferrer" class="">#4602</a>)</li>
<li class=""><code>test</code> <strong>Corrección:</strong> <a class="" href="https://dataclient.io/es/docs/api/renderDataHook">renderDataHook()</a> ejecuta los efectos de montaje del provider cuando el primer render se suspende (<a href="https://github.com/reactive/data-client/pull/4099" target="_blank" rel="noopener noreferrer" class="">#4099</a>)</li>
<li class=""><code>test</code> <strong>Corrección:</strong> Los fixtures de un <a class="" href="https://dataclient.io/es/rest/api/Endpoint">Endpoint</a> simple en <a class="" href="https://dataclient.io/es/docs/api/renderDataHook">renderDataHook()</a> o <a class="" href="https://dataclient.io/es/docs/api/MockResolver">MockResolver</a> resuelven <code>controller.fetch()</code> en lugar de colgarse (<a href="https://github.com/reactive/data-client/pull/4625" target="_blank" rel="noopener noreferrer" class="">#4625</a>)</li>
<li class=""><code>react</code> <strong>Corrección:</strong> <a class="" href="https://dataclient.io/es/docs/api/DataProvider">DataProvider</a> se renderiza en pruebas de Vitest 2 con el entorno <code>jsdom</code> y la configuración por defecto de Vitest, así que puedes quitar un workaround de <code>server.deps.inline</code>; antes, lanzaba <code>useEnhancedReducer is not a function</code> (<a href="https://github.com/reactive/data-client/pull/4613" target="_blank" rel="noopener noreferrer" class="">#4613</a>)</li>
<li class=""><code>react</code> <code>rest</code> <strong>Corrección:</strong> En Vitest y otras configuraciones ESM de Node sin bundler, los hooks ahora ven los providers de <code>@data-client/react/redux</code>, <code>/ssr</code> y <code>/nextjs</code>. Antes, actuaban como si no se hubiera renderizado ningún provider: registraban "It appears you are trying to use Reactive Data Client without a provider" y no obtenían nada. Ahora los subpaths comparten el código de la entrada principal, así que una prueba que importa uno, en Vitest o Jest, carga hasta un 72% menos de código de data-client. Los bundles del navegador no cambian (<a href="https://github.com/reactive/data-client/pull/4626" target="_blank" rel="noopener noreferrer" class="">#4626</a>)</li>
<li class=""><code>test</code> <code>react</code> <code>vue</code> <strong>Corrección:</strong> Los fixtures escritos con <code>args: [...] as const</code> pasan la comprobación de tipos en <a class="" href="https://dataclient.io/es/docs/api/MockResolver">MockResolver</a>, <code>renderDataHook()</code>, <code>renderDataCompose()</code> de Vue y <code>mockInitialState()</code> (<a href="https://github.com/reactive/data-client/pull/4250" target="_blank" rel="noopener noreferrer" class="">#4250</a>)</li>
<li class=""><code>test</code> <code>react</code> <strong>Corrección:</strong> Los tipos de fixtures ya no necesitan tener instalado <code>@data-client/endpoint</code>, así que los proyectos con solo <code>@data-client/react</code> y <code>@data-client/test</code> (por ejemplo con el layout estricto de pnpm) pasan la comprobación de tipos (<a href="https://github.com/reactive/data-client/pull/4420" target="_blank" rel="noopener noreferrer" class="">#4420</a>)</li>
<li class=""><code>vue</code> <strong>Corrección:</strong> <code>@data-client/vue/test</code> carga en Jest y Node. Antes, <code>require()</code> lanzaba <code>Cannot find module</code>, y el <code>import</code> de Node dejaba <code>mountDataClient</code>, <code>renderDataCompose</code> y <code>MockPlugin</code> sin definir (<a href="https://github.com/reactive/data-client/pull/4617" target="_blank" rel="noopener noreferrer" class="">#4617</a>)</li>
</ul>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="warnings">Advertencias de desarrollo<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#warnings" class="hash-link" aria-label="Enlace directo al Advertencias de desarrollo" title="Enlace directo al Advertencias de desarrollo" translate="no">​</a></h3>
<p>Una advertencia solo debe dispararse ante un problema real, y decir cómo solucionarlo.</p>
<ul>
<li class=""><code>react</code> <code>vue</code> Cuando <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#getoptimisticresponse">getOptimisticResponse()</a> devuelve una Entity sin su clave primaria, las compilaciones de desarrollo registran una vez un error breve <code>Optimistic update skipped</code> con la solución probable, en lugar de un error largo de procesamiento en cada actualización del store (<a href="https://github.com/reactive/data-client/pull/4616" target="_blank" rel="noopener noreferrer" class="">#4616</a>)</li>
<li class=""><code>react</code> La advertencia "Uncaught suspense" indica que se pongan los límites de Suspense dentro de <a class="" href="https://dataclient.io/es/docs/api/DataProvider">DataProvider</a>, ya que uno por encima nunca captura nada (<a href="https://github.com/reactive/data-client/pull/4609" target="_blank" rel="noopener noreferrer" class="">#4609</a>)</li>
<li class=""><code>rest</code> Cuando el <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#getRequestInit">getRequestInit()</a> de una mutación no devuelve <code>method</code>, las compilaciones de desarrollo registran un error, ya que <code>fetch()</code> enviaría un GET. Esto detecta una sobrescritura que expande <code>super.getRequestInit()</code> sin <code>await</code> (<a href="https://github.com/reactive/data-client/pull/4647" target="_blank" rel="noopener noreferrer" class="">#4647</a>)</li>
<li class=""><code>react</code> <strong>Corrección:</strong> <a class="" href="https://dataclient.io/es/docs/api/DataProvider">DataProvider</a> solo advierte que no se actualiza durante el SSR cuando algo hace fetch mientras el servidor renderiza, en lugar de en cada render del servidor, así que las páginas que cargan datos después del montaje (como la salida web estática de Expo Router) se mantienen en silencio (<a href="https://github.com/reactive/data-client/pull/4449" target="_blank" rel="noopener noreferrer" class="">#4449</a>)</li>
<li class=""><code>react</code> <strong>Corrección:</strong> El renderizado en el servidor con React 19 ya no registra "Uncaught suspense" cuando nada se suspendió; React renderiza y descarta los fallbacks de los límites grandes, y ahora la advertencia espera a un fallback que realmente se muestre (<a href="https://github.com/reactive/data-client/pull/4450" target="_blank" rel="noopener noreferrer" class="">#4450</a>)</li>
</ul>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="migration-guide">Guía de migración<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#migration-guide" class="hash-link" aria-label="Enlace directo al Guía de migración" title="Enlace directo al Guía de migración" translate="no">​</a></h2>
<!-- -->
<p>Esta actualización requiere actualizar todas las versiones de los paquetes al mismo tiempo.</p>
<div class="theme-tabs-container tabs-container tabList_J5MA"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_l0OV tabs__item--active">NPM</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">Yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">esm.sh</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_wHwb"><div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc"><span class="token function" style="color:rgb(130, 170, 255)">npm install </span><span class="token parameter variable" style="color:rgb(191, 199, 213)">--save</span> @data-client/react@^0.19.0 @data-client/rest@^0.19.0 @data-client/endpoint@^0.19.0 @data-client/core@^0.19.0 @data-client/vue@^0.19.0 @data-client/test@^0.19.0 @data-client/img@^0.19.0<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">yarn add @data-client/react@^0.19.0 @data-client/rest@^0.19.0 @data-client/endpoint@^0.19.0 @data-client/core@^0.19.0 @data-client/vue@^0.19.0 @data-client/test@^0.19.0 @data-client/img@^0.19.0<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">pnpm add @data-client/react@^0.19.0 @data-client/rest@^0.19.0 @data-client/endpoint@^0.19.0 @data-client/core@^0.19.0 @data-client/vue@^0.19.0 @data-client/test@^0.19.0 @data-client/img@^0.19.0<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-html language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">&lt;script type="importmap"&gt;<br></div><div class="token-line">{<br></div><div class="token-line">  "imports": {<br></div><div class="token-line">    "@data-client/react": "https://esm.sh/@data-client/react@^0.19.0",<br></div><div class="token-line">    "@data-client/rest": "https://esm.sh/@data-client/rest@^0.19.0",<br></div><div class="token-line">    "@data-client/endpoint": "https://esm.sh/@data-client/endpoint@^0.19.0",<br></div><div class="token-line">    "@data-client/core": "https://esm.sh/@data-client/core@^0.19.0",<br></div><div class="token-line">    "@data-client/vue": "https://esm.sh/@data-client/vue@^0.19.0",<br></div><div class="token-line">    "@data-client/test": "https://esm.sh/@data-client/test@^0.19.0",<br></div><div class="token-line">    "@data-client/img": "https://esm.sh/@data-client/img@^0.19.0"<br></div><div class="token-line">  }<br></div><div class="token-line">}<br></div><div class="token-line">&lt;/script&gt;<br></div></code></pre></div></div></div></div></div>
<p>Los codemods ahora se distribuyen como el paquete <a href="https://www.npmjs.com/package/@data-client/codemods" target="_blank" rel="noopener noreferrer" class="">@data-client/codemods</a>, así que <code>npx @data-client/codemods v0.19 src/</code> ejecuta el codemod de esta versión (<a href="https://github.com/reactive/data-client/pull/4409" target="_blank" rel="noopener noreferrer" class="">#4409</a>).</p>
<p><strong>¿Usas un agente de IA?</strong> Instala el skill de migración. Ejecuta el <a href="https://www.npmjs.com/package/@data-client/codemods" target="_blank" rel="noopener noreferrer" class="">codemod</a>
y corrige lo que este señala:</p>
<div class="theme-tabs-container tabs-container tabList_J5MA"><ul role="tablist" aria-orientation="horizontal" class="tabs tabs_qwsy"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_l0OV tabs__item--active">Skills CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">OpenSkills</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_wHwb"><div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc">npx skills <span class="token function" style="color:rgb(130, 170, 255)">add</span> reactive/data-client <span class="token parameter variable" style="color:rgb(191, 199, 213)">--skill</span> data-client-v0.19-migration<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">npx openskills install reactive/data-client/.agents/skills/data-client-v0.19-migration<br></div></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="migrate-all">Para todos los usuarios<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#migrate-all" class="hash-link" aria-label="Enlace directo al Para todos los usuarios" title="Enlace directo al Para todos los usuarios" translate="no">​</a></h3>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="nextjs-pages-router">El Pages Router de Next.js no es compatible<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#nextjs-pages-router" class="hash-link" aria-label="Enlace directo al El Pages Router de Next.js no es compatible" title="Enlace directo al El Pages Router de Next.js no es compatible" translate="no">​</a></h4>
<p><code>react</code></p>
<p>Omite esta sección si usas el App Router de Next.js o no usas Next.js.</p>
<p><code>@data-client/ssr</code> solo admite <code>@data-client/react</code> hasta 0.14, así que el Pages Router (<code>pages/_document</code> y
<code>pages/_app</code> con <code>DataClientDocument</code> y <code>AppDataProvider</code>) no funciona con 0.19. Pasa al
<a class="" href="https://dataclient.io/es/docs/guides/ssr#app-router">App Router</a> y renderiza <code>DataProvider</code> de <code>@data-client/react/nextjs</code> en tu layout raíz:</p>
<div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">app/layout.tsx</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token imports punctuation" style="color:rgb(199, 146, 234)">{ </span>DataProvider <span class="token imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react/nextjs'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export default function </span><span class="token function" style="color:rgb(130, 170, 255)">RootLayout</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> children <span class="token punctuation" style="color:rgb(199, 146, 234)">}) {</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">return </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">    <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag" style="color:rgb(255, 85, 114)">html</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line">      <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag" style="color:rgb(255, 85, 114)">body</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line">        <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">DataProvider</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;{</span>children<span class="token punctuation" style="color:rgb(199, 146, 234)">}&lt;/</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">DataProvider</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line">      <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;/</span><span class="token tag" style="color:rgb(255, 85, 114)">body</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line">    <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;/</span><span class="token tag" style="color:rgb(255, 85, 114)">html</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div>
<p>Luego desinstala <code>@data-client/ssr</code>, y <code>@data-client/redux</code> si nada más lo usa.</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="typescript-4">TypeScript 4.0 o posterior<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#typescript-4" class="hash-link" aria-label="Enlace directo al TypeScript 4.0 o posterior" title="Enlace directo al TypeScript 4.0 o posterior" translate="no">​</a></h4>
<p><code>all</code></p>
<p>Omite esta sección si ya usas TypeScript 4.0 o posterior.</p>
<p>Se eliminan las declaraciones de TypeScript 3.x, ya que dejaron de pasar la comprobación de tipos en cualquier versión de TypeScript 3.x. Sube
<code>typescript</code> a <code>^4.0.0</code> o posterior en tus <code>devDependencies</code>. <a href="https://github.com/reactive/data-client/pull/4151" target="_blank" rel="noopener noreferrer" class="">#4151</a></p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="managers-function"><code>managers</code> es una función<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#managers-function" class="hash-link" aria-label="Enlace directo al managers-function" title="Enlace directo al managers-function" translate="no">​</a></h4>
<p><code>react</code> <code>vue</code></p>
<p>Omite esta sección si no pasas <code>managers</code> a <a class="" href="https://dataclient.io/es/docs/api/DataProvider#managers">DataProvider</a>,
<a class="" href="https://dataclient.io/es/vue/api/DataClientPlugin#managers">DataClientPlugin</a> ni <code>prepareStore()</code>.</p>
<p><code>managers</code> recibe una función en lugar de un array. <code>DataProvider</code> la llama una vez por cada store, así que un
<code>DataProvider</code> vuelto a montar obtiene Managers nuevos. Antes, cada store que usaba un array compartía sus instancias, y el estado del
store anterior se filtraba al nuevo. Define la función a nivel de módulo y crea cada Manager dentro de ella. El
constructor de un Manager guarda solo sus opciones; consulta <a class="" href="https://dataclient.io/es/docs/api/Manager#lifetimes">Ciclo de vida de los Managers</a> para saber qué va dónde.</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> managers <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyManager</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(), </span><span class="token spread operator" style="color:rgb(137, 221, 255)">...</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">getDefaultManagers</span><span class="token punctuation" style="color:rgb(199, 146, 234)">()];</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">DataProvider managers</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(199, 146, 234)">={</span><span class="token tag script language-javascript" style="color:rgb(255, 85, 114)">managers</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">}&gt;</span><br></div></code></pre></div></div><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const </span><span class="token function-variable function" style="color:rgb(130, 170, 255)">managers </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">() </span><span class="token arrow operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyManager</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(), </span><span class="token spread operator" style="color:rgb(137, 221, 255)">...</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">getDefaultManagers</span><span class="token punctuation" style="color:rgb(199, 146, 234)">()];</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">DataProvider managers</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(199, 146, 234)">={</span><span class="token tag script language-javascript" style="color:rgb(255, 85, 114)">managers</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">}&gt;</span><br></div></code></pre></div></div></div></div></div></figure>
<p>El codemod de v0.19 convierte los arrays, <code>getDefaultManagers()</code>, las opciones del plugin de Vue y el <code>managers</code> de
<code>renderDataHook()</code> y <code>renderDataCompose()</code>. Donde solo puede envolver un array definido en otro lugar como <code>() =&gt; managers</code>,
agrega un comentario <code>TODO(data-client)</code>: mueve las llamadas <code>new</code> dentro de la función para que los stores no compartan instancias.</p>
<div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc">npx @data-client/codemods v0.19 src/<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div>
<p>Los providers personalizados dejan el tercer argumento de <code>initManager()</code>, ya que <code>init()</code> recibe el estado actual del store. El codemod
también hace esto. <a href="https://github.com/reactive/data-client/pull/4601" target="_blank" rel="noopener noreferrer" class="">#4601</a></p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="fetch-if-stale-promise">Controller.fetchIfStale() siempre devuelve una Promise<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise" class="hash-link" aria-label="Enlace directo al Controller.fetchIfStale() siempre devuelve una Promise" title="Enlace directo al Controller.fetchIfStale() siempre devuelve una Promise" translate="no">​</a></h4>
<p><code>react</code> <code>vue</code></p>
<p><a class="" href="https://dataclient.io/es/docs/api/Controller#fetchIfStale">Controller.fetchIfStale()</a> ahora siempre devuelve una Promise con el resultado del último fetch,
y hace fetch solo cuando la caché está obsoleta. Una llamada a la que no haces await no puede rechazar sin manejar, porque el error ya
está almacenado como cualquier error de fetch, así que los componentes que leen ese endpoint lo manejan como de costumbre.</p>
<div class="table-scroll"><table><thead><tr><th>Pregunta</th><th>Antes</th><th>Después</th></tr></thead><tbody><tr><td>¿Qué devuelve la llamada?</td><td>Los datos cuando están frescos, una Promise cuando están obsoletos</td><td>Siempre una Promise</td></tr><tr><td>Falla el fetch de una llamada sin await. ¿Qué pasa?</td><td>Rechazo no manejado</td><td>Sin rechazo no manejado; el error se almacena, como antes</td></tr><tr><td>¿Qué da <code>await</code> cuando falló el último fetch dentro de <a class="" href="https://dataclient.io/es/rest/api/Endpoint#errorexpirylength">errorExpiryLength</a>?</td><td><code>undefined</code></td><td>Rechaza con ese error</td></tr><tr><td>¿Cómo compruebo si los datos están frescos sin hacer fetch?</td><td>Comprueba el resultado con <code>instanceof Promise</code></td><td><a class="" href="https://dataclient.io/es/docs/api/Controller#getResponse">getResponse()</a></td></tr></tbody></table></div>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">async function </span><span class="token function" style="color:rgb(130, 170, 255)">issueLoader</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>ctrl<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Controller<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">number</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">  <span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// start the comments request without waiting for it; no .catch() needed</span><br></div><div class="token-line">  ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetchIfStale</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>CommentResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>getList<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> issueId<span class="token operator" style="color:rgb(137, 221, 255)">:</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line">  <span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// wait for the issue; rejects if its fetch fails</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">await</span> ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetchIfStale</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>IssueResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div>
<p>Antes, un loader que iniciaba una precarga con <code>.catch()</code> lanzaba un <code>TypeError</code> en una segunda visita, porque los datos frescos volvían
de forma síncrona y no tenían <code>.catch()</code>. Sin <code>.catch()</code>, una precarga fallida era un rechazo no manejado, que
hace caer a Node en los loaders del lado del servidor. Ninguna forma natural de escribir una precarga era segura.</p>
<p>Por qué cada decisión:</p>
<ul>
<li class=""><strong>Siempre una Promise.</strong> <code>fetchIfStale()</code> primero devolvía <code>undefined</code> para datos frescos
(<a href="https://github.com/reactive/data-client/pull/2743" target="_blank" rel="noopener noreferrer" class="">#2743</a>). <a href="https://github.com/reactive/data-client/pull/2745" target="_blank" rel="noopener noreferrer" class="">#2745</a>
devolvió en su lugar los datos en caché, para que <code>await fetchIfStale()</code> resuelva los datos en ambos casos. El valor síncrono
fue un efecto secundario de esa corrección, y <code>await</code> sigue funcionando. Una llamada no puede devolver datos simples y también admitir <code>.catch()</code>.
El tipo de retorno anterior era una union, así que el código tipado ya comprobaba <code>instanceof Promise</code> o hacía await antes de usarlo, y
los loaders de los routers (React Router, TanStack Router) hacen await de lo que reciban. <code>await</code> toma un microtask
tanto con datos simples como con una Promise resuelta, así que quienes hacen await no ven ningún retraso adicional.</li>
<li class=""><strong>Las llamadas sin await nunca rechazan sin manejar.</strong> El error ya está almacenado para los componentes que leen el endpoint,
así que una copia sin manejar solo agrega un fallo fatal. Las llamadas con <code>await</code> siguen rechazando. Un método <code>prefetch()</code> aparte que no rechace
habría dejado roto <code>fetchIfStale().catch()</code>, y ese es el código que escriben las personas y los agentes.</li>
<li class=""><strong><code>await</code> rechaza cuando el último fetch falló dentro de errorExpiryLength.</strong> La Promise informa del resultado del último fetch,
y ese fetch falló, así que rechaza igual que <a class="" href="https://dataclient.io/es/docs/api/useSuspense">useSuspense()</a> lanza el mismo error.
Antes, resolvía <code>undefined</code>, así que el código que hacía await y luego leía un campo fallaba.</li>
</ul>
<p>Para comprobar si los datos están en caché y frescos sin hacer fetch, lee <a class="" href="https://dataclient.io/es/docs/api/Controller#getResponse">getResponse()</a>
de forma síncrona. Ejecuta la misma comprobación que <code>fetchIfStale()</code>:</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> data<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> expiryStatus<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> expiresAt <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getResponse</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  IssueResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getState</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(),</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> fresh <span class="token operator" style="color:rgb(137, 221, 255)">=</span> expiryStatus <span class="token operator" style="color:rgb(137, 221, 255)">!==</span> ExpiryStatus<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>Invalid <span class="token operator" style="color:rgb(137, 221, 255)">&amp;&amp;</span> Date<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">now</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() </span><span class="token operator" style="color:rgb(137, 221, 255)">&lt;=</span> expiresAt<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div></code></pre></div></div>
<p>Qué revisar al actualizar. El codemod de v0.19 se encarga de los tres primeros:</p>
<div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc">npx @data-client/codemods v0.19 src/<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div>
<ul>
<li class=""><strong>Código que lee el resultado como datos</strong>, como <code>instanceof Promise</code>, <code>.title</code>, desestructuración o un <code>if</code> sobre él:
hazle <code>await</code> (abajo). Donde una comprobación <code>instanceof Promise</code> o <code>isPromise()</code> tiene una rama que hace await del resultado y
lee los datos (o la otra rama está vacía), el codemod conserva esa rama y elimina la otra. Agrega un comentario <code>TODO(data-client)</code> sobre cada otra lectura que
encuentra. El verificador de tipos señala las lecturas de propiedades que se le escapan, como los resultados pasados a través de otras funciones.</li>
<li class=""><strong>Pruebas que simulan el retorno anterior</strong>: <code>spyOn(ctrl, 'fetchIfStale').mockReturnValue(data)</code> pasa a ser
<code>.mockResolvedValue(data)</code>, y <code>fetchIfStale: jest.fn(() =&gt; data)</code> resuelve su valor.</li>
<li class="">Los envoltorios <strong><code>Promise.resolve(ctrl.fetchIfStale(...))</code></strong> ya no son necesarios, y el codemod los elimina, junto con
un <code>.catch(() =&gt; {})</code> sin efecto en una llamada a la que no haces await.</li>
<li class=""><strong>Monitoreo de errores</strong>: los fallos de las llamadas a las que no haces await ya no llegan a los manejadores globales de rechazos no manejados: el
error "Uncaught (in promise)" de la consola del navegador, los rastreadores de errores que capturan rechazos no manejados (como Sentry) y
el evento <code>unhandledRejection</code> de Node. Lo mismo vale ahora para las lecturas a las que no haces await con <code>fetch()</code>
(<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#fetch-read-prehandled" class="">abajo</a>). Para reportar cada fetch fallido, con await o sin él, agrega un
<a class="" href="https://dataclient.io/es/docs/concepts/managers#error-reporting">Manager de reporte de errores</a>.</li>
<li class=""><strong>Los loaders que le hacen await</strong> ahora rechazan cuando el último fetch falló dentro de errorExpiryLength, como ya hacían cuando
fallaba un fetch obsoleto, así que la interfaz de error del router muestra el error en lugar del error boundary del componente. Para seguir
esperando pero dejar el error al componente, agrega <code>.catch(() =&gt; {})</code> a esa llamada. El código que manejaba un resultado ausente
después de <code>await</code>, como <code>?? fallback</code>, recibe un comentario <code>TODO(data-client)</code> del codemod: mueve ese manejo a
<code>.catch()</code>.</li>
<li class=""><strong>Cadenas <code>.then()</code></strong>: un <code>.then()</code> sobre el resultado crea una nueva Promise, así que termina la cadena con <code>.catch()</code> como de costumbre.</li>
<li class=""><strong>Las subclases de Controller</strong> que sobrescriben <code>fetchIfStale()</code> deben devolver una Promise.</li>
</ul>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> issue <span class="token operator" style="color:rgb(137, 221, 255)">=</span> ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetchIfStale</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>IssueResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">!</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>issue <span class="token keyword" style="font-style:italic">instanceof </span><span class="token class-name builtin" style="color:rgb(130, 170, 255)">Promise</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)) </span><span class="token function" style="color:rgb(130, 170, 255)">render</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>issue<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> issue <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">await</span> ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetchIfStale</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>IssueResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">render</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>issue<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div></div></div></div></figure>
<p><a href="https://github.com/reactive/data-client/pull/4657" target="_blank" rel="noopener noreferrer" class="">#4657</a></p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="fetch-read-prehandled">Las lecturas sin await con Controller.fetch() nunca rechazan sin manejar<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#fetch-read-prehandled" class="hash-link" aria-label="Enlace directo al Las lecturas sin await con Controller.fetch() nunca rechazan sin manejar" title="Enlace directo al Las lecturas sin await con Controller.fetch() nunca rechazan sin manejar" translate="no">​</a></h4>
<p><code>react</code></p>
<p><a class="" href="https://dataclient.io/es/docs/api/Controller#fetch">Controller.fetch()</a> de un endpoint sin <code>sideEffect</code> (una lectura) ahora funciona como
<code>fetchIfStale()</code>: una llamada a la que no haces await no puede rechazar sin manejar, porque su error se almacena para los componentes que
leen ese endpoint. <code>await</code> y <code>.catch()</code> siguen recibiendo el error. Las mutaciones (<code>sideEffect: true</code>) siguen rechazando sin manejar.
Nada se rompe, así que no es un cambio incompatible, pero te permite eliminar código y cambia lo que ven los rastreadores de errores.</p>
<p>Por qué cada decisión:</p>
<ul>
<li class=""><strong>Solo lecturas.</strong> El error de una lectura ya tiene un lector: los componentes que renderizan ese endpoint. Una copia sin manejar
solo agrega un fallo fatal en los loaders de servidor de Node, o una advertencia en React Native. El error de una mutación no tiene otro lector, así que
su rechazo sigue siendo la señal de que una escritura falló.</li>
<li class=""><strong>En fetch(), no en cada llamador.</strong> Cada llamador tenía que acordarse de <code>.catch(() =&gt; {})</code>. La propia biblioteca lo omitió en
el refetch al enfocar la pantalla de React Native de <code>useSuspense()</code>, <code>useDLE()</code> y <code>useFetch()</code>, que advertía en cada
refetch fallido.</li>
</ul>
<p>Qué revisar al actualizar:</p>
<ul>
<li class=""><strong><code>.catch(() =&gt; {})</code> en lecturas a las que no haces await</strong> ya no es necesario; elimínalo. Conserva un catch que haga algo,
los catch en mutaciones y los que terminan una cadena <code>.then()</code>, ya que <code>.then()</code> devuelve una nueva Promise. El codemod
de v0.19 lo elimina en <code>fetch()</code> de <code>get</code>, <code>getList</code> o <code>getList.getPage</code> de un resource cuando nada usa el resultado.</li>
<li class=""><strong>Reporte de errores (opcional)</strong>: una lectura fallida a la que no haces await ya no llega a los manejadores globales de rechazos no manejados,
como la configuración por defecto de Sentry. Los fetch iniciados por hooks nunca llegaban. Para enviar cada fetch fallido a Sentry u otro
rastreador, agrega un <a class="" href="https://dataclient.io/es/docs/concepts/managers#error-reporting">Manager de reporte de errores</a>.</li>
<li class=""><strong>Una lectura que ningún componente renderiza</strong>, como el <code>getPage</code> de un botón "cargar más": nada muestra su error, así que envuelve la llamada en
<a class="" href="https://dataclient.io/es/docs/api/useLoading">useLoading()</a> o hazle <code>await</code>.</li>
<li class=""><strong>Un <a class="" href="https://dataclient.io/es/rest/api/Endpoint">Endpoint</a> escrito a mano que cambia datos</strong> necesita <code>sideEffect: true</code>, como antes; sin él,
sus fallos ahora también pasan en silencio.</li>
</ul>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// .catch() kept a failed refresh from rejecting unhandled</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const </span><span class="token function-variable function" style="color:rgb(130, 170, 255)">refresh </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">() </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>TodoResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>getList<span class="token punctuation" style="color:rgb(199, 146, 234)">).</span><span class="token function" style="color:rgb(130, 170, 255)">catch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(() </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{});</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// the error is stored for the components rendering the list</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const </span><span class="token function-variable function" style="color:rgb(130, 170, 255)">refresh </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">() </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>TodoResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>getList<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div></div></div></div></figure>
<p><a href="https://github.com/reactive/data-client/pull/4670" target="_blank" rel="noopener noreferrer" class="">#4670</a></p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="dc-global"><code>__DC_CONTROLLERS__</code> ahora es <code>__DC__</code><a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#dc-global" class="hash-link" aria-label="Enlace directo al dc-global" title="Enlace directo al dc-global" translate="no">​</a></h4>
<p><code>react</code> <code>vue</code></p>
<p>Omite esta sección si ningún script o herramienta de depuración tuyo lee <code>globalThis.__DC_CONTROLLERS__</code>.</p>
<p>En desarrollo, <a class="" href="https://dataclient.io/es/docs/api/DevToolsManager#controllers">DevToolsManager</a> ahora pone el store en <code>globalThis.__DC__</code>,
cuyos <code>controller</code> y <code>actions</code> leen el store de la página, en lugar del Map <code>__DC_CONTROLLERS__</code>. Con varios stores,
<code>__DC__.stores</code> lista sus claves y asignar <code>__DC__.store</code> elige uno.</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-js codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-js codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">__DC_CONTROLLERS__<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">get</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">'Data Client: My App'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">).</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">getState</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div></code></pre></div></div><div class="language-js codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-js codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">__DC__<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>store <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">'Data Client: My App'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">; </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// only needed with several stores</span><br></div><div class="token-line">__DC__<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>controller<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">getState</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div></code></pre></div></div></div></div></div></figure>
<p>El codemod de v0.19 hace este cambio en los archivos JavaScript y TypeScript que le pases, incluidos los scripts que no
importan Data Client, y agrega un comentario <code>TODO(data-client)</code> en los demás usos de <code>__DC_CONTROLLERS__</code>. Entre ellos está el código que
maneja un store ausente, ya que <code>__DC__.controller</code> lanza un error donde <code>.get(name)</code> devolvía <code>undefined</code>.
<a href="https://github.com/reactive/data-client/pull/4393" target="_blank" rel="noopener noreferrer" class="">#4393</a>, <a href="https://github.com/reactive/data-client/pull/4435" target="_blank" rel="noopener noreferrer" class="">#4435</a></p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="custom-managers">Para autores de Managers personalizados<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#custom-managers" class="hash-link" aria-label="Enlace directo al Para autores de Managers personalizados" title="Enlace directo al Para autores de Managers personalizados" translate="no">​</a></h3>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="manager-middleware">Manager.middleware es obligatorio<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#manager-middleware" class="hash-link" aria-label="Enlace directo al Manager.middleware es obligatorio" title="Enlace directo al Manager.middleware es obligatorio" translate="no">​</a></h4>
<p><code>react</code> <code>vue</code></p>
<p>Omite esta sección si tus <a class="" href="https://dataclient.io/es/docs/api/Manager">Managers</a> ya definen <code>middleware</code>.</p>
<p><code>getMiddleware()</code> fue reemplazado por la propiedad <a class="" href="https://dataclient.io/es/docs/api/Manager#middleware">middleware</a> en
<a href="https://0.18.dataclient.io/es/blog/2024/07/13/v0.14-release-announcement" target="_self" class="">v0.14</a>; ahora se elimina. Un Manager que todavía lo define, o que no tiene
ningún middleware, es un error de TypeScript y lanza un error cuando <code>DataProvider</code> o <code>DataClientPlugin</code> se monta en desarrollo.
Renombra <code>getMiddleware()</code> a una propiedad <code>middleware</code>. El codemod de v0.19 lo hace cuando <code>getMiddleware()</code> solo devuelve una
función, y da a un Manager sin middleware uno de paso. Donde no puede convertir con seguridad, como
<code>super.getMiddleware()</code>, deja el código y agrega un comentario <code>TODO(data-client)</code>:</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">LoggingManager </span><span class="token keyword" style="font-style:italic">implements </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  getMiddleware <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">()</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span> Middleware <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> controller <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> next <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token keyword" style="font-style:italic">async</span> action <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token builtin" style="color:rgb(130, 170, 255)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">'before'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> action<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> controller<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getState</span><span class="token punctuation" style="color:rgb(199, 146, 234)">());</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">await </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token builtin" style="color:rgb(130, 170, 255)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">'after'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> action<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> controller<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getState</span><span class="token punctuation" style="color:rgb(199, 146, 234)">());</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">cleanup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">LoggingManager </span><span class="token keyword" style="font-style:italic">implements </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  middleware<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token function-variable function" style="color:rgb(130, 170, 255)">Middleware </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> controller <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> next <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token keyword" style="font-style:italic">async</span> action <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token builtin" style="color:rgb(130, 170, 255)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">'before'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> action<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> controller<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getState</span><span class="token punctuation" style="color:rgb(199, 146, 234)">());</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">await </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token builtin" style="color:rgb(130, 170, 255)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">'after'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> action<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> controller<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getState</span><span class="token punctuation" style="color:rgb(199, 146, 234)">());</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">cleanup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<p><a href="https://github.com/reactive/data-client/pull/4382" target="_blank" rel="noopener noreferrer" class="">#4382</a></p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="manager-cleanup">El cleanup() de un Manager ya no significa que el store haya desaparecido<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#manager-cleanup" class="hash-link" aria-label="Enlace directo al El cleanup() de un Manager ya no significa que el store haya desaparecido" title="Enlace directo al El cleanup() de un Manager ya no significa que el store haya desaparecido" translate="no">​</a></h4>
<p><code>react</code></p>
<p>Omite esta sección si tus <a class="" href="https://dataclient.io/es/docs/api/Manager">Managers</a> personalizados no inician temporizadores, conexiones ni listeners.</p>
<p><a class="" href="https://dataclient.io/es/docs/api/Manager#cleanup">cleanup()</a> ahora pausa un Manager. No termina el store. <code>DataProvider</code> ejecuta
<a class="" href="https://dataclient.io/es/docs/api/Manager#init">init()</a> y <code>cleanup()</code> como el
<a href="https://react.dev/learn/synchronizing-with-effects#how-to-handle-the-effect-firing-twice-in-development" target="_blank" rel="noopener noreferrer" class="">setup y cleanup</a> de un Effect.
Así, React StrictMode, y <a href="https://react.dev/reference/react/Activity" target="_blank" rel="noopener noreferrer" class=""><code>&lt;Activity&gt;</code></a> al ocultar un <code>DataProvider</code>, llaman a
<code>cleanup()</code> y luego a <code>init()</code> sobre el mismo store. El store sigue aplicando acciones entre medias. Inicia los temporizadores y las
conexiones en <code>init()</code>, y deténlos en <code>cleanup()</code>. No reinicies el estado sobre el store en <code>cleanup()</code>. Aún pueden
llegar acciones después de <code>cleanup()</code>, así que protege los efectos secundarios con un campo que <code>cleanup()</code> limpie, como <code>this.channel?.postMessage()</code>.
<code>init()</code> recibe el estado actual del store, también al reanudar.</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">TimeManager </span><span class="token keyword" style="font-style:italic">implements </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">declare protected</span> intervalID<span class="token operator" style="color:rgb(137, 221, 255)">?:</span> ReturnType<span class="token operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token keyword" style="font-style:italic">typeof</span> setInterval<span class="token operator" style="color:rgb(137, 221, 255)">&gt;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  middleware<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token function-variable function" style="color:rgb(130, 170, 255)">Middleware </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> controller <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>intervalID <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">setInterval</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(() </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">      controller<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">set</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>CurrentTime<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">1 </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}, {</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> time<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Date<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">now</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() });</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">}, </span><span class="token number" style="color:rgb(247, 140, 108)">1000</span><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return</span> next <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token keyword" style="font-style:italic">async</span> action <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">cleanup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {</span><br></div><div class="token-line">    <span class="token function" style="color:rgb(130, 170, 255)">clearInterval</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>intervalID<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">TimeManager </span><span class="token keyword" style="font-style:italic">implements </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">declare protected</span> controller<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Controller<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">declare protected</span> intervalID<span class="token operator" style="color:rgb(137, 221, 255)">?:</span> ReturnType<span class="token operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token keyword" style="font-style:italic">typeof</span> setInterval<span class="token operator" style="color:rgb(137, 221, 255)">&gt;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  middleware<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token function-variable function" style="color:rgb(130, 170, 255)">Middleware </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> controller <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>controller <span class="token operator" style="color:rgb(137, 221, 255)">=</span> controller<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return</span> next <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token keyword" style="font-style:italic">async</span> action <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">init</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>intervalID <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">setInterval</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(() </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>controller<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">set</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">        CurrentTime<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">        <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">1 </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">        <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> time<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Date<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">now</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() },</span><br></div><div class="token-line">      <span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">}, </span><span class="token number" style="color:rgb(247, 140, 108)">1000</span><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">cleanup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {</span><br></div><div class="token-line">    <span class="token function" style="color:rgb(130, 170, 255)">clearInterval</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>intervalID<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<p>En React 18 y posteriores, un <code>DataProvider</code> desmontado ahora pasa las acciones a sus Managers, así que se envía su <code>fetch()</code>. React ignora la actualización del store, así que las promesas que la esperan nunca se resuelven: <code>set()</code>, <code>setResponse()</code>, <code>resetEntireStore()</code> y <code>fetch()</code> de un endpoint sin <code>sideEffect</code>. No les hagas <code>await</code> después del desmontaje. React 16 y 17 siguen descartando estas acciones. <code>NetworkManager.cleanupDate</code> se elimina, ya que nada lo lee. Elimina el código que lo lee o lo define; el codemod de v0.19 agrega un comentario <code>TODO(data-client)</code> sobre cada uso. <a href="https://github.com/reactive/data-client/pull/4593" target="_blank" rel="noopener noreferrer" class="">#4593</a></p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="migrate-tests">Para autores de pruebas<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#migrate-tests" class="hash-link" aria-label="Enlace directo al Para autores de pruebas" title="Enlace directo al Para autores de pruebas" translate="no">​</a></h3>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="test-react-0.19">@data-client/test requiere @data-client/react 0.19<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#test-react-0.19" class="hash-link" aria-label="Enlace directo al @data-client/test requiere @data-client/react 0.19" title="Enlace directo al @data-client/test requiere @data-client/react 0.19" translate="no">​</a></h4>
<p><code>test</code></p>
<p>Omite esta sección si no usas <a href="https://www.npmjs.com/package/@data-client/test" target="_blank" rel="noopener noreferrer" class="">@data-client/test</a>.</p>
<p>Se elimina la compatibilidad con <code>@data-client/react</code> 0.12 a 0.18. Actualiza <code>@data-client/react</code> a la misma versión que
<code>@data-client/test</code>, como hace el comando de instalación de arriba. Los tipos de fixtures importados de <code>@data-client/test</code> y de
<code>@data-client/react/mock</code> ahora son los mismos tipos. <a href="https://github.com/reactive/data-client/pull/4414" target="_blank" rel="noopener noreferrer" class="">#4414</a></p>
<p><a class="" href="https://dataclient.io/es/docs/api/makeRenderDataHook">makeRenderDataHook()</a> ahora pasa <code>managers</code> a su Provider como una función, la forma que
recomienda 0.19. Un Provider personalizado debe aceptar <code>managers: () =&gt; Manager[]</code>, como lo hace
<a class="" href="https://dataclient.io/es/docs/api/DataProvider#managers">DataProvider</a>. <a href="https://github.com/reactive/data-client/pull/4601" target="_blank" rel="noopener noreferrer" class="">#4601</a></p>
<p><a class="" href="https://dataclient.io/es/docs/api/renderDataHook#optionsmanagers">renderDataHook()</a> antes ignoraba su opción <code>managers</code> y siempre ejecutaba un
<code>NetworkManager</code> y un <code>SubscriptionManager</code>. Ahora la lista que pasas los reemplaza, y <code>renderDataHook()</code> lanza un error si no
tiene <code>NetworkManager</code>. Para que las pruebas sigan ejecutándose como antes, el codemod de v0.19 agrega ambos a una lista <code>managers</code> de Managers <code>new</code>
que no los tiene. <a href="https://github.com/reactive/data-client/pull/4602" target="_blank" rel="noopener noreferrer" class="">#4602</a></p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="test-react-native">Las pruebas de React Native necesitan @testing-library/react-native<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#test-react-native" class="hash-link" aria-label="Enlace directo al Las pruebas de React Native necesitan @testing-library/react-native" title="Enlace directo al Las pruebas de React Native necesitan @testing-library/react-native" translate="no">​</a></h4>
<p><code>test</code></p>
<p>Los proyectos de React Native que prueban con <code>@data-client/test</code> necesitan tener instalado
<a href="https://www.npmjs.com/package/@testing-library/react-native" target="_blank" rel="noopener noreferrer" class="">@testing-library/react-native</a>.
<a href="https://github.com/reactive/data-client/pull/4595" target="_blank" rel="noopener noreferrer" class="">#4595</a></p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="future-releases">Prepárate para futuras versiones<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#future-releases" class="hash-link" aria-label="Enlace directo al Prepárate para futuras versiones" title="Enlace directo al Prepárate para futuras versiones" translate="no">​</a></h3>
<p>Nada de esto es necesario para actualizar a 0.19; tu código sigue funcionando tal cual. Cada elemento dejará de funcionar en una versión futura,
así que actualizarlo ahora hace que esa actualización no requiera cambios. El codemod de v0.19 también abandona APIs obsoletas más antiguas: renombra las
opciones <code>actionsBlacklist</code> / <code>actionsWhitelist</code> de DevTools a <code>actionsDenylist</code> / <code>actionsAllowlist</code>, renombra
<code>resource().create</code> a <a class="" href="https://dataclient.io/es/rest/api/resource#push">getList.push</a> donde se ejecuta el endpoint (para un resource declarado en
el archivo o importado desde una ruta relativa o un alias de tsconfig), hace los dos cambios siguientes y agrega un
comentario <code>TODO(data-client)</code> en el resto. Pasa <code>--deprecations=only</code> para hacerlo en su propio commit, después de <code>--deprecations=false</code> para la
actualización. <a href="https://github.com/reactive/data-client/pull/4669" target="_blank" rel="noopener noreferrer" class="">#4669</a></p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="future-pk-args">Los args de Entity.pk() son readonly<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#future-pk-args" class="hash-link" aria-label="Enlace directo al Los args de Entity.pk() son readonly" title="Enlace directo al Los args de Entity.pk() son readonly" translate="no">​</a></h4>
<p><code>endpoint</code> <code>rest</code> <code>graphql</code></p>
<p>Omite esto si no sobrescribes <code>static pk()</code> con un parámetro <code>args</code> tipado.</p>
<p><a class="" href="https://dataclient.io/es/rest/api/Entity#pk">Entity.pk()</a> ahora tipa <code>args</code> como <code>readonly any[]</code>. Las sobrescrituras que lo anotan como un array
mutable siguen compilando por ahora, pero una versión futura exigirá <code>readonly</code>. El codemod de v0.19 hace este cambio y
agrega un comentario <code>TODO(data-client)</code> donde la sobrescritura modifica <code>args</code> o lo tipa con un tipo con nombre.</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">User </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">static </span><span class="token function" style="color:rgb(130, 170, 255)">pk</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>value<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> parent<span class="token operator" style="color:rgb(137, 221, 255)">?: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> key<span class="token operator" style="color:rgb(137, 221, 255)">?: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> args<span class="token operator" style="color:rgb(137, 221, 255)">?: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[]) {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return </span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">${</span>value<span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span>id<span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token template-string string" style="color:rgb(195, 232, 141)">-</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">${</span>args<span class="token template-string interpolation operator" style="color:rgb(137, 221, 255)">?.</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token template-string interpolation number" style="color:rgb(247, 140, 108)">0</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token template-string interpolation operator" style="color:rgb(137, 221, 255)">?.</span>org<span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">User </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">static </span><span class="token function" style="color:rgb(130, 170, 255)">pk</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>value<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> parent<span class="token operator" style="color:rgb(137, 221, 255)">?: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> key<span class="token operator" style="color:rgb(137, 221, 255)">?: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> args<span class="token operator" style="color:rgb(137, 221, 255)">?: </span><span class="token keyword" style="font-style:italic">readonly </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[]) {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return </span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">${</span>value<span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span>id<span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token template-string string" style="color:rgb(195, 232, 141)">-</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">${</span>args<span class="token template-string interpolation operator" style="color:rgb(137, 221, 255)">?.</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token template-string interpolation number" style="color:rgb(247, 140, 108)">0</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token template-string interpolation operator" style="color:rgb(137, 221, 255)">?.</span>org<span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="future-create-data-client">createDataClient() de Vue<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#future-create-data-client" class="hash-link" aria-label="Enlace directo al createDataClient() de Vue" title="Enlace directo al createDataClient() de Vue" translate="no">​</a></h4>
<p><code>vue</code></p>
<p>Omite esto si instalas el store con <code>app.use(DataClientPlugin)</code>.</p>
<p><code>createDataClient()</code> y <code>ProvidedDataClient</code> son internos de <a class="" href="https://dataclient.io/es/vue/api/DataClientPlugin">DataClientPlugin</a> y dejarán
de exportarse. Instala el plugin en su lugar y lee el controller con
<a class="" href="https://dataclient.io/es/vue/api/useController">useController()</a>. <a href="https://github.com/reactive/data-client/pull/4193" target="_blank" rel="noopener noreferrer" class="">#4193</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> createDataClient <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/vue'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> controller <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">createDataClient</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> managers<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> initialState <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> DataClientPlugin<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> useController <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/vue'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">app<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">use</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>DataClientPlugin<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> managers<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> initialState <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// in a component's setup()</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> controller <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useController</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div></code></pre></div></div></div></div></div></figure>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="future-wait-for-next-update">waitForNextUpdate() de renderDataCompose() en Vue<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#future-wait-for-next-update" class="hash-link" aria-label="Enlace directo al waitForNextUpdate() de renderDataCompose() en Vue" title="Enlace directo al waitForNextUpdate() de renderDataCompose() en Vue" translate="no">​</a></h4>
<p><code>vue</code></p>
<p>Omite esto si tus pruebas de Vue no llaman a <code>waitForNextUpdate()</code>.</p>
<p><code>waitForNextUpdate()</code> de <a class="" href="https://dataclient.io/es/vue/guides/unit-testing-composables#renderdatacompose-api">renderDataCompose()</a> se rinde
en silencio después de 1 segundo, así que una prueba puede pasar mientras el composable sigue suspendido. Se eliminará. Haz <code>await</code> del
resultado en su lugar, y llama a <code>allSettled()</code> después de cambiar props o de llamar al controller; ahora también espera al
fetch que inicia un cambio de props. El codemod de v0.19 hace este cambio. Justo después del render, elimina la espera cuando la
siguiente línea hace await de <code>result</code>, y en otro caso agrega un comentario <code>TODO(data-client)</code>, ya que la llamada anterior también esperaba a un
<code>result</code> que fuera una Promise.
<a href="https://github.com/reactive/data-client/pull/4221" target="_blank" rel="noopener noreferrer" class="">#4221</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> result<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> waitForNextUpdate <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">await </span><span class="token function" style="color:rgb(130, 170, 255)">renderDataCompose</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>props<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">number </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span><br></div><div class="token-line">    <span class="token function" style="color:rgb(130, 170, 255)">useSuspense</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>ArticleResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">, () </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> id<span class="token operator" style="color:rgb(137, 221, 255)">:</span> props<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>id <span class="token punctuation" style="color:rgb(199, 146, 234)">})),</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> props<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> resolverFixtures <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">await </span><span class="token function" style="color:rgb(130, 170, 255)">waitForNextUpdate</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> article <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">await</span> result<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">props<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>id <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token number" style="color:rgb(247, 140, 108)">6</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">await </span><span class="token function" style="color:rgb(130, 170, 255)">waitForNextUpdate</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> result<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> allSettled <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">await </span><span class="token function" style="color:rgb(130, 170, 255)">renderDataCompose</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>props<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">number </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span><br></div><div class="token-line">    <span class="token function" style="color:rgb(130, 170, 255)">useSuspense</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>ArticleResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">, () </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> id<span class="token operator" style="color:rgb(137, 221, 255)">:</span> props<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>id <span class="token punctuation" style="color:rgb(199, 146, 234)">})),</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> props<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> resolverFixtures <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> article <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">await</span> result<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">props<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>id <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token number" style="color:rgb(247, 140, 108)">6</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">await </span><span class="token function" style="color:rgb(130, 170, 255)">allSettled</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="adopt-features">Adopta las nuevas funcionalidades<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#adopt-features" class="hash-link" aria-label="Enlace directo al Adopta las nuevas funcionalidades" title="Enlace directo al Adopta las nuevas funcionalidades" translate="no">​</a></h3>
<p>Opcional una vez que estés en 0.19. Ejecuta el codemod en su propio commit:</p>
<div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc">npx @data-client/codemods v0.19 src/ <span class="token parameter variable" style="color:rgb(191, 199, 213)">--improvements</span><span class="token operator" style="color:rgb(137, 221, 255)">=</span>only<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div>
<p>Agrupa en un <a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#batch-set" class="">set() por lotes</a> los bucles de <code>ctrl.set()</code>, y elimina el código que 0.19 vuelve innecesario: las
<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#set-invalidate" class="">eliminaciones</a> de una sola fila, el <a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#vue-gc" class=""><code>gcPolicy</code></a> por defecto de Vue y los <a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#vue-getter-args" class="">argumentos <code>computed()</code></a>, y las
<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#deleted-entity-undefined" class="">comprobaciones</a> de <code>typeof data === 'symbol'</code>. Tras agrupar en lotes, un Manager que compara acciones SET por
<code>action.schema</code> verá <code>[Ticker]</code> en lugar de <code>Ticker</code> (<a href="https://github.com/reactive/data-client/pull/4697" target="_blank" rel="noopener noreferrer" class="">#4697</a>).</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="upgrade-support">Soporte de actualización<a href="https://dataclient.io/es/blog/2026/11/18/v0.19-batch-set#upgrade-support" class="hash-link" aria-label="Enlace directo al Soporte de actualización" title="Enlace directo al Soporte de actualización" translate="no">​</a></h3>
<p>Como siempre, si tienes algún problema o pregunta, puedes unirte a nuestro <a href="https://discord.gg/wXGV27xm6t" target="_blank" rel="noopener noreferrer" class=""><img decoding="async" loading="lazy" src="https://img.shields.io/discord/768254430381735967.svg?style=flat-square&amp;colorB=758ED3" alt="Chat" class="img_SS3x"></a> o <a href="https://github.com/reactive/data-client/issues/new/choose" target="_blank" rel="noopener noreferrer" class="">reportar un bug</a></p>]]></content>
        <author>
            <name>Nathaniel Tucker</name>
            <uri>https://github.com/ntucker</uri>
        </author>
        <category label="Versiones" term="Versiones"/>
        <category label="Rendimiento" term="Rendimiento"/>
        <category label="Managers" term="Managers"/>
        <category label="Vue" term="Vue"/>
        <category label="React Native" term="React Native"/>
        <category label="REST" term="REST"/>
        <category label="Schemas" term="Schemas"/>
        <category label="Collections" term="Collections"/>
        <category label="Validación" term="Validación"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Data Client para agentes de programación]]></title>
        <id>https://dataclient.io/es/blog/2026/10/06/coding-agents</id>
        <link href="https://dataclient.io/es/blog/2026/10/06/coding-agents"/>
        <updated>2026-10-06T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Las Agent Skills, un plugin de Claude Code, la depuración con Chrome DevTools MCP y llms.txt ayudan a los agentes de programación a escribir, depurar y actualizar aplicaciones de Data Client]]></summary>
        <content type="html"><![CDATA[<div class="theme-admonition theme-admonition-note admonition_WCGJ alert alert--secondary"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>nota</div><div class="admonitionContent_pbrs"><p>El original en inglés cambió después de esta traducción, así que puede estar desactualizada.</p></div></div>
<!-- -->
<p>Los agentes de programación escriben hoy mucho código de Data Client, y lo escriben mejor cuando cuentan con la documentación y
los flujos de trabajo actuales en lugar de adivinar a partir de versiones anteriores. Este ciclo de lanzamientos facilita configurar eso para cualquier agente.</p>
<p><strong>Nuevo:</strong></p>
<ul>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/10/06/coding-agents#claude-plugin">Plugin de Claude Code</a> - <code>claude plugin install react@data-client</code> instala las skills para tu framework</li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/10/06/coding-agents#vue-skills">Skills de Vue</a> - Los proyectos de Vue reciben composables y pruebas de Vue, no hooks de React</li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/10/06/coding-agents#llms-txt">llms.txt</a> - Cualquier agente puede leer la documentación como markdown, y cada página le indica dónde buscar</li>
</ul>
<p><strong>También disponible:</strong></p>
<ul>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/10/06/coding-agents#skills">Agent Skills</a> - Define APIs REST, diseña schemas, escribe Managers y prueba; <a class="" href="https://dataclient.io/es/blog/2026/10/06/coding-agents#setup">/data-client-setup</a> ahora instala solo las que necesitas, y se <a class="" href="https://dataclient.io/es/blog/2026/10/06/coding-agents#generated-references">generan a partir de esta documentación</a></li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/10/06/coding-agents#debugging">Chrome DevTools MCP</a> - Los agentes inspeccionan el store de tu aplicación en ejecución, o usan Expo MCP para React Native</li>
<li class=""><a class="" href="https://dataclient.io/es/blog/2026/10/06/coding-agents#upgrades">Skills de actualización</a> - Las skills de migración actualizan tu código, incluso lo que los codemods no pueden</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="setup">Primeros pasos<a href="https://dataclient.io/es/blog/2026/10/06/coding-agents#setup" class="hash-link" aria-label="Enlace directo al Primeros pasos" title="Enlace directo al Primeros pasos" translate="no">​</a></h2>
<p>Instala la skill <a href="https://skills.sh/reactive/data-client/data-client-setup" target="_blank" rel="noopener noreferrer" class="">/data-client-setup</a> y ejecútala. Detecta
React o Vue y tu estilo de API (REST, GraphQL o personalizado), instala las skills que tu proyecto necesita y configura
Data Client. Para REST delega en
<a href="https://skills.sh/reactive/data-client/data-client-rest-setup" target="_blank" rel="noopener noreferrer" class="">data-client-rest-setup</a>, que migra las llamadas existentes a <code>fetch</code> o
axios a endpoints (<a href="https://github.com/reactive/data-client/pull/4153" target="_blank" rel="noopener noreferrer" class="">#4153</a>).</p>
<div class="theme-tabs-container tabs-container tabList_J5MA"><ul role="tablist" aria-orientation="horizontal" class="tabs tabs_qwsy"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_l0OV tabs__item--active">Claude Code plugin</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">Cursor plugin</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">Codex plugin</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">Skills CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">OpenSkills</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_wHwb"><div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc">claude plugin marketplace <span class="token function" style="color:rgb(130, 170, 255)">add</span> reactive/data-client<br></div><div class="token-line command_MhHc">claude plugin <span class="token function" style="color:rgb(130, 170, 255)">install</span> data-client@data-client<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="agentPrompt__MJg"><button type="button" class="clean-btn prompt_J3Oq" aria-describedby="_R_k9qllq9_"><svg class="spark_sePl" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"></path><path d="M20 3v4"></path><path d="M22 5h-4"></path><path d="M4 17v2"></path><path d="M5 18H3"></path></svg><span class="text_e86Q">/add-plugin data-client@https://github.com/reactive/data-client</span><span class="copyIcons_gf7Z" aria-hidden="true"><svg class="copyIcon_GHJa" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></svg><svg class="checkIcon_mm76" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg></span></button><span role="tooltip" id="_R_k9qllq9_" class="tip_NYx7 tip_cCYE" aria-live="polite">Copiar el prompt para Cursor</span></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">codex plugin marketplace add reactive/data-client \<br></div><div class="token-line">  --sparse .claude-plugin --sparse .agents/skills<br></div><div class="token-line">codex plugin add data-client@data-client<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">npx skills add reactive/data-client --skill data-client-setup<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">npx openskills install reactive/data-client/.agents/skills/data-client-setup<br></div></code></pre></div></div></div></div></div>
<p><a class="" href="https://dataclient.io/es/docs/getting-started/agent-skills">Agent Skills</a> enumera todas las skills y cómo instalarlas todas desde el principio.</p>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="claude-plugin">Plugin de Claude Code<a href="https://dataclient.io/es/blog/2026/10/06/coding-agents#claude-plugin" class="hash-link" aria-label="Enlace directo al Plugin de Claude Code" title="Enlace directo al Plugin de Claude Code" translate="no">​</a></h2>
<p>El repositorio de Data Client es un marketplace de plugins de Claude Code. El plugin <code>core</code> contiene las skills de configuración, REST, GraphQL, schemas y
Managers; los plugins <code>react</code> y <code>vue</code> añaden las skills de su framework e incorporan <code>core</code>; y el plugin <code>migrations</code>
añade las skills de actualización (<a href="https://github.com/reactive/data-client/pull/4153" target="_blank" rel="noopener noreferrer" class="">#4153</a>). La página
<a class="" href="https://dataclient.io/es/docs/getting-started/agent-skills">Agent Skills</a> muestra la misma instalación con la CLI de skills y OpenSkills.</p>
<div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc">claude plugin marketplace <span class="token function" style="color:rgb(130, 170, 255)">add</span> reactive/data-client<br></div><div class="token-line command_MhHc">claude plugin <span class="token function" style="color:rgb(130, 170, 255)">install</span> react@data-client<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div>
<p>Usa <code>vue@data-client</code> para Vue, <code>core@data-client</code> si no usas ninguno de los dos, y añade <code>migrations@data-client</code> antes de una actualización.</p>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="vue-skills">Skills de Vue<a href="https://dataclient.io/es/blog/2026/10/06/coding-agents#vue-skills" class="hash-link" aria-label="Enlace directo al Skills de Vue" title="Enlace directo al Skills de Vue" translate="no">​</a></h2>
<p>Los proyectos de Vue antes recibían la skill de hooks de React, así que los agentes recurrían a patrones de React. La
skill <a href="https://skills.sh/reactive/data-client/data-client-vue" target="_blank" rel="noopener noreferrer" class="">data-client-vue</a> escribe código de <code>DataClientPlugin</code> y de composables,
y <a class="" href="https://dataclient.io/es/vue/getting-started/debugging#debugging-with-agents">depura una aplicación en ejecución</a>
(<a href="https://github.com/reactive/data-client/pull/4126" target="_blank" rel="noopener noreferrer" class="">#4126</a>).
<a href="https://skills.sh/reactive/data-client/data-client-vue-testing" target="_blank" rel="noopener noreferrer" class="">data-client-vue-testing</a> escribe pruebas con <code>renderDataCompose()</code>
y <code>mountDataClient()</code> (<a href="https://github.com/reactive/data-client/pull/4126" target="_blank" rel="noopener noreferrer" class="">#4126</a>) que siguen las
<a class="" href="https://dataclient.io/es/vue/guides/unit-testing-composables">guías de pruebas de Vue</a> (<a href="https://github.com/reactive/data-client/pull/4181" target="_blank" rel="noopener noreferrer" class="">#4181</a>).</p>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="llms-txt">llms.txt<a href="https://dataclient.io/es/blog/2026/10/06/coding-agents#llms-txt" class="hash-link" aria-label="Enlace directo al llms.txt" title="Enlace directo al llms.txt" translate="no">​</a></h2>
<p>Los agentes sin skills pueden leer la documentación como markdown, siguiendo la convención <a href="https://llmstxt.org/" target="_blank" rel="noopener noreferrer" class="">llms.txt</a>
(<a href="https://github.com/reactive/data-client/pull/4171" target="_blank" rel="noopener noreferrer" class="">#4171</a>, <a href="https://github.com/reactive/data-client/pull/4236" target="_blank" rel="noopener noreferrer" class="">#4236</a>):</p>
<ul>
<li class=""><a href="https://dataclient.io/llms.txt" target="_blank" rel="noopener noreferrer" class="">llms.txt</a> para React y <a href="https://dataclient.io/vue/llms.txt" target="_blank" rel="noopener noreferrer" class="">vue/llms.txt</a> para Vue indexan todas las páginas, y el <code>llms-full.txt</code> junto a cada uno las contiene todas en un solo archivo</li>
<li class=""><a href="https://dataclient.io/rest/llms.txt" target="_blank" rel="noopener noreferrer" class="">rest/llms.txt</a> y <a href="https://dataclient.io/graphql/llms.txt" target="_blank" rel="noopener noreferrer" class="">graphql/llms.txt</a> cubren solo la API de ese paquete</li>
<li class="">Cualquier página de la documentación es markdown cuando añades <code>.md</code> a su URL, como <a href="https://dataclient.io/docs/api/useSuspense.md" target="_blank" rel="noopener noreferrer" class="">/docs/api/useSuspense.md</a></li>
</ul>
<p>Cada página enlaza su llms.txt en <code>&lt;head&gt;</code>, y cada página de la documentación enlaza su markdown, de modo que un agente al que se le da la URL de cualquier página
los encuentra por su cuenta.</p>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="generated-references">Las skills coinciden con la documentación<a href="https://dataclient.io/es/blog/2026/10/06/coding-agents#generated-references" class="hash-link" aria-label="Enlace directo al Las skills coinciden con la documentación" title="Enlace directo al Las skills coinciden con la documentación" translate="no">​</a></h2>
<p>Las páginas de referencia de las skills ahora se generan por framework a partir de esta documentación, así que incluyen fragmentos compartidos como los comandos
de instalación y dan a los proyectos de Vue solo código de Vue. Una comprobación de CI falla cuando una skill se desvía de la documentación, así que las skills se mantienen
al día con cada lanzamiento (<a href="https://github.com/reactive/data-client/pull/4170" target="_blank" rel="noopener noreferrer" class="">#4170</a>).</p>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="also-available">También disponible<a href="https://dataclient.io/es/blog/2026/10/06/coding-agents#also-available" class="hash-link" aria-label="Enlace directo al También disponible" title="Enlace directo al También disponible" translate="no">​</a></h2>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="skills">Skills para cada tarea<a href="https://dataclient.io/es/blog/2026/10/06/coding-agents#skills" class="hash-link" aria-label="Enlace directo al Skills para cada tarea" title="Enlace directo al Skills para cada tarea" translate="no">​</a></h3>
<p>Más allá de la configuración, hay skills para cada parte de una aplicación de Data Client. <code>/data-client-setup</code> instala las que tu proyecto
usa:</p>
<ul>
<li class=""><a href="https://skills.sh/reactive/data-client/data-client-rest-setup" target="_blank" rel="noopener noreferrer" class="">data-client-rest-setup</a> migra clientes <code>fetch</code>, axios, ky, got o superagent a <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint">RestEndpoint</a>, junto con la <a class="" href="https://dataclient.io/es/rest/guides/axios-migration">guía de migración desde axios</a> y su codemod (<a href="https://github.com/reactive/data-client/pull/3867" target="_blank" rel="noopener noreferrer" class="">#3867</a>)</li>
<li class=""><a href="https://skills.sh/reactive/data-client/data-client-graphql-setup" target="_blank" rel="noopener noreferrer" class="">data-client-graphql-setup</a> y <a href="https://skills.sh/reactive/data-client/data-client-endpoint-setup" target="_blank" rel="noopener noreferrer" class="">data-client-endpoint-setup</a> cubren GraphQL y funciones asíncronas personalizadas</li>
<li class=""><a href="https://skills.sh/reactive/data-client/data-client-rest" target="_blank" rel="noopener noreferrer" class="">data-client-rest</a> define APIs con <a class="" href="https://dataclient.io/es/rest/api/resource">resource()</a> y <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint">RestEndpoint</a></li>
<li class=""><a href="https://skills.sh/reactive/data-client/data-client-schema" target="_blank" rel="noopener noreferrer" class="">data-client-schema</a> diseña schemas <a class="" href="https://dataclient.io/es/rest/api/Entity">Entity</a>, <a class="" href="https://dataclient.io/es/rest/api/Collection">Collection</a>, <a class="" href="https://dataclient.io/es/rest/api/Union">Union</a> y <a class="" href="https://dataclient.io/es/rest/api/Query">Query</a></li>
<li class=""><a href="https://skills.sh/reactive/data-client/data-client-manager" target="_blank" rel="noopener noreferrer" class="">data-client-manager</a> escribe <a class="" href="https://dataclient.io/es/docs/concepts/managers">Managers</a> para websockets, SSE, sondeo (polling) y registro de logs</li>
<li class=""><a href="https://skills.sh/reactive/data-client/data-client-react" target="_blank" rel="noopener noreferrer" class="">data-client-react</a> y <a href="https://skills.sh/reactive/data-client/data-client-react-testing" target="_blank" rel="noopener noreferrer" class="">data-client-react-testing</a> usan y prueban los hooks de React</li>
</ul>
<p>Explóralas todas en <a href="https://skills.sh/reactive/data-client" target="_blank" rel="noopener noreferrer" class="">skills.sh/reactive/data-client</a>.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="debugging">Depurar una aplicación en ejecución<a href="https://dataclient.io/es/blog/2026/10/06/coding-agents#debugging" class="hash-link" aria-label="Enlace directo al Depurar una aplicación en ejecución" title="Enlace directo al Depurar una aplicación en ejecución" translate="no">​</a></h3>
<p>Pregúntale a tu agente "¿por qué esto no volvió a obtener los datos?" o "¿qué hay en la caché ahora mismo?" y podrá revisar la aplicación en ejecución en lugar
de adivinar a partir del código. En modo de desarrollo, <a class="" href="https://dataclient.io/es/docs/api/DevToolsManager#controllers">DevToolsManager</a> coloca el
<a class="" href="https://dataclient.io/es/docs/api/Controller">Controller</a> de cada store en <code>globalThis.__DC_CONTROLLERS__</code>, así que un agente conectado mediante
<a href="https://github.com/ChromeDevTools/chrome-devtools-mcp" target="_blank" rel="noopener noreferrer" class="">Chrome DevTools MCP</a>, o
<a href="https://docs.expo.dev/eas/ai/mcp/" target="_blank" rel="noopener noreferrer" class="">Expo MCP</a> para React Native, puede leer el store, seguir las acciones despachadas y
relacionarlas con las solicitudes de red. El mapa está disponible en navegadores, React Native y Node
(<a href="https://github.com/reactive/data-client/pull/3753" target="_blank" rel="noopener noreferrer" class="">#3753</a>).</p>
<div class="language-js codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Browser DevTools console</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-js codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">__DC_CONTROLLERS__<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">get</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">'Data Client: My App'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">).</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">getState</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div></code></pre></div></div>
<p>Las skills de React y Vue aprovechan esto mediante Chrome DevTools MCP; consulta
<a class="" href="https://dataclient.io/es/docs/getting-started/debugging#debugging-with-agents">depuración con agentes</a> para ver qué pueden inspeccionar.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="upgrades">Skills de actualización<a href="https://dataclient.io/es/blog/2026/10/06/coding-agents#upgrades" class="hash-link" aria-label="Enlace directo al Skills de actualización" title="Enlace directo al Skills de actualización" translate="no">​</a></h3>
<p>Las skills también se encargan de las actualizaciones. La skill de v0.18 ejecuta el <a href="https://dataclient.io/es/assets/files/v0.18-57a9e93e47ddbc37fc4ab436a1aa882b.js" target="_blank" class="">codemod</a> y luego se ocupa de lo que este no puede, como
registrar <a class="" href="https://dataclient.io/es/rest/api/SchemaSimple"><code>argsKey</code></a> para los schemas cuya salida depende de los argumentos del endpoint
(<a href="https://0.18.dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#migration-guide" target="_self" class="">migración a v0.18</a>). La skill de path-to-regexp v8 reescribe
la <a href="https://0.18.dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#path-to-regexp-v8" target="_self" class="">sintaxis de rutas</a> en tus endpoints.</p>
<div class="theme-tabs-container tabs-container tabList_J5MA"><ul role="tablist" aria-orientation="horizontal" class="tabs tabs_qwsy"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_l0OV tabs__item--active">Skills CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">OpenSkills</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_wHwb"><div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc">npx skills <span class="token function" style="color:rgb(130, 170, 255)">add</span> reactive/data-client <span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><br></div><div class="token-line">  <span class="token parameter variable" style="color:rgb(191, 199, 213)">--skill</span> data-client-v0.18-migration <span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><br></div><div class="token-line">  <span class="token parameter variable" style="color:rgb(191, 199, 213)">--skill</span> path-to-regexp-v8-migration<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">npx openskills install reactive/data-client/.agents/skills/data-client-v0.18-migration<br></div><div class="token-line">npx openskills install reactive/data-client/.agents/skills/path-to-regexp-v8-migration<br></div></code></pre></div></div></div></div></div>]]></content>
        <author>
            <name>Nathaniel Tucker</name>
            <uri>https://github.com/ntucker</uri>
        </author>
        <category label="Agentes de IA" term="Agentes de IA"/>
        <category label="Vue" term="Vue"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[v0.18: Scalar, descargas de archivos tipadas, Collections conscientes de filtros]]></title>
        <id>https://dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads</id>
        <link href="https://dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads"/>
        <updated>2026-05-01T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Campos de entidad dependientes de un lens con Scalar, descargas de archivos tipadas mediante content de RestEndpoint, manejo automático de binarios y nonFilterArgumentKeys en resource() para collections conscientes del ordenamiento]]></summary>
        <content type="html"><![CDATA[<p>v0.18 se centra en un modelado de datos más rico para valores que varían según el contexto de la petición, descargas tipadas más simples y una coincidencia de collections que refleja mejor los filtros reales de las APIs.</p>
<p><strong>Nuevas funcionalidades:</strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#scalar" target="_self" class="">Schema Scalar</a> - Campos de entidad dependientes de un lens (p. ej. valores específicos de un portafolio) sin mutar jamás la entidad subyacente</li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#content-property" target="_self" class="">Propiedad <code>content</code> de RestEndpoint</a> - Descargas de archivos tipadas, respuestas de texto y streaming con una sola propiedad</li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#non-filter-argument-keys" target="_self" class=""><code>nonFilterArgumentKeys</code> en resource()</a> - Los argumentos de ordenamiento/paginación no fragmentan tus <a class="" href="https://dataclient.io/es/rest/api/Collection">Collections</a></li>
</ul>
<p><strong>Otras mejoras:</strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#binary-auto-detection" target="_self" class="">Detección automática de Content-Type binarios</a> - Las imágenes, PDFs y otras respuestas binarias se manejan automáticamente sin configuración (<a href="https://github.com/reactive/data-client/pull/3868" target="_blank" rel="noopener noreferrer" class="">#3868</a>)</li>
<li class=""><a class="" href="https://dataclient.io/es/rest/api/Collection">Los tipos de body de los extenders de Collection coinciden con la semántica del método HTTP</a> - Los extenders PATCH (<code>.move</code>, <code>.remove</code>) aceptan bodies parciales; un <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint">RestEndpoint</a> independiente deriva un body tipado a partir del schema de entidad de la <a class="" href="https://dataclient.io/es/rest/api/Collection">Collection</a> (<a href="https://github.com/reactive/data-client/pull/3910" target="_blank" rel="noopener noreferrer" class="">#3910</a>)</li>
<li class="">Se exporta <a class="" href="https://dataclient.io/es/rest/api/Collection"><code>CollectionOptions</code></a> desde <code>@data-client/endpoint</code> y <code>@data-client/rest</code> para construir <a class="" href="https://dataclient.io/es/rest/api/Collection">Collections</a> con tipado (<a href="https://github.com/reactive/data-client/pull/3904" target="_blank" rel="noopener noreferrer" class="">#3904</a>)</li>
</ul>
<div data-playground="true" class="playgroundQueryContainer_vBqa"><div class="playgroundContainer_sLUA row_YGZs stacked_Xny5" data-store-host="true" data-store-open="true" data-store-beside="true"><div class="playgroundTextEdit_rt2K"><div class="playgroundHeader_Zx4K firstSelected_dcsf noupper_WDCF tabControls_trxh"><div class="tabs_m54V" role="tablist" aria-orientation="horizontal" aria-label="Archivos"><div role="tab" aria-selected="true" tabindex="0" class="tab_bTGw selected_QXZk">api/Company</div><div role="tab" aria-selected="false" tabindex="-1" class="tab_bTGw">CompanyGrid</div><div role="tab" aria-selected="false" tabindex="-1" class="tab_bTGw">PortfolioGrid</div></div></div><div class="editorDocs_INVk"><div class="playgroundEditor_lYwu"><div><pre class="prism-code language-ts" style="margin:0;outline:none;padding:10px;font-family:inherit;color:#bfc7d5;background-color:transparent" spellcheck="false"><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token punctuation" style="color:#c792ea">{ </span><span class="token class-name" style="color:#ffcb6b">Collection</span><span class="token punctuation" style="color:#c792ea">, </span><span class="token class-name" style="color:#ffcb6b">Entity</span><span class="token punctuation" style="color:#c792ea">, </span><span class="token class-name" style="color:#ffcb6b">RestEndpoint</span><span class="token punctuation" style="color:#c792ea">, </span><span class="token class-name" style="color:#ffcb6b">Scalar </span><span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'@data-client/rest'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">
</span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">export class </span><span class="token class-name" style="color:#ffcb6b">Company </span><span class="token keyword" style="color:#7da4f6;font-style:italic">extends </span><span class="token class-name" style="color:#ffcb6b">Entity </span><span class="token punctuation" style="color:#c792ea">{
</span></span><span class="token-line">  id <span class="token punctuation" style="color:#c792ea">= </span><span class="token string" style="color:#b6d986">''</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">  name <span class="token punctuation" style="color:#c792ea">= </span><span class="token string" style="color:#b6d986">''</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">  price <span class="token punctuation" style="color:#c792ea">= </span><span class="token number" style="color:#f78c6c">0</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">  pct_equity <span class="token punctuation" style="color:#c792ea">= </span><span class="token number" style="color:#f78c6c">0</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">  shares <span class="token punctuation" style="color:#c792ea">= </span><span class="token number" style="color:#f78c6c">0</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">}
</span></span><span class="token-line">
</span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">const </span><span class="token class-name" style="color:#ffcb6b">PortfolioScalar </span><span class="token punctuation" style="color:#c792ea">= </span><span class="token keyword" style="color:#7da4f6;font-style:italic">new </span><span class="token class-name" style="color:#ffcb6b">Scalar</span><span class="token punctuation" style="color:#c792ea">({
</span></span><span class="token-line">  lens<span class="token punctuation" style="color:#c792ea">: </span>args <span class="token punctuation" style="color:#c792ea">=&gt; </span>args<span class="token punctuation" style="color:#c792ea">[</span><span class="token number" style="color:#f78c6c">0</span><span class="token punctuation" style="color:#c792ea">]?.</span>portfolio<span class="token punctuation" style="color:#c792ea">,
</span></span><span class="token-line">  key<span class="token punctuation" style="color:#c792ea">: </span><span class="token string" style="color:#b6d986">'portfolio'</span><span class="token punctuation" style="color:#c792ea">,
</span></span><span class="token-line">  entity<span class="token punctuation" style="color:#c792ea">: </span><span class="token class-name" style="color:#ffcb6b">Company</span><span class="token punctuation" style="color:#c792ea">,
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">});
</span></span><span class="token-line"><span class="token class-name" style="color:#ffcb6b">Company</span><span class="token punctuation" style="color:#c792ea">.</span>schema <span class="token punctuation" style="color:#c792ea">= {
</span></span><span class="token-line">  pct_equity<span class="token punctuation" style="color:#c792ea">: </span><span class="token class-name" style="color:#ffcb6b">PortfolioScalar</span><span class="token punctuation" style="color:#c792ea">,
</span></span><span class="token-line">  shares<span class="token punctuation" style="color:#c792ea">: </span><span class="token class-name" style="color:#ffcb6b">PortfolioScalar</span><span class="token punctuation" style="color:#c792ea">,
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">};
</span></span><span class="token-line">
</span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">export const </span>getCompanies <span class="token punctuation" style="color:#c792ea">= </span><span class="token keyword" style="color:#7da4f6;font-style:italic">new </span><span class="token class-name" style="color:#ffcb6b">RestEndpoint</span><span class="token punctuation" style="color:#c792ea">({
</span></span><span class="token-line">  path<span class="token punctuation" style="color:#c792ea">: </span><span class="token string" style="color:#b6d986">'/companies'</span><span class="token punctuation" style="color:#c792ea">,
</span></span><span class="token-line">  searchParams<span class="token punctuation" style="color:#c792ea">: {} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">as </span><span class="token punctuation" style="color:#c792ea">{ </span>portfolio<span class="token punctuation" style="color:#c792ea">: </span><span class="token keyword" style="color:#7da4f6;font-style:italic">string </span><span class="token punctuation" style="color:#c792ea">},
</span></span><span class="token-line">  <span class="token comment" style="color:#697098;font-style:italic">// `portfolio` is a lens, not a filter — the returned Company list is the same
</span></span><span class="token-line">  <span class="token comment" style="color:#697098;font-style:italic">// regardless of lens. Dropping it from `argsKey` collapses every portfolio to
</span></span><span class="token-line">  <span class="token comment" style="color:#697098;font-style:italic">// one Collection pk, so `Collection.queryKey()` finds the list on every
</span></span><span class="token-line">  <span class="token comment" style="color:#697098;font-style:italic">// switch and `useSuspense` reuses it without refetching.
</span></span><span class="token-line">  schema<span class="token punctuation" style="color:#c792ea">: </span><span class="token keyword" style="color:#7da4f6;font-style:italic">new </span><span class="token class-name" style="color:#ffcb6b">Collection</span><span class="token punctuation" style="color:#c792ea">([</span><span class="token class-name" style="color:#ffcb6b">Company</span><span class="token punctuation" style="color:#c792ea">], { </span>argsKey<span class="token punctuation" style="color:#c792ea">: () =&gt; ({}) }),
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">});
</span></span><span class="token-line">
</span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">export const </span>getPortfolioColumns <span class="token punctuation" style="color:#c792ea">= </span><span class="token keyword" style="color:#7da4f6;font-style:italic">new </span><span class="token class-name" style="color:#ffcb6b">RestEndpoint</span><span class="token punctuation" style="color:#c792ea">({
</span></span><span class="token-line">  path<span class="token punctuation" style="color:#c792ea">: </span><span class="token string" style="color:#b6d986">'/companies/columns'</span><span class="token punctuation" style="color:#c792ea">,
</span></span><span class="token-line">  searchParams<span class="token punctuation" style="color:#c792ea">: {} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">as </span><span class="token punctuation" style="color:#c792ea">{ </span>portfolio<span class="token punctuation" style="color:#c792ea">: </span><span class="token keyword" style="color:#7da4f6;font-style:italic">string </span><span class="token punctuation" style="color:#c792ea">},
</span></span><span class="token-line">  schema<span class="token punctuation" style="color:#c792ea">: </span><span class="token keyword" style="color:#7da4f6;font-style:italic">new </span><span class="token class-name" style="color:#ffcb6b">Collection</span><span class="token punctuation" style="color:#c792ea">([</span><span class="token class-name" style="color:#ffcb6b">PortfolioScalar</span><span class="token punctuation" style="color:#c792ea">], {
</span></span><span class="token-line">    argsKey<span class="token punctuation" style="color:#c792ea">: ({ </span>portfolio <span class="token punctuation" style="color:#c792ea">}: { </span>portfolio<span class="token punctuation" style="color:#c792ea">: </span><span class="token keyword" style="color:#7da4f6;font-style:italic">string </span><span class="token punctuation" style="color:#c792ea">}) =&gt; ({ </span>portfolio <span class="token punctuation" style="color:#c792ea">}),
</span></span><span class="token-line">  <span class="token punctuation" style="color:#c792ea">}),
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">});
</span></span></pre></div></div><div class="playgroundEditor_lYwu hidden_Hh8i"></div><div class="playgroundEditor_lYwu hidden_Hh8i"></div></div></div><div class="previewWrapper_edd2 wide-embed-part"><div class="playgroundHeader_Zx4K previewHeader_MW_M"><span class="liveLabel_MHnJ"><span class="liveLabelText_k6qc">Vista previa en vivo</span></span><span class="routerSlot_CTii"></span><span class="previewControls_oxCt"><button type="button" class="clean-btn headerButton_h2KM fixturesToggle_OTR0" title="Fixtures" aria-label="Fixtures" aria-expanded="false" aria-controls="_R_3c5qllq9_"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 20V4"></path><path d="m3 8 4-4 4 4"></path><path d="M17 4v16"></path><path d="m21 16-4 4-4-4"></path></svg></button><button type="button" class="clean-btn headerButton_h2KM resetButton_knTA" title="Reiniciar la vista previa" aria-label="Reiniciar la vista previa" disabled=""><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 12a9 9 0 1 0 2.64-6.36L3 8.3"></path><path d="M3 3v5.3h5.3"></path></svg></button><button type="button" class="clean-btn headerButton_h2KM storeHeaderToggle_ToEw" title="Mostrar acciones" aria-label="Acciones" aria-pressed="false" disabled="" data-store-toggle="actions"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13 12h8M13 18h8M13 6h8M3 12h1M3 18h1M3 6h1M8 12h1M8 18h1M8 6h1"></path></svg></button><button type="button" class="clean-btn headerButton_h2KM storeHeaderToggle_ToEw" title="Ocultar el store" aria-label="Store" aria-pressed="true" disabled="" data-store-toggle="store"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><ellipse cx="12" cy="5" rx="8" ry="3"></ellipse><path d="M4 5v14c0 1.66 3.58 3 8 3s8-1.34 8-3V5"></path><path d="M4 12c0 1.66 3.58 3 8 3s8-1.34 8-3"></path></svg></button></span></div><div class="fixturesAnchor_fieO"><div id="_R_3c5qllq9_" class="fixturesPopover_bQwj wide-embed-part"></div></div><div class="playgroundResult_tefG"><div class="playground-preview playgroundPreview_rk9R"><div class="sheet_FVCk sheet" aria-busy="true"><div class="skeletonPage" role="status" aria-label="Loading"><span class="skeleton"></span><span class="skeleton"></span><span class="skeleton"></span><span class="skeleton"></span></div></div></div><div class="storePanel_hPQV" data-visible="true"><div class="playground-preview" aria-hidden="true"><div class="sheet_FVCk sheet" aria-busy="true"><div class="skeletonPage" role="status" aria-label="Loading"><span class="skeleton"></span><span class="skeleton"></span><span class="skeleton"></span><span class="skeleton"></span></div></div></div></div><div class="quickLookHost_EhLO stageHues_MizR"></div></div></div><div id="_R_5qllq9_" class="storeHost_N0SU" data-open="true"><div class="storeDrawer_Jaf2"><div class="drawerTabs_MT7c" role="tablist" aria-orientation="vertical"><button type="button" role="tab" class="clean-btn storeTab_EY4O" title="Mostrar acciones" aria-label="Acciones" aria-selected="false" tabindex="-1" aria-controls="_R_5qllq9_" data-store-toggle="actions"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13 12h8M13 18h8M13 6h8M3 12h1M3 18h1M3 6h1M8 12h1M8 18h1M8 6h1"></path></svg></button><button type="button" role="tab" class="clean-btn storeTab_EY4O" title="Ocultar el store" aria-label="Store" aria-selected="true" tabindex="0" aria-controls="_R_5qllq9_" data-store-toggle="store"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><ellipse cx="12" cy="5" rx="8" ry="3"></ellipse><path d="M4 5v14c0 1.66 3.58 3 8 3s8-1.34 8-3V5"></path><path d="M4 12c0 1.66 3.58 3 8 3s8-1.34 8-3"></path></svg></button></div></div></div></div></div>
<p>El ejemplo muestra las mismas entidades <code>Company</code> renderizadas a través de distintos lenses de portafolio. Los campos estables de la <a class="" href="https://dataclient.io/es/rest/api/Entity">Entity</a> se reutilizan, mientras que los valores dependientes del lens se seleccionan de celdas <a class="" href="https://dataclient.io/es/rest/api/Scalar"><code>Scalar</code></a> separadas.</p>
<p><strong><a href="https://0.18.dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#migration-guide" target="_self" class="">Cambios incompatibles:</a></strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#denormalize-delegate" target="_self" class="">Schema.denormalize() recibe un delegate</a> - <code>denormalize(input, args, unvisit)</code> → <code>denormalize(input, delegate)</code>. Afecta solo a implementaciones personalizadas de <a class="" href="https://dataclient.io/es/rest/api/SchemaSimple">Schema</a>.</li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#normalize-delegate" target="_self" class="">Schema.normalize() recibe un delegate</a> - <code>normalize(input, parent, key, args, visit, delegate)</code> → <code>normalize(input, parent, key, delegate)</code>. Afecta solo a implementaciones personalizadas de <a class="" href="https://dataclient.io/es/rest/api/SchemaSimple">Schema</a>.</li>
</ul>
<p><strong>¿Usas un agente de IA?</strong> Instala la skill de migración: ejecuta el codemod, registra
<a class="" href="https://dataclient.io/es/rest/api/SchemaSimple"><code>argsKey</code></a> para los schemas que dependen de los argumentos y se encarga de los casos que el codemod
no puede resolver (campos de clase, asignación dinámica de métodos, bloques <code>&lt;script&gt;</code> de SFC, helpers personalizados):</p>
<div class="theme-tabs-container tabs-container tabList_J5MA"><ul role="tablist" aria-orientation="horizontal" class="tabs tabs_qwsy"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_l0OV tabs__item--active">Skills CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">OpenSkills</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_wHwb"><div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc">npx skills <span class="token function" style="color:rgb(130, 170, 255)">add</span> reactive/data-client <span class="token parameter variable" style="color:rgb(191, 199, 213)">--skill</span> data-client-v0.18-migration<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">npx openskills install reactive/data-client/.agents/skills/data-client-v0.18-migration<br></div></code></pre></div></div></div></div></div>
<p>De lo contrario, ejecuta el <a href="https://dataclient.io/es/assets/files/v0.18-57a9e93e47ddbc37fc4ab436a1aa882b.js" target="_blank" class="">codemod</a> directamente; cubre los casos comunes:</p>
<div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc">npx jscodeshift <span class="token parameter variable" style="color:rgb(191, 199, 213)">-t</span> https://dataclient.io/codemods/v0.18.js <span class="token parameter variable" style="color:rgb(191, 199, 213)">--extensions</span><span class="token operator" style="color:rgb(137, 221, 255)">=</span>ts,tsx,js,jsx src/<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div>
<!-- -->
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="scalar">Scalar<a href="https://dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#scalar" class="hash-link" aria-label="Enlace directo al Scalar" title="Enlace directo al Scalar" translate="no">​</a></h2>
<p><a class="" href="https://dataclient.io/es/rest/api/Scalar">Scalar</a> maneja campos de <a class="" href="https://dataclient.io/es/rest/api/Entity">Entity</a> cuyos valores dependen de un "lens" en tiempo de ejecución, como el
portafolio, la moneda o la configuración regional seleccionados. Varios componentes pueden renderizar la <strong>misma</strong> entidad a través de
distintos lenses simultáneamente, cada uno viendo los valores correctos, mientras la entidad en sí nunca
cambia. Los valores dependientes del lens viven en una tabla de celdas separada y se unen al momento de desnormalizar
a partir de los argumentos del endpoint.</p>
<p>Las referencias a <code>name</code> y <code>price</code> permanecen estables al cambiar de portafolio porque la entidad <code>Company</code>
en sí nunca cambia; solo lo hace la celda <a class="" href="https://dataclient.io/es/rest/api/Scalar"><code>Scalar</code></a> seleccionada por el lens actual. Una sola instancia de <a class="" href="https://dataclient.io/es/rest/api/Scalar"><code>Scalar</code></a>
puede servir tanto como campo de <a class="" href="https://dataclient.io/es/rest/api/Entity#schema"><code>Entity.schema</code></a> (la entidad padre se infiere de la visita) como
de forma independiente dentro de <a class="" href="https://dataclient.io/es/rest/api/Values"><code>Values</code></a>, <a class="" href="https://dataclient.io/es/rest/api/Array"><code>[Scalar]</code></a>
o <a class="" href="https://dataclient.io/es/rest/api/Collection"><code>Collection([Scalar])</code></a> para refrescos baratos de solo columnas (la entidad se vincula
explícitamente mediante <a class="" href="https://dataclient.io/es/rest/api/Scalar#entity"><code>entity</code></a>). Las pks de las celdas se derivan de la clave del mapa o mediante
<a class="" href="https://dataclient.io/es/rest/api/Scalar#entityPk"><code>Scalar.entityPk()</code></a>, que por defecto usa <a class="" href="https://dataclient.io/es/rest/api/Entity#pk"><code>Entity.pk()</code></a>, de modo que las claves primarias personalizadas y
compuestas funcionan sin necesidad de sobrescribir nada.</p>
<p>El store normalizado mantiene la entidad estable y las celdas del lens separadas:</p>
<div class="language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">entities['Company']['1'] = {<br></div><div class="token-line">  id: '1',<br></div><div class="token-line">  price: 145.20,<br></div><div class="token-line">  pct_equity: ['1', 'pct_equity', 'Company'],<br></div><div class="token-line">  shares: ['1', 'shares', 'Company'],<br></div><div class="token-line">}<br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">entities['Scalar(portfolio)']['Company|1|A'] = { pct_equity: 0.50, shares: 10000 }<br></div><div class="token-line">entities['Scalar(portfolio)']['Company|1|B'] = { pct_equity: 0.30, shares: 6000 }<br></div></code></pre></div></div>
<p>La demo combina <code>getCompanies</code> con un refresco barato de solo lens, <code>getPortfolioColumns</code>, que escribe
en la misma tabla de celdas; consulta la <a class="" href="https://dataclient.io/es/rest/api/Scalar">documentación de Scalar</a> para un recorrido completo
del comportamiento de la caché.</p>
<p><a class="" href="https://dataclient.io/es/rest/api/Scalar"><code>Scalar</code></a> también implementa <a class="" href="https://dataclient.io/es/rest/api/Scalar#queryKey">queryKey</a>, por lo que participa directamente en
<a class="" href="https://dataclient.io/es/docs/api/useQuery">useQuery</a>, <a class="" href="https://dataclient.io/es/docs/api/Controller#get">Controller.get</a> y <a class="" href="https://dataclient.io/es/rest/api/Query">schema.Query</a>,
toda la superficie <a class="" href="https://dataclient.io/es/rest/api/schema#queryable">Queryable</a>, enumerando sus celdas para el lens actual.</p>
<p><a href="https://github.com/reactive/data-client/pull/3887" target="_blank" rel="noopener noreferrer" class="">#3887</a> - <a class="" href="https://dataclient.io/es/rest/api/Scalar">Documentación de Scalar</a></p>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="content-property">Propiedad <code>content</code> de RestEndpoint<a href="https://dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#content-property" class="hash-link" aria-label="Enlace directo al content-property" title="Enlace directo al content-property" translate="no">​</a></h2>
<p><a class="" href="https://dataclient.io/es/rest/api/RestEndpoint">RestEndpoint</a> ahora acepta una propiedad <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#content"><code>content</code></a> que controla
cómo se analiza el cuerpo de la respuesta. El tipo de retorno se infiere automáticamente a partir del valor, y <code>schema</code> queda
restringido a <code>undefined</code> a nivel de tipos para los tipos de contenido que no son JSON.</p>
<div class="language-typescript codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-typescript codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> RestEndpoint <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> downloadFile <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/files/:id/download'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line theme-code-block-highlighted-line">  content<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'blob'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  dataExpiryLength<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Return type is Blob — inferred from content, no explicit generics needed</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> blob<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Blob <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">await</span> ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>downloadFile<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'123' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<p>Antes, las descargas de archivos requerían una sobrescritura verbosa de <code>parseResponse</code>. Ahora es una sola propiedad.</p>
<div class="table-scroll"><table><thead><tr><th>Valor</th><th>Se analiza mediante</th><th>Tipo de retorno</th></tr></thead><tbody><tr><td><code>'json'</code></td><td><code>response.json()</code></td><td><code>any</code></td></tr><tr><td><code>'blob'</code></td><td><code>response.blob()</code></td><td><code>Blob</code></td></tr><tr><td><code>'text'</code></td><td><code>response.text()</code></td><td><code>string</code></td></tr><tr><td><code>'arrayBuffer'</code></td><td><code>response.arrayBuffer()</code></td><td><code>ArrayBuffer</code></td></tr><tr><td><code>'stream'</code></td><td><code>response.body</code></td><td><code>ReadableStream&lt;Uint8Array&gt;</code></td></tr></tbody></table></div>
<p>Establecer <code>content</code> en un valor que no sea JSON obliga a <code>schema: undefined</code> a nivel de tipos, ya que los datos binarios no pueden
normalizarse. Una comprobación en tiempo de ejecución ofrece un mensaje de error claro si se usa por accidente un schema normalizable.</p>
<p>Funciona con <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#extend"><code>extend()</code></a> y con <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#inheritance">subclases</a>:</p>
<div class="language-typescript codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-typescript codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Extend a JSON endpoint into a blob downloader</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> download <span class="token operator" style="color:rgb(137, 221, 255)">=</span> jsonEndpoint<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">extend</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  content<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'blob'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">undefined</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Subclass for a reusable blob endpoint type</span><br></div><div class="token-line"><span class="token class-name keyword" style="color:rgb(255, 203, 107);font-style:italic">class</span> BlobEndpoint<span class="token operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token constant" style="color:rgb(130, 170, 255)">O </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestGenerics </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token operator" style="color:rgb(137, 221, 255)">&gt; </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token class-name constant" style="color:rgb(130, 170, 255)">O</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  content <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">'blob' </span><span class="token keyword" style="font-style:italic">as const</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div>
<p><a href="https://github.com/reactive/data-client/pull/3868" target="_blank" rel="noopener noreferrer" class="">#3868</a> - <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#content">Documentación de <code>content</code></a></p>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="non-filter-argument-keys"><code>nonFilterArgumentKeys</code> en resource()<a href="https://dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#non-filter-argument-keys" class="hash-link" aria-label="Enlace directo al non-filter-argument-keys" title="Enlace directo al non-filter-argument-keys" translate="no">​</a></h2>
<p><a class="" href="https://dataclient.io/es/rest/api/Collection#nonFilterArgumentKeys"><code>nonFilterArgumentKeys</code></a> permite a <a class="" href="https://dataclient.io/es/rest/api/resource">resource()</a>
declarar qué claves de argumentos <em>no</em> se usan para filtrar los resultados de la collection; normalmente opciones de ordenamiento,
paginación o visualización. Sin ella, cada combinación distinta de argumentos de ordenamiento o página crearía un bucket separado de
<a class="" href="https://dataclient.io/es/rest/api/Collection">Collection</a>, y los elementos recién creados no aparecerían en las listas con
argumentos de ordenamiento distintos aunque los datos subyacentes deberían coincidir.</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> Entity<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> resource <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">Post </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  id <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  title <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  group <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  author <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> PostResource <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">resource</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/:group/posts/:id'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  searchParams<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{} </span><span class="token keyword" style="font-style:italic">as </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> orderBy<span class="token operator" style="color:rgb(137, 221, 255)">?: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span> author<span class="token operator" style="color:rgb(137, 221, 255)">?: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Post<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line theme-code-block-highlighted-line">  nonFilterArgumentKeys<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">'orderBy'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">],</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<p>Ahora <code>group</code> y <code>author</code> son claves de filtro (separan las <a class="" href="https://dataclient.io/es/rest/api/Collection">Collections</a> en buckets), pero <code>orderBy</code> se
comparte: <code>PostResource.getList.push()</code> agrega el nuevo post a <em>todas</em> las variantes de <code>orderBy</code> de un bucket
<code>{ group, author }</code> dado.</p>
<p>Acepta un <code>string[]</code>, una <code>RegExp</code> o una función predicado:</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">nonFilterArgumentKeys<span class="token operator" style="color:rgb(137, 221, 255)">: </span>/<span class="token regex regex-source language-regex anchor function" style="color:rgb(130, 170, 255)">^</span><span class="token regex regex-source language-regex group punctuation" style="color:rgb(199, 146, 234)">(</span>orderBy<span class="token regex regex-source language-regex alternation keyword" style="font-style:italic">|</span>page<span class="token regex regex-source language-regex alternation keyword" style="font-style:italic">|</span>cursor<span class="token regex regex-source language-regex group punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token regex regex-source language-regex anchor function" style="color:rgb(130, 170, 255)">$</span>/<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div></code></pre></div></div>
<p><a href="https://github.com/reactive/data-client/pull/3914" target="_blank" rel="noopener noreferrer" class="">#3914</a> - <a class="" href="https://dataclient.io/es/rest/api/Collection#nonFilterArgumentKeys">Documentación de <code>nonFilterArgumentKeys</code></a></p>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="binary-auto-detection">Detección automática de Content-Type binarios<a href="https://dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#binary-auto-detection" class="hash-link" aria-label="Enlace directo al Detección automática de Content-Type binarios" title="Enlace directo al Detección automática de Content-Type binarios" translate="no">​</a></h2>
<p>Cuando <code>content</code> no está establecido, <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#parseResponse"><code>parseResponse</code></a> ahora detecta automáticamente los
Content-Type binarios y devuelve <code>response.blob()</code> en lugar de corromper los datos mediante <code>.text()</code>.</p>
<p>Los tipos binarios como <code>image/*</code>, <code>audio/*</code>, <code>video/*</code>, <code>font/*</code>, <code>application/octet-stream</code>, <code>application/pdf</code> y
otros ahora se manejan automáticamente. Los tipos de texto (<code>text/*</code>, XML, HTML, JavaScript, CSS, etc.) siguen
usando el respaldo de texto existente con mensajes de error que tienen en cuenta el schema.</p>
<p>Esto significa que los endpoints que sirven datos binarios con cabeceras Content-Type correctas funcionan sin ninguna configuración:</p>
<div class="language-typescript codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-typescript codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> ep <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/avatars/:id'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Server responds with Content-Type: image/png</span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// → automatically returns a Blob (previously corrupted via .text())</span><br></div></code></pre></div></div>
<p><a href="https://github.com/reactive/data-client/pull/3868" target="_blank" rel="noopener noreferrer" class="">#3868</a></p>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="migration-guide">Guía de migración<a href="https://dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#migration-guide" class="hash-link" aria-label="Enlace directo al Guía de migración" title="Enlace directo al Guía de migración" translate="no">​</a></h2>
<p>Esta actualización requiere actualizar todas las versiones de los paquetes simultáneamente.</p>
<div class="theme-tabs-container tabs-container tabList_J5MA"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_l0OV tabs__item--active">NPM</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">Yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">esm.sh</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_wHwb"><div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc"><span class="token function" style="color:rgb(130, 170, 255)">npm install </span><span class="token parameter variable" style="color:rgb(191, 199, 213)">--save</span> @data-client/react@^0.18.0 @data-client/rest@^0.18.0 @data-client/endpoint@^0.18.0 @data-client/core@^0.18.0 @data-client/vue@^0.18.0 @data-client/test@^0.18.0 @data-client/img@^0.18.0<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">yarn add @data-client/react@^0.18.0 @data-client/rest@^0.18.0 @data-client/endpoint@^0.18.0 @data-client/core@^0.18.0 @data-client/vue@^0.18.0 @data-client/test@^0.18.0 @data-client/img@^0.18.0<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">pnpm add @data-client/react@^0.18.0 @data-client/rest@^0.18.0 @data-client/endpoint@^0.18.0 @data-client/core@^0.18.0 @data-client/vue@^0.18.0 @data-client/test@^0.18.0 @data-client/img@^0.18.0<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-html language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">&lt;script type="importmap"&gt;<br></div><div class="token-line">{<br></div><div class="token-line">  "imports": {<br></div><div class="token-line">    "@data-client/react": "https://esm.sh/@data-client/react@^0.18.0",<br></div><div class="token-line">    "@data-client/rest": "https://esm.sh/@data-client/rest@^0.18.0",<br></div><div class="token-line">    "@data-client/endpoint": "https://esm.sh/@data-client/endpoint@^0.18.0",<br></div><div class="token-line">    "@data-client/core": "https://esm.sh/@data-client/core@^0.18.0",<br></div><div class="token-line">    "@data-client/vue": "https://esm.sh/@data-client/vue@^0.18.0",<br></div><div class="token-line">    "@data-client/test": "https://esm.sh/@data-client/test@^0.18.0",<br></div><div class="token-line">    "@data-client/img": "https://esm.sh/@data-client/img@^0.18.0"<br></div><div class="token-line">  }<br></div><div class="token-line">}<br></div><div class="token-line">&lt;/script&gt;<br></div></code></pre></div></div></div></div></div>
<p>Los cambios incompatibles de esta versión afectan únicamente a las <strong>implementaciones personalizadas de <a class="" href="https://dataclient.io/es/rest/api/SchemaSimple">Schema</a></strong>.
Si solo usas <a class="" href="https://dataclient.io/es/rest/api/resource"><code>resource()</code></a> y los schemas integrados (<a class="" href="https://dataclient.io/es/rest/api/Entity"><code>Entity</code></a>,
<a class="" href="https://dataclient.io/es/rest/api/Collection"><code>Collection</code></a>, <a class="" href="https://dataclient.io/es/rest/api/Union"><code>Union</code></a>, <a class="" href="https://dataclient.io/es/rest/api/Values"><code>Values</code></a>,
<a class="" href="https://dataclient.io/es/rest/api/Array"><code>Array</code></a>, <a class="" href="https://dataclient.io/es/rest/api/Object"><code>Object</code></a>, <a class="" href="https://dataclient.io/es/rest/api/Query"><code>Query</code></a>,
<a class="" href="https://dataclient.io/es/rest/api/Invalidate"><code>Invalidate</code></a>, <a class="" href="https://dataclient.io/es/rest/api/Lazy"><code>Lazy</code></a>, <a class="" href="https://dataclient.io/es/rest/api/Scalar"><code>Scalar</code></a>), la actualización es directa.</p>
<p><strong>¿Tienes un Schema personalizado?</strong> Si usas un agente de IA, instala la skill de migración y deja que dirija
todo el flujo: codemod, registro de <code>argsKey</code> y limpieza manual:</p>
<div class="theme-tabs-container tabs-container tabList_J5MA"><ul role="tablist" aria-orientation="horizontal" class="tabs tabs_qwsy"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_l0OV tabs__item--active">Skills CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">OpenSkills</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_wHwb"><div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc">npx skills <span class="token function" style="color:rgb(130, 170, 255)">add</span> reactive/data-client <span class="token parameter variable" style="color:rgb(191, 199, 213)">--skill</span> data-client-v0.18-migration<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">npx openskills install reactive/data-client/.agents/skills/data-client-v0.18-migration<br></div></code></pre></div></div></div></div></div>
<p>Sin un agente, ejecuta el codemod y luego lee las secciones siguientes para los casos que no puede
manejar (especialmente <a href="https://dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#args-dependent-output" class=""><code>argsKey</code></a> para los schemas que dependen de los argumentos):</p>
<div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc">npx jscodeshift <span class="token parameter variable" style="color:rgb(191, 199, 213)">-t</span> https://dataclient.io/codemods/v0.18.js <span class="token parameter variable" style="color:rgb(191, 199, 213)">--extensions</span><span class="token operator" style="color:rgb(137, 221, 255)">=</span>ts,tsx,js,jsx src/<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="denormalize-delegate">Schema.denormalize() recibe un delegate<a href="https://dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#denormalize-delegate" class="hash-link" aria-label="Enlace directo al Schema.denormalize() recibe un delegate" title="Enlace directo al Schema.denormalize() recibe un delegate" translate="no">​</a></h3>
<p>Omite esta sección si no implementas clases <a class="" href="https://dataclient.io/es/rest/api/SchemaSimple">Schema</a> personalizadas.</p>
<p><a class="" href="https://dataclient.io/es/rest/api/SchemaSimple"><code>Schema.denormalize()</code></a> ahora es <code>(input, delegate)</code> en lugar de la firma anterior de 3 parámetros
<code>(input, args, unvisit)</code>. El nuevo
<a class="" href="https://dataclient.io/es/rest/api/SchemaSimple"><code>IDenormalizeDelegate</code></a> expone <code>unvisit</code>, <code>args</code> y un nuevo helper <code>argsKey(fn)</code>.
<a href="https://github.com/reactive/data-client/pull/3887" target="_blank" rel="noopener noreferrer" class="">#3887</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> Entity <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">Wrapper </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">denormalize</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">    input<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{},</span><br></div><div class="token-line">    args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">readonly </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[],</span><br></div><div class="token-line">    <span class="token function-variable function" style="color:rgb(130, 170, 255)">unvisit</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>s<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> v<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">const</span> value <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">unvisit</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> input<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">process</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>value<span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token operator" style="color:rgb(137, 221, 255)">...</span>args<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> Entity<span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token keyword" style="font-style:italic">type </span><span class="token class-name" style="color:rgb(255, 203, 107)">IDenormalizeDelegate </span><span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">Wrapper </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">denormalize</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>input<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{},</span> delegate<span class="token operator" style="color:rgb(137, 221, 255)">:</span> IDenormalizeDelegate<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">const</span> value <span class="token operator" style="color:rgb(137, 221, 255)">=</span> delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">unvisit</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> input<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">process</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>value<span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token operator" style="color:rgb(137, 221, 255)">...</span>delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>args<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<p>El codemod maneja métodos de clase, métodos de objeto, declaraciones de función, firmas de interfaces de
TypeScript y llamadas de paso directo <code>someSchema.denormalize(input, args, unvisit)</code>. También agrega
la importación de <a class="" href="https://dataclient.io/es/rest/api/SchemaSimple"><code>IDenormalizeDelegate</code></a> como especificador <code>type</code> en línea en tu importación existente de
<code>@data-client/*</code> (o crea una nueva línea <code>import type</code> si no encuentra ninguna).</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="args-dependent-output">Salida dependiente de los argumentos<a href="https://dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#args-dependent-output" class="hash-link" aria-label="Enlace directo al Salida dependiente de los argumentos" title="Enlace directo al Salida dependiente de los argumentos" translate="no">​</a></h4>
<p>Leer <a class="" href="https://dataclient.io/es/rest/api/SchemaSimple"><code>delegate.args</code></a> directamente <strong>no</strong> contribuye a la memoización. Si la <em>salida</em> de tu schema
depende de esos argumentos (p. ej. un lens), declara la dependencia mediante <a class="" href="https://dataclient.io/es/rest/api/SchemaSimple"><code>delegate.argsKey(fn)</code></a> para que la
caché se divida en buckets correctamente.</p>
<figure class="figure_HN5N"><figcaption class="caption_pMal">El codemod no puede inferir esta dependencia, así que actualiza estos schemas a mano.</figcaption><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">LensSchema </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">denormalize</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>input<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> unvisit<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">const</span> lens <span class="token operator" style="color:rgb(137, 221, 255)">=</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token operator" style="color:rgb(137, 221, 255)">?.</span>portfolio<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">lookup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>input<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> lens<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">LensSchema </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">constructor</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> lens <span class="token punctuation" style="color:rgb(199, 146, 234)">}) {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>lensSelector <span class="token operator" style="color:rgb(137, 221, 255)">=</span> lens<span class="token punctuation" style="color:rgb(199, 146, 234)">;  </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// ①</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">denormalize</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>input<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">const</span> lens <span class="token operator" style="color:rgb(137, 221, 255)">=</span> delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">argsKey</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>lensSelector<span class="token punctuation" style="color:rgb(199, 146, 234)">);  </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// ②</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">lookup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>input<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> lens<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div><ol class="callouts_q1Zq"><li><span class="marker_TC4U">①</span><span>The function reference is the cache key, so set it once here (or at module scope). An inline arrow would miss the cache on every call.</span></li><li><span class="marker_TC4U">②</span><span><code>argsKey</code> returns <code>fn(args)</code> and records the dependency for memoization.</span></li></ol></figure>
<p>Consulta <a class="" href="https://dataclient.io/es/rest/api/Scalar">Scalar</a> para ver un ejemplo desarrollado.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="normalize-delegate">Schema.normalize() recibe un delegate<a href="https://dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#normalize-delegate" class="hash-link" aria-label="Enlace directo al Schema.normalize() recibe un delegate" title="Enlace directo al Schema.normalize() recibe un delegate" translate="no">​</a></h3>
<p>Omite esta sección si no implementas clases <a class="" href="https://dataclient.io/es/rest/api/SchemaSimple">Schema</a> personalizadas.</p>
<p><a class="" href="https://dataclient.io/es/rest/api/SchemaSimple"><code>Schema.normalize()</code></a> ahora lee los argumentos del endpoint y el visitante recursivo desde
<a class="" href="https://dataclient.io/es/rest/api/SchemaSimple"><code>INormalizeDelegate</code></a>, en línea con la nueva forma del <a class="" href="https://dataclient.io/es/rest/api/SchemaSimple">delegate de denormalize</a>.
La firma anterior era <code>(input, parent, key, args, visit, delegate, parentEntity?)</code>;
la nueva firma es <code>(input, parent, key, delegate, parentEntity?)</code>.
<a href="https://github.com/reactive/data-client/pull/3934" target="_blank" rel="noopener noreferrer" class="">#3934</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import type </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> INormalizeDelegate<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> Visit <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">Wrapper </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">normalize</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">    input<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    parent<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    key<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">readonly </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[],</span><br></div><div class="token-line">    visit<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Visit<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    delegate<span class="token operator" style="color:rgb(137, 221, 255)">:</span> INormalizeDelegate<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">const</span> normalized <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">visit</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> input<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>value<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> input<span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token string" style="color:rgb(195, 232, 141)">'value'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">mergeEntity</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">pk</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>input<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> parent<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> key<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">),</span> normalized<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return</span> normalized<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import type </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> INormalizeDelegate <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">Wrapper </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">normalize</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">    input<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    parent<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    key<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    delegate<span class="token operator" style="color:rgb(137, 221, 255)">:</span> INormalizeDelegate<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">const </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> visit <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">const</span> normalized <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">visit</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> input<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>value<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> input<span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token string" style="color:rgb(195, 232, 141)">'value'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">mergeEntity</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">pk</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>input<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> parent<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> key<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">),</span> normalized<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return</span> normalized<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<p>Si tu schema acepta el argumento opcional <code>parentEntity</code>, mantenlo como el último argumento:</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">normalize</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>input<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> parent<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> key<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> parentEntity<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">  <span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// ...</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div>
<p><a class="" href="https://dataclient.io/es/rest/api/SchemaSimple"><code>delegate.visit()</code></a> ya lleva los mismos argumentos para la normalización recursiva, por lo que los
<a class="" href="https://dataclient.io/es/rest/api/schema">schemas</a> anidados no necesitan recibir los argumentos explícitamente.</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="additive-parententity-on-normalize">Aditivo: <code>parentEntity</code> en normalize<a href="https://dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#additive-parententity-on-normalize" class="hash-link" aria-label="Enlace directo al additive-parententity-on-normalize" title="Enlace directo al additive-parententity-on-normalize" translate="no">​</a></h4>
<p>El callback <code>visit()</code> del <a class="" href="https://dataclient.io/es/rest/api/SchemaSimple">delegate de normalize</a> rastrea internamente el schema de tipo entidad
más cercano que lo contiene y lo reenvía a <a class="" href="https://dataclient.io/es/rest/api/SchemaSimple"><code>Schema.normalize()</code></a> como el argumento final opcional
<code>parentEntity</code>. Los nuevos <a class="" href="https://dataclient.io/es/rest/api/schema">schemas</a> pueden optar por descubrir la entidad que los contiene
al momento de normalizar (usado internamente por <a class="" href="https://dataclient.io/es/rest/api/Scalar">Scalar</a>).</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="collection-consolidation">Opcional: consolidar las definiciones de Collection<a href="https://dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#collection-consolidation" class="hash-link" aria-label="Enlace directo al Opcional: consolidar las definiciones de Collection" title="Enlace directo al Opcional: consolidar las definiciones de Collection" translate="no">​</a></h4>
<p><a class="" href="https://dataclient.io/es/rest/api/Collection"><code>Collection</code></a> ahora puede usar tanto <a class="" href="https://dataclient.io/es/rest/api/Collection#argsKey"><code>argsKey</code></a> como
<a class="" href="https://dataclient.io/es/rest/api/Collection#nestKey"><code>nestKey</code></a> en la misma instancia. Como limpieza
opcional, reemplaza los pares de <a class="" href="https://dataclient.io/es/rest/api/Collection">Collections</a> de nivel superior y anidadas por una sola
definición compartida:</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">export const</span> getTodos <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/todos'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  searchParams<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{} </span><span class="token keyword" style="font-style:italic">as </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> userId<span class="token operator" style="color:rgb(137, 221, 255)">?: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">Collection</span><span class="token punctuation" style="color:rgb(199, 146, 234)">([</span>Todo<span class="token punctuation" style="color:rgb(199, 146, 234)">]),</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">User </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">static</span> schema <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    todos<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">Collection</span><span class="token punctuation" style="color:rgb(199, 146, 234)">([</span>Todo<span class="token punctuation" style="color:rgb(199, 146, 234)">], {</span><br></div><div class="token-line">      <span class="token function-variable function" style="color:rgb(130, 170, 255)">nestKey</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span> parent <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> userId<span class="token operator" style="color:rgb(137, 221, 255)">:</span> parent<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>id <span class="token punctuation" style="color:rgb(199, 146, 234)">}),</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">}),</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">export const</span> userTodos <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">Collection</span><span class="token punctuation" style="color:rgb(199, 146, 234)">([</span>Todo<span class="token punctuation" style="color:rgb(199, 146, 234)">], {</span><br></div><div class="token-line">  <span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">//argsKey: params =&gt; ({ ...params }), - this is default, so it's not needed</span><br></div><div class="token-line">  <span class="token function-variable function" style="color:rgb(130, 170, 255)">nestKey</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span> parent <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> userId<span class="token operator" style="color:rgb(137, 221, 255)">:</span> parent<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>id <span class="token punctuation" style="color:rgb(199, 146, 234)">}),</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export const</span> getTodos <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/todos'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  searchParams<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{} </span><span class="token keyword" style="font-style:italic">as </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> userId<span class="token operator" style="color:rgb(137, 221, 255)">?: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">:</span> userTodos<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">User </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">static</span> schema <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    todos<span class="token operator" style="color:rgb(137, 221, 255)">:</span> userTodos<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="upgrade-support">Soporte para la actualización<a href="https://dataclient.io/es/blog/2026/05/01/v0.18-scalar-typed-downloads#upgrade-support" class="hash-link" aria-label="Enlace directo al Soporte para la actualización" title="Enlace directo al Soporte para la actualización" translate="no">​</a></h3>
<p>Como siempre, si tienes algún problema o pregunta, no dudes en unirte a nuestro <a href="https://discord.gg/wXGV27xm6t" target="_blank" rel="noopener noreferrer" class=""><img decoding="async" loading="lazy" src="https://img.shields.io/discord/768254430381735967.svg?style=flat-square&amp;colorB=758ED3" alt="Chat" class="img_SS3x"></a> o <a href="https://github.com/reactive/data-client/issues/new/choose" target="_blank" rel="noopener noreferrer" class="">reportar un error</a></p>]]></content>
        <author>
            <name>Nathaniel Tucker</name>
            <uri>https://github.com/ntucker</uri>
        </author>
        <category label="Versiones" term="Versiones"/>
        <category label="REST" term="REST"/>
        <category label="Schemas" term="Schemas"/>
        <category label="Endpoint" term="Endpoint"/>
        <category label="Collections" term="Collections"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[v0.16: Obtención en paralelo, Collection.move, Lazy]]></title>
        <id>https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy</id>
        <link href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy"/>
        <updated>2026-04-01T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Carga de datos en paralelo con useFetch(), Collection.move para reordenar entre listas y Lazy para la desnormalización diferida de relaciones]]></summary>
        <content type="html"><![CDATA[<p><strong>Nuevas funcionalidades:</strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#parallel-data-loading" target="_self" class="">Carga de datos en paralelo con useFetch()</a>: obtén varios endpoints de forma concurrente con <code>use(useFetch())</code>, evitando cascadas secuenciales</li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#collection-move" target="_self" class="">Collection.move</a>: mueve entidades entre <a class="" href="https://dataclient.io/es/rest/api/Collection">Collections</a> con una sola operación</li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#collection-move" target="_self" class="">Collection.moveWith()</a>: personaliza el comportamiento del movimiento (p. ej., insertar al inicio en lugar de al final)</li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#lazy" target="_self" class="">Lazy</a>: desnormalización diferida de relaciones para mejorar el rendimiento y aislar la memoización</li>
</ul>
<p><strong>Otras mejoras:</strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#direct-schema-imports" target="_self" class="">Importaciones directas de schemas</a>: importa las clases de schema directamente sin el espacio de nombres <code>schema</code></li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#denormalization-depth-limit" target="_self" class="">Límite de profundidad de desnormalización</a>: evita el desborde de la pila en grafos de entidades bidireccionales grandes; configurable mediante <a class="" href="https://dataclient.io/es/rest/api/Entity#maxEntityDepth"><code>Entity.maxEntityDepth</code></a> (<a href="https://github.com/reactive/data-client/issues/3822" target="_blank" rel="noopener noreferrer" class="">#3822</a>)</li>
<li class=""><a class="" href="https://dataclient.io/es/docs/api/DevToolsManager#controllers">DevToolsManager</a> expone <code>globalThis.__DC_CONTROLLERS__</code> en modo de desarrollo para acceder al store de forma programática desde <a href="https://developer.chrome.com/blog/chrome-devtools-mcp" target="_blank" rel="noopener noreferrer" class="">Chrome DevTools MCP</a> y <a href="https://docs.expo.dev/eas/ai/mcp/" target="_blank" rel="noopener noreferrer" class="">Expo MCP</a>. Usa el <a href="https://skills.sh/reactive/data-client/data-client-react" target="_blank" rel="noopener noreferrer" class="">skill data-client-react</a> para habilitar la depuración asistida por IA.</li>
<li class="">Se elimina la advertencia engañosa 'Uncaught Suspense' durante el SSR de Next.js</li>
<li class="">Se corrige la pérdida del tipo <code>sideEffect: false</code> al usar <code>method: 'POST'</code> en <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint">RestEndpoint</a></li>
<li class=""><a class="" href="https://dataclient.io/es/docs/api/renderDataHook">renderDataHook()</a> limpia automáticamente después de cada prueba: ya no hacen falta llamadas manuales a <code>cleanup()</code></li>
<li class=""><a class="" href="https://dataclient.io/es/docs/api/renderDataHook">renderDataHook()</a> devuelve <code>cleanup()</code> y <code>allSettled()</code> por cada renderizado para un desmontaje confiable de las pruebas</li>
</ul>
<p><a class="" href="https://dataclient.io/es/rest/api/Collection#move">Collection.move</a> facilita mover entidades entre <a class="" href="https://dataclient.io/es/rest/api/Collection">Collections</a> con una sola operación:</p>
<div data-playground="true" class="playgroundQueryContainer_vBqa"><div class="playgroundContainer_sLUA row_YGZs" data-store-host="true"><div class="playgroundTextEdit_rt2K"><div class="playgroundHeader_Zx4K noupper_WDCF tabControls_trxh"><div class="tabs_m54V" role="tablist" aria-orientation="horizontal" aria-label="Archivos"><div role="tab" aria-selected="false" tabindex="-1" class="tab_bTGw">TaskResource</div><div role="tab" aria-selected="true" tabindex="0" class="tab_bTGw selected_QXZk">TaskCard</div><div role="tab" aria-selected="false" tabindex="-1" class="tab_bTGw">TaskBoard</div></div></div><div class="editorDocs_INVk"><div class="playgroundEditor_lYwu hidden_Hh8i"></div><div class="playgroundEditor_lYwu"><div><pre class="prism-code language-tsx" style="margin:0;outline:none;padding:10px;font-family:inherit;color:#bfc7d5;background-color:transparent" spellcheck="false"><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token punctuation" style="color:#c792ea">{ </span>useController <span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'@data-client/react'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token punctuation" style="color:#c792ea">{ </span><span class="token class-name" style="color:#ffcb6b">TaskResource</span><span class="token punctuation" style="color:#c792ea">, </span><span class="token keyword" style="color:#7da4f6;font-style:italic">type </span><span class="token class-name" style="color:#ffcb6b">Task </span><span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'./TaskResource'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">
</span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">export default function </span><span class="token class-name" style="color:#ffcb6b">TaskCard</span><span class="token punctuation" style="color:#c792ea">({ </span>task <span class="token punctuation" style="color:#c792ea">}: { </span>task<span class="token punctuation" style="color:#c792ea">: </span><span class="token class-name" style="color:#ffcb6b">Task </span><span class="token punctuation" style="color:#c792ea">}) {
</span></span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">const </span>handleMove <span class="token punctuation" style="color:#c792ea">= () =&gt; </span>ctrl<span class="token punctuation" style="color:#c792ea">.</span>fetch<span class="token punctuation" style="color:#c792ea">(
</span></span><span class="token-line">    <span class="token class-name" style="color:#ffcb6b">TaskResource</span><span class="token punctuation" style="color:#c792ea">.</span>getList<span class="token punctuation" style="color:#c792ea">.</span>move<span class="token punctuation" style="color:#c792ea">,
</span></span><span class="token-line">    <span class="token punctuation" style="color:#c792ea">{ </span>id<span class="token punctuation" style="color:#c792ea">: </span>task<span class="token punctuation" style="color:#c792ea">.</span>id <span class="token punctuation" style="color:#c792ea">},
</span></span><span class="token-line">    <span class="token punctuation" style="color:#c792ea">{ </span>id<span class="token punctuation" style="color:#c792ea">: </span>task<span class="token punctuation" style="color:#c792ea">.</span>id<span class="token punctuation" style="color:#c792ea">, </span>status<span class="token punctuation" style="color:#c792ea">: </span>task<span class="token punctuation" style="color:#c792ea">.</span>status <span class="token punctuation" style="color:#c792ea">=== </span><span class="token string" style="color:#b6d986">'backlog' </span><span class="token punctuation" style="color:#c792ea">? </span><span class="token string" style="color:#b6d986">'in-progress' </span><span class="token punctuation" style="color:#c792ea">: </span><span class="token string" style="color:#b6d986">'backlog' </span><span class="token punctuation" style="color:#c792ea">},
</span></span><span class="token-line">  <span class="token punctuation" style="color:#c792ea">);
</span></span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">const </span>ctrl <span class="token punctuation" style="color:#c792ea">= </span>useController<span class="token punctuation" style="color:#c792ea">();
</span></span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">return </span><span class="token punctuation" style="color:#c792ea">(
</span></span><span class="token-line">    <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token tag" style="color:#ff5590">div </span><span class="token attr-name" style="color:#ffcb6b">className</span><span class="token punctuation" style="color:#c792ea">=</span><span class="token string" style="color:#b6d986">"listItem"</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">      <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token tag" style="color:#ff5590">span </span><span class="token attr-name" style="color:#ffcb6b">style</span><span class="token punctuation" style="color:#c792ea">={{ </span>flex<span class="token punctuation" style="color:#c792ea">: </span><span class="token number" style="color:#f78c6c">1 </span><span class="token punctuation" style="color:#c792ea">}}&gt;{</span>task<span class="token punctuation" style="color:#c792ea">.</span>title<span class="token punctuation" style="color:#c792ea">}&lt;/</span><span class="token tag" style="color:#ff5590">span</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">      <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token tag" style="color:#ff5590">button </span><span class="token attr-name" style="color:#ffcb6b">onClick</span><span class="token punctuation" style="color:#c792ea">={</span>handleMove<span class="token punctuation" style="color:#c792ea">}&gt;
</span></span><span class="token-line">        <span class="token punctuation" style="color:#c792ea">{</span>task<span class="token punctuation" style="color:#c792ea">.</span>status <span class="token punctuation" style="color:#c792ea">=== </span><span class="token string" style="color:#b6d986">'backlog' </span><span class="token punctuation" style="color:#c792ea">? </span><span class="token string" style="color:#b6d986">'\u25bc' </span><span class="token punctuation" style="color:#c792ea">: </span><span class="token string" style="color:#b6d986">'\u25b2'</span><span class="token punctuation" style="color:#c792ea">}
</span></span><span class="token-line">      <span class="token punctuation" style="color:#c792ea">&lt;/</span><span class="token tag" style="color:#ff5590">button</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">    <span class="token punctuation" style="color:#c792ea">&lt;/</span><span class="token tag" style="color:#ff5590">div</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">  <span class="token punctuation" style="color:#c792ea">);
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">}
</span></span></pre></div></div><div class="playgroundEditor_lYwu hidden_Hh8i"></div></div></div><div class="previewWrapper_edd2 wide-embed-part"><div class="playgroundHeader_Zx4K previewHeader_MW_M"><span class="liveLabel_MHnJ"><span class="liveLabelText_k6qc">Vista previa en vivo</span></span><span class="routerSlot_CTii"></span><span class="previewControls_oxCt"><button type="button" class="clean-btn headerButton_h2KM fixturesToggle_OTR0" title="Fixtures" aria-label="Fixtures" aria-expanded="false" aria-controls="_R_3c5qllq9_"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 20V4"></path><path d="m3 8 4-4 4 4"></path><path d="M17 4v16"></path><path d="m21 16-4 4-4-4"></path></svg></button><button type="button" class="clean-btn headerButton_h2KM resetButton_knTA" title="Reiniciar la vista previa" aria-label="Reiniciar la vista previa" disabled=""><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 12a9 9 0 1 0 2.64-6.36L3 8.3"></path><path d="M3 3v5.3h5.3"></path></svg></button></span></div><div class="fixturesAnchor_fieO"><div id="_R_3c5qllq9_" class="fixturesPopover_bQwj wide-embed-part"></div></div><div class="playgroundResult_tefG"><div class="playground-preview playgroundPreview_rk9R"><div class="sheet_FVCk sheet" aria-busy="true"><div class="skeletonPage" role="status" aria-label="Loading"><span class="skeleton"></span><span class="skeleton"></span><span class="skeleton"></span><span class="skeleton"></span></div></div></div><div class="quickLookHost_EhLO stageHues_MizR"></div></div></div><div id="_R_5qllq9_" class="storeHost_N0SU"><div class="storeDrawer_Jaf2"><div class="drawerTabs_MT7c" role="tablist" aria-orientation="vertical"><button type="button" role="tab" class="clean-btn storeTab_EY4O" title="Mostrar acciones" aria-label="Acciones" aria-selected="false" tabindex="-1" aria-controls="_R_5qllq9_" data-store-toggle="actions"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13 12h8M13 18h8M13 6h8M3 12h1M3 18h1M3 6h1M8 12h1M8 18h1M8 6h1"></path></svg></button><button type="button" role="tab" class="clean-btn storeTab_EY4O" title="Mostrar el store" aria-label="Store" aria-selected="false" tabindex="0" aria-controls="_R_5qllq9_" data-store-toggle="store"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><ellipse cx="12" cy="5" rx="8" ry="3"></ellipse><path d="M4 5v14c0 1.66 3.58 3 8 3s8-1.34 8-3V5"></path><path d="M4 12c0 1.66 3.58 3 8 3s8-1.34 8-3"></path></svg></button></div></div></div></div></div>
<p><strong><a href="https://0.18.dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#migration-guide" target="_self" class="">Cambios incompatibles:</a></strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#path-to-regexp-v8" target="_self" class="">path-to-regexp v8</a>: la sintaxis de <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#path">RestEndpoint.path</a> se actualizó: <code>/:optional?</code> → <code>{/:optional}</code>, <code>/:repeat+</code> → <code>/*repeat</code> (tipado como <code>string[]</code>)</li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#usefetch-returns-usablepromise" target="_self" class="">useFetch() devuelve UsablePromise</a>: devuelve un thenable para <code>React.use()</code>; comprueba <code>.resolved</code> en lugar de su veracidad</li>
</ul>
<p>Actualiza con un <a href="https://dataclient.io/es/assets/files/v0.16-62bb6d4126ec50f0bac24e3be101bd26.js" target="_blank" class="">codemod</a> automatizado para todos los cambios incompatibles:</p>
<div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc">npx jscodeshift <span class="token parameter variable" style="color:rgb(191, 199, 213)">-t</span> https://dataclient.io/codemods/v0.16.js <span class="token parameter variable" style="color:rgb(191, 199, 213)">--extensions</span><span class="token operator" style="color:rgb(137, 221, 255)">=</span>ts,tsx,js,jsx src/<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div>
<!-- -->
<!-- -->
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="collection-move">Collection.move<a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#collection-move" class="hash-link" aria-label="Enlace directo al Collection.move" title="Enlace directo al Collection.move" translate="no">​</a></h2>
<p><a class="" href="https://dataclient.io/es/rest/api/Collection#move">Collection.move</a> y <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#move">RestEndpoint.move</a> facilitan mover entidades entre collections con una sola solicitud PATCH. La entidad se elimina automáticamente de las collections que coinciden con su estado anterior y se agrega a las collections que coinciden con los nuevos valores del cuerpo de la solicitud.</p>
<p>Esto es útil para tableros kanban, reasignación de grupos, cambios de estado o cualquier flujo de trabajo en el que un elemento se mueva entre listas filtradas.</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> TaskResource <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">resource</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/tasks/:id'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  searchParams<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{} </span><span class="token keyword" style="font-style:italic">as </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> status<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Task<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// PATCH /tasks/3 - moves task from 'backlog' to 'in-progress'</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">await</span> ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  TaskResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>getList<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>move<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'3' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line theme-code-block-highlighted-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'3'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> status<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'in-progress' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div>
<p>Funciona tanto con parámetros de ruta como con parámetros de búsqueda, y admite collections de tipo Array y Values.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="collectionmovewith">Collection.moveWith()<a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#collectionmovewith" class="hash-link" aria-label="Enlace directo al Collection.moveWith()" title="Enlace directo al Collection.moveWith()" translate="no">​</a></h3>
<p><a class="" href="https://dataclient.io/es/rest/api/Collection#moveWith">Collection.moveWith()</a> construye un schema de movimiento personalizado, análogo a <a class="" href="https://dataclient.io/es/rest/api/Collection#addWith">addWith()</a>. La función <code>merge</code> controla cómo se agregan las entidades a su collection de destino (p. ej., insertando al inicio en lugar de al final), mientras que el comportamiento de eliminación se deriva automáticamente. Por comodidad se incluye la función de merge <a class="" href="https://dataclient.io/es/rest/api/Collection#unshift-merge"><code>unshift</code></a>.</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> Collection<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> unshift <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyCollection </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Collection </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">constructor</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> options<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">super</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> options<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line theme-code-block-highlighted-line">    <span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>move <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">moveWith</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>unshift<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="parallel-data-loading">Carga de datos en paralelo<a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#parallel-data-loading" class="hash-link" aria-label="Enlace directo al Carga de datos en paralelo" title="Enlace directo al Carga de datos en paralelo" translate="no">​</a></h2>
<p><a class="" href="https://dataclient.io/es/docs/api/useFetch">useFetch()</a> ahora devuelve un thenable <a href="https://react.dev/reference/react/use" target="_blank" rel="noopener noreferrer" class="">UsablePromise</a>,
lo que convierte a <code>use(useFetch(endpoint, args))</code> en un equivalente directo de <a class="" href="https://dataclient.io/es/docs/api/useSuspense">useSuspense()</a>:
suspende mientras se cargan los datos, devuelve los datos desnormalizados cuando están en caché, lanza en caso de error
y vuelve a suspender tras una <a class="" href="https://dataclient.io/es/docs/api/Controller#invalidate">invalidación</a>.</p>
<p>Como <code>useFetch()</code> y <code>use()</code> son llamadas separadas, varias obtenciones se inician en paralelo.
Todas las llamadas a <code>useFetch()</code> se ejecutan antes de que cualquier <code>use()</code> suspenda, así que cada obtención ya está en curso
incluso si el primer <code>use()</code> suspende el componente.
Esto evita la cascada secuencial que ocurre con varias llamadas a <code>useSuspense()</code>,
donde la segunda obtención no puede comenzar hasta que se resuelve la primera.
<a href="https://github.com/reactive/data-client/pull/3755" target="_blank" rel="noopener noreferrer" class="">#3755</a></p>
<div data-playground="true" class="playgroundQueryContainer_vBqa"><div class="playgroundContainer_sLUA row_YGZs" data-store-host="true"><div class="playgroundTextEdit_rt2K"><div class="playgroundHeader_Zx4K noupper_WDCF tabControls_trxh"><div class="tabs_m54V" role="tablist" aria-orientation="horizontal" aria-label="Archivos"><div role="tab" aria-selected="false" tabindex="-1" class="tab_bTGw">Resources</div><div role="tab" aria-selected="true" tabindex="0" class="tab_bTGw selected_QXZk">PostWithComments</div></div></div><div class="editorDocs_INVk"><div class="playgroundEditor_lYwu hidden_Hh8i"></div><div class="playgroundEditor_lYwu"><div><pre class="prism-code language-tsx" style="margin:0;outline:none;padding:10px;font-family:inherit;color:#bfc7d5;background-color:transparent" spellcheck="false"><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token punctuation" style="color:#c792ea">{ </span>use <span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'react'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token punctuation" style="color:#c792ea">{ </span>useFetch <span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'@data-client/react'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token punctuation" style="color:#c792ea">{ </span><span class="token class-name" style="color:#ffcb6b">PostResource</span><span class="token punctuation" style="color:#c792ea">, </span><span class="token class-name" style="color:#ffcb6b">CommentResource </span><span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'./Resources'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">
</span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">function </span><span class="token class-name" style="color:#ffcb6b">PostWithComments</span><span class="token punctuation" style="color:#c792ea">({ </span>id <span class="token punctuation" style="color:#c792ea">}: { </span>id<span class="token punctuation" style="color:#c792ea">: </span><span class="token keyword" style="color:#7da4f6;font-style:italic">number </span><span class="token punctuation" style="color:#c792ea">}) {
</span></span><span class="token-line">  <span class="token comment" style="color:#697098;font-style:italic">// Both fetches start in parallel
</span></span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">const </span>postPromise <span class="token punctuation" style="color:#c792ea">= </span>useFetch<span class="token punctuation" style="color:#c792ea">(</span><span class="token class-name" style="color:#ffcb6b">PostResource</span><span class="token punctuation" style="color:#c792ea">.</span><span class="token keyword" style="color:#7da4f6;font-style:italic">get</span><span class="token punctuation" style="color:#c792ea">, { </span>id <span class="token punctuation" style="color:#c792ea">});
</span></span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">const </span>commentsPromise <span class="token punctuation" style="color:#c792ea">= </span>useFetch<span class="token punctuation" style="color:#c792ea">(</span><span class="token class-name" style="color:#ffcb6b">CommentResource</span><span class="token punctuation" style="color:#c792ea">.</span>getList<span class="token punctuation" style="color:#c792ea">, { </span>postId<span class="token punctuation" style="color:#c792ea">: </span>id <span class="token punctuation" style="color:#c792ea">});
</span></span><span class="token-line">
</span><span class="token-line">  <span class="token comment" style="color:#697098;font-style:italic">// use() reads the results — if the first suspends,
</span></span><span class="token-line">  <span class="token comment" style="color:#697098;font-style:italic">// the second fetch is already in-flight
</span></span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">const </span>post <span class="token punctuation" style="color:#c792ea">= </span>use<span class="token punctuation" style="color:#c792ea">(</span>postPromise<span class="token punctuation" style="color:#c792ea">);
</span></span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">const </span>comments <span class="token punctuation" style="color:#c792ea">= </span>use<span class="token punctuation" style="color:#c792ea">(</span>commentsPromise<span class="token punctuation" style="color:#c792ea">);
</span></span><span class="token-line">
</span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">return </span><span class="token punctuation" style="color:#c792ea">(
</span></span><span class="token-line">    <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token tag" style="color:#ff5590">article</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">      <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token tag" style="color:#ff5590">h3</span><span class="token punctuation" style="color:#c792ea">&gt;{</span>post<span class="token punctuation" style="color:#c792ea">.</span>title<span class="token punctuation" style="color:#c792ea">}&lt;/</span><span class="token tag" style="color:#ff5590">h3</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">      <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token tag" style="color:#ff5590">p</span><span class="token punctuation" style="color:#c792ea">&gt;{</span>post<span class="token punctuation" style="color:#c792ea">.</span>body<span class="token punctuation" style="color:#c792ea">}&lt;/</span><span class="token tag" style="color:#ff5590">p</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">      <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token tag" style="color:#ff5590">h4</span><span class="token punctuation" style="color:#c792ea">&gt;</span>Comments<span class="token punctuation" style="color:#c792ea">&lt;/</span><span class="token tag" style="color:#ff5590">h4</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">      <span class="token punctuation" style="color:#c792ea">{</span>comments<span class="token punctuation" style="color:#c792ea">.</span>map<span class="token punctuation" style="color:#c792ea">(</span>comment <span class="token punctuation" style="color:#c792ea">=&gt; (
</span></span><span class="token-line">        <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token tag" style="color:#ff5590">div </span><span class="token attr-name" style="color:#ffcb6b">key</span><span class="token punctuation" style="color:#c792ea">={</span>comment<span class="token punctuation" style="color:#c792ea">.</span>id<span class="token punctuation" style="color:#c792ea">} </span><span class="token attr-name" style="color:#ffcb6b">className</span><span class="token punctuation" style="color:#c792ea">=</span><span class="token string" style="color:#b6d986">"listItem"</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">          <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token tag" style="color:#ff5590">strong</span><span class="token punctuation" style="color:#c792ea">&gt;{</span>comment<span class="token punctuation" style="color:#c792ea">.</span>author<span class="token punctuation" style="color:#c792ea">}&lt;/</span><span class="token tag" style="color:#ff5590">strong</span>&gt;: <span class="token punctuation" style="color:#c792ea">{</span>comment<span class="token punctuation" style="color:#c792ea">.</span>text<span class="token punctuation" style="color:#c792ea">}
</span></span><span class="token-line">        <span class="token punctuation" style="color:#c792ea">&lt;/</span><span class="token tag" style="color:#ff5590">div</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">      <span class="token punctuation" style="color:#c792ea">))}
</span></span><span class="token-line">    <span class="token punctuation" style="color:#c792ea">&lt;/</span><span class="token tag" style="color:#ff5590">article</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">  <span class="token punctuation" style="color:#c792ea">);
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">}
</span></span><span class="token-line">render<span class="token punctuation" style="color:#c792ea">(&lt;</span><span class="token class-name" style="color:#ffcb6b">PostWithComments id</span><span class="token punctuation" style="color:#c792ea">={</span><span class="token number" style="color:#f78c6c">1</span><span class="token punctuation" style="color:#c792ea">} </span>/&gt;<span class="token punctuation" style="color:#c792ea">);
</span></span></pre></div></div></div></div><div class="previewWrapper_edd2 wide-embed-part"><div class="playgroundHeader_Zx4K previewHeader_MW_M"><span class="liveLabel_MHnJ"><span class="liveLabelText_k6qc">Vista previa en vivo</span></span><span class="routerSlot_CTii"></span><span class="previewControls_oxCt"><button type="button" class="clean-btn headerButton_h2KM fixturesToggle_OTR0" title="Fixtures" aria-label="Fixtures" aria-expanded="false" aria-controls="_R_3cmqllq9_"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 20V4"></path><path d="m3 8 4-4 4 4"></path><path d="M17 4v16"></path><path d="m21 16-4 4-4-4"></path></svg></button><button type="button" class="clean-btn headerButton_h2KM resetButton_knTA" title="Reiniciar la vista previa" aria-label="Reiniciar la vista previa" disabled=""><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 12a9 9 0 1 0 2.64-6.36L3 8.3"></path><path d="M3 3v5.3h5.3"></path></svg></button></span></div><div class="fixturesAnchor_fieO"><div id="_R_3cmqllq9_" class="fixturesPopover_bQwj wide-embed-part"></div></div><div class="playgroundResult_tefG"><div class="playground-preview playgroundPreview_rk9R"><div class="sheet_FVCk sheet" aria-busy="true"><div class="skeletonPage" role="status" aria-label="Loading"><span class="skeleton"></span><span class="skeleton"></span><span class="skeleton"></span><span class="skeleton"></span></div></div></div><div class="quickLookHost_EhLO stageHues_MizR"></div></div></div><div id="_R_mqllq9_" class="storeHost_N0SU"><div class="storeDrawer_Jaf2"><div class="drawerTabs_MT7c" role="tablist" aria-orientation="vertical"><button type="button" role="tab" class="clean-btn storeTab_EY4O" title="Mostrar acciones" aria-label="Acciones" aria-selected="false" tabindex="-1" aria-controls="_R_mqllq9_" data-store-toggle="actions"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13 12h8M13 18h8M13 6h8M3 12h1M3 18h1M3 6h1M8 12h1M8 18h1M8 6h1"></path></svg></button><button type="button" role="tab" class="clean-btn storeTab_EY4O" title="Mostrar el store" aria-label="Store" aria-selected="false" tabindex="0" aria-controls="_R_mqllq9_" data-store-toggle="store"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><ellipse cx="12" cy="5" rx="8" ry="3"></ellipse><path d="M4 5v14c0 1.66 3.58 3 8 3s8-1.34 8-3V5"></path><path d="M4 12c0 1.66 3.58 3 8 3s8-1.34 8-3"></path></svg></button></div></div></div></div></div>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="denormalization-depth-limit--lazy">Límite de profundidad de desnormalización y Lazy<a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#denormalization-depth-limit--lazy" class="hash-link" aria-label="Enlace directo al Límite de profundidad de desnormalización y Lazy" title="Enlace directo al Límite de profundidad de desnormalización y Lazy" translate="no">​</a></h2>
<p>Cuando los schemas tienen relaciones bidireccionales entre tipos de entidad
(p. ej., <code>Department → Building → Department → ...</code>), la desnormalización recorre cada
entidad única del grafo conectado. Con conjuntos de datos pequeños esto pasa desapercibido, pero a gran escala (miles
de entidades interconectadas) la recursión excede la pila de llamadas de JS y lanza
<code>RangeError: Maximum call stack size exceeded</code>.
<a href="https://github.com/reactive/data-client/issues/3822" target="_blank" rel="noopener noreferrer" class="">#3822</a></p>
<p>Dos funcionalidades complementarias abordan este problema: un <strong>límite de profundidad</strong> como red de seguridad, y
<a class="" href="https://dataclient.io/es/rest/api/Lazy"><strong>Lazy</strong></a> para un control preciso, campo por campo, de qué relaciones se resuelven de forma anticipada.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="denormalization-depth-limit">Límite de profundidad de desnormalización<a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#denormalization-depth-limit" class="hash-link" aria-label="Enlace directo al Límite de profundidad de desnormalización" title="Enlace directo al Límite de profundidad de desnormalización" translate="no">​</a></h3>
<p>La desnormalización ahora aplica un límite de profundidad predeterminado de 64 saltos entre entidades. Las entidades más allá
del límite se devuelven con sus ids sin resolver en lugar de objetos completamente desnormalizados.
Se emite un <code>console.error</code> en modo de desarrollo cuando se alcanza el límite.</p>
<p>El límite puede configurarse por Entity con <a class="" href="https://dataclient.io/es/rest/api/Entity#maxEntityDepth"><code>static maxEntityDepth</code></a>:</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">Department </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">static</span> maxEntityDepth <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token number" style="color:rgb(247, 140, 108)">16</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div>
<p>Esto evita los fallos, pero es una herramienta poco precisa: corta <em>todas</em> las rutas profundas,
incluidas las legítimas que no son cíclicas. Para un control más fino, usa <a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#lazy" class="">Lazy</a>.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="lazy">Lazy<a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#lazy" class="hash-link" aria-label="Enlace directo al Lazy" title="Enlace directo al Lazy" translate="no">​</a></h3>
<p><a class="" href="https://dataclient.io/es/rest/api/Lazy">Lazy</a> envuelve un schema para omitir la desnormalización anticipada de campos de relación específicos.
Durante la desnormalización de la entidad padre, el campo conserva su valor normalizado sin procesar (las claves primarias).
La relación puede resolverse después bajo demanda mediante <a class="" href="https://dataclient.io/es/docs/api/useQuery">useQuery</a> usando el accesor <code>.query</code>.</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> Entity<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> Lazy <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">Department </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  id <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  name <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  buildings<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[] </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[];</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">static</span> schema <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line theme-code-block-highlighted-line">    buildings<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">Lazy</span><span class="token punctuation" style="color:rgb(199, 146, 234)">([</span>Building<span class="token punctuation" style="color:rgb(199, 146, 234)">]),</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div>
<p>A diferencia del límite de profundidad, <code>Lazy</code> es una opción selectiva por relación. Solo los
campos que marques como lazy omiten la resolución anticipada; el resto del schema se desnormaliza con normalidad.
Esto también mejora el rendimiento al diferir el trabajo de las relaciones que no siempre se
necesitan, y proporciona <strong>aislamiento de la memoización</strong>: los cambios en las entidades lazy no invalidan
la forma desnormalizada del padre.</p>
<p>Consulta la <a class="" href="https://dataclient.io/es/rest/api/Lazy">documentación de Lazy</a> para ver todos los detalles de uso y
<a href="https://github.com/reactive/data-client/discussions/3828" target="_blank" rel="noopener noreferrer" class="">#3828</a> para la discusión de diseño.</p>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="migration-guide">Guía de migración<a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#migration-guide" class="hash-link" aria-label="Enlace directo al Guía de migración" title="Enlace directo al Guía de migración" translate="no">​</a></h2>
<p>Esta actualización requiere actualizar todas las versiones de los paquetes al mismo tiempo.</p>
<div class="theme-tabs-container tabs-container tabList_J5MA"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_l0OV tabs__item--active">NPM</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">Yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">esm.sh</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_wHwb"><div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc"><span class="token function" style="color:rgb(130, 170, 255)">npm install </span><span class="token parameter variable" style="color:rgb(191, 199, 213)">--save</span> @data-client/react@^0.16.0 @data-client/rest@^0.16.0 @data-client/endpoint@^0.16.0 @data-client/core@^0.16.0 @data-client/vue@^0.16.0 @data-client/test@^0.16.0 @data-client/img@^0.16.0<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">yarn add @data-client/react@^0.16.0 @data-client/rest@^0.16.0 @data-client/endpoint@^0.16.0 @data-client/core@^0.16.0 @data-client/vue@^0.16.0 @data-client/test@^0.16.0 @data-client/img@^0.16.0<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">pnpm add @data-client/react@^0.16.0 @data-client/rest@^0.16.0 @data-client/endpoint@^0.16.0 @data-client/core@^0.16.0 @data-client/vue@^0.16.0 @data-client/test@^0.16.0 @data-client/img@^0.16.0<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-html language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">&lt;script type="importmap"&gt;<br></div><div class="token-line">{<br></div><div class="token-line">  "imports": {<br></div><div class="token-line">    "@data-client/react": "https://esm.sh/@data-client/react@^0.16.0",<br></div><div class="token-line">    "@data-client/rest": "https://esm.sh/@data-client/rest@^0.16.0",<br></div><div class="token-line">    "@data-client/endpoint": "https://esm.sh/@data-client/endpoint@^0.16.0",<br></div><div class="token-line">    "@data-client/core": "https://esm.sh/@data-client/core@^0.16.0",<br></div><div class="token-line">    "@data-client/vue": "https://esm.sh/@data-client/vue@^0.16.0",<br></div><div class="token-line">    "@data-client/test": "https://esm.sh/@data-client/test@^0.16.0",<br></div><div class="token-line">    "@data-client/img": "https://esm.sh/@data-client/img@^0.16.0"<br></div><div class="token-line">  }<br></div><div class="token-line">}<br></div><div class="token-line">&lt;/script&gt;<br></div></code></pre></div></div></div></div></div>
<p>Un <a href="https://dataclient.io/es/assets/files/v0.16-62bb6d4126ec50f0bac24e3be101bd26.js" target="_blank" class="">codemod</a> automatizado se encarga de los tres cambios incompatibles que se describen a continuación: la sintaxis de rutas, la veracidad de <code>useFetch()</code> y las importaciones del espacio de nombres <code>schema</code>:</p>
<div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc">npx jscodeshift <span class="token parameter variable" style="color:rgb(191, 199, 213)">-t</span> https://dataclient.io/codemods/v0.16.js <span class="token parameter variable" style="color:rgb(191, 199, 213)">--extensions</span><span class="token operator" style="color:rgb(137, 221, 255)">=</span>ts,tsx,js,jsx src/<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="path-to-regexp-v8">path-to-regexp v8<a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#path-to-regexp-v8" class="hash-link" aria-label="Enlace directo al path-to-regexp v8" title="Enlace directo al path-to-regexp v8" translate="no">​</a></h2>
<p><a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#path">RestEndpoint.path</a> ahora usa <a href="https://github.com/pillarjs/path-to-regexp/releases/tag/v8.0.0" target="_blank" rel="noopener noreferrer" class="">path-to-regexp v8</a>,
que cambia la sintaxis de los parámetros opcionales, los parámetros repetidos y los caracteres especiales.</p>
<div class="table-scroll"><table><thead><tr><th>Sintaxis v6</th><th>Sintaxis v8</th><th>Descripción</th></tr></thead><tbody><tr><td><code>/:optional?</code></td><td><code>{/:optional}</code></td><td>Parámetro opcional</td></tr><tr><td><code>/:repeat+</code></td><td><code>/*repeat</code></td><td>Repetición de uno o más (tipado como <code>string[]</code>)</td></tr><tr><td><code>/:repeat*</code></td><td><code>{/*repeat}</code></td><td>Repetición de cero o más (tipado como <code>string[]</code>)</td></tr><tr><td><code>/:with-dash</code></td><td><code>/:"with-dash"</code></td><td>Nombre de parámetro entre comillas</td></tr><tr><td><code>/:id(\d+)</code></td><td><code>/:id</code></td><td>Se eliminan las expresiones regulares personalizadas</td></tr></tbody></table></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="optional-parameters">Parámetros opcionales<a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#optional-parameters" class="hash-link" aria-label="Enlace directo al Parámetros opcionales" title="Enlace directo al Parámetros opcionales" translate="no">​</a></h3>
<p>Se elimina el sufijo <code>?</code>. Envuelve el segmento opcional (incluido su prefijo) en <code>{}</code>.</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> ep <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/:group/things/:number?'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> ep <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/:group/things{/:number}'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div></div></div></div></figure>
<p>Varios segmentos opcionales con prefijos distintos:</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> ep <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/:attr1?{-:attr2}?{-:attr3}?'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> ep <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'{/:attr1}{-:attr2}{-:attr3}'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="repeating-parameters">Parámetros repetidos<a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#repeating-parameters" class="hash-link" aria-label="Enlace directo al Parámetros repetidos" title="Enlace directo al Parámetros repetidos" translate="no">​</a></h3>
<p>Se eliminan los sufijos <code>+</code> (uno o más) y <code>*</code> (cero o más). Usa la sintaxis de comodín <code>*name</code>, envuelta en <code>{}</code> para cero o más.</p>
<p>Los parámetros comodín ahora se tipan como <code>string[]</code> (arreglos) en lugar de <code>string | number</code>, ya que representan varios segmentos de la ruta.</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> ep <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/files/:path+'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">ep</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'docs/reports/q4' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> optEp <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/files/:path*'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> ep <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/files/*path'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">ep</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">'docs'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token string" style="color:rgb(195, 232, 141)">'reports'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token string" style="color:rgb(195, 232, 141)">'q4'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">] });</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> optEp <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/files{/*path}'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="quoted-parameter-names">Nombres de parámetros entre comillas<a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#quoted-parameter-names" class="hash-link" aria-label="Enlace directo al Nombres de parámetros entre comillas" title="Enlace directo al Nombres de parámetros entre comillas" translate="no">​</a></h3>
<p>Los nombres de parámetros con caracteres especiales (guiones, puntos) ahora deben ir entre comillas dobles:</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> ep <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/:with-dash'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> ep <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/:"with-dash"'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="custom-regex-removed">Se eliminan las expresiones regulares personalizadas<a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#custom-regex-removed" class="hash-link" aria-label="Enlace directo al Se eliminan las expresiones regulares personalizadas" title="Enlace directo al Se eliminan las expresiones regulares personalizadas" translate="no">​</a></h3>
<p>Los patrones de expresiones regulares inline como <code>/:id(\d+)</code> ya no se admiten. Elimina la expresión regular y valida en el servidor en su lugar.</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> ep <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/users/:id(\\d+)'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> ep <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/users/:id'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="escaping-special-characters">Escapar caracteres especiales<a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#escaping-special-characters" class="hash-link" aria-label="Enlace directo al Escapar caracteres especiales" title="Enlace directo al Escapar caracteres especiales" translate="no">​</a></h3>
<p>Los caracteres como <code>{}()[]+?!:*\\</code> deben escaparse con <code>\\</code> cuando se usan como <strong>literales</strong> en el patrón de la ruta.
Estos caracteres están <a href="https://github.com/pillarjs/path-to-regexp#express--4x" target="_blank" rel="noopener noreferrer" class="">reservados por path-to-regexp</a> y
usarlos sin escapar lanza un <a href="https://github.com/pillarjs/path-to-regexp#unexpected--or-" target="_blank" rel="noopener noreferrer" class="">error Unexpected token</a>.
Una cadena de consulta literal en el patrón sigue necesitando un <code>?</code> escapado, p. ej. <code>'/resource\\?per_page=50'</code>.</p>
<p>Cuando los segmentos de consulta usan <strong>parámetros con nombre</strong>, prefiere grupos explícitos en lugar de un único <code>?</code> escapado:</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> ep <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/search\\?q=:q'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> ep <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/search?{q=:q}{&amp;page=:page}'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="finding-paths-to-migrate">Encontrar las rutas que hay que migrar<a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#finding-paths-to-migrate" class="hash-link" aria-label="Enlace directo al Encontrar las rutas que hay que migrar" title="Enlace directo al Encontrar las rutas que hay que migrar" translate="no">​</a></h3>
<p>Busca en tu base de código estos patrones en los valores de <code>path:</code>:</p>
<ul>
<li class=""><strong><code>?</code></strong> después de un <code>:param</code>: parámetros opcionales que hay que convertir</li>
<li class=""><strong><code>+</code></strong> o <strong><code>*</code></strong> después de un <code>:param</code>: parámetros repetidos que hay que convertir</li>
<li class=""><strong><code>(\</code></strong> después de un <code>:param</code>: expresiones regulares personalizadas que hay que eliminar</li>
<li class="">Nombres de parámetros con <strong><code>-</code></strong> o <strong><code>.</code></strong>: necesitan comillas</li>
</ul>
<p>Consulta <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#path">RestEndpoint.path</a> para la documentación completa de la sintaxis v8,
o los <a href="https://github.com/pillarjs/path-to-regexp#errors" target="_blank" rel="noopener noreferrer" class="">errores de path-to-regexp</a> para explicaciones detalladas.
También está disponible la migración asistida por IA:</p>
<div class="theme-tabs-container tabs-container tabList_J5MA"><ul role="tablist" aria-orientation="horizontal" class="tabs tabs_qwsy"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_l0OV tabs__item--active">Skills CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">OpenSkills</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_wHwb"><div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc">npx skills <span class="token function" style="color:rgb(130, 170, 255)">add</span> reactive/data-client <span class="token parameter variable" style="color:rgb(191, 199, 213)">--skill</span> path-to-regexp-v8-migration<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">npx openskills install reactive/data-client/.agents/skills/path-to-regexp-v8-migration<br></div></code></pre></div></div></div></div></div>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="usefetch-returns-usablepromise">useFetch() devuelve UsablePromise<a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#usefetch-returns-usablepromise" class="hash-link" aria-label="Enlace directo al useFetch() devuelve UsablePromise" title="Enlace directo al useFetch() devuelve UsablePromise" translate="no">​</a></h2>
<p><a class="" href="https://dataclient.io/es/docs/api/useFetch">useFetch()</a> ahora devuelve un thenable <code>UsablePromise</code> con datos desnormalizados, manejo de errores y una propiedad <code>.resolved</code>. Esto lo hace directamente compatible con <a href="https://react.dev/reference/react/use" target="_blank" rel="noopener noreferrer" class="">React.use()</a>: <code>use(useFetch(endpoint, args))</code> se comporta exactamente igual que <a class="" href="https://dataclient.io/es/docs/api/useSuspense">useSuspense()</a>.</p>
<p>Antes, <code>useFetch()</code> devolvía <code>undefined</code> cuando los datos eran válidos. El código que comprobaba si hubo una obtención mediante su veracidad ahora debe usar <code>.resolved</code>:</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> promise <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useFetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>PostResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>promise<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">  <span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// fetch was triggered</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> promise <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useFetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>PostResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">!</span>promise<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>resolved<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">  <span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// fetch is in-flight</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">use</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>promise<span class="token punctuation" style="color:rgb(199, 146, 234)">); </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// suspends or returns denormalized data</span><br></div></code></pre></div></div></div></div></div></figure>
<p>Consulta <a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#parallel-data-loading" class="">Carga de datos en paralelo</a> más arriba para ver cómo esto permite obtenciones concurrentes que evitan las cascadas secuenciales.
<a href="https://github.com/reactive/data-client/pull/3752" target="_blank" rel="noopener noreferrer" class="">#3752</a>, <a href="https://github.com/reactive/data-client/pull/3755" target="_blank" rel="noopener noreferrer" class="">#3755</a></p>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="direct-schema-imports">Importaciones directas de schemas<a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#direct-schema-imports" class="hash-link" aria-label="Enlace directo al Importaciones directas de schemas" title="Enlace directo al Importaciones directas de schemas" translate="no">​</a></h2>
<p>Las clases de schema ahora pueden importarse directamente desde <a href="https://www.npmjs.com/package/@data-client/endpoint" target="_blank" rel="noopener noreferrer" class="">@data-client/endpoint</a> (o desde <a href="https://www.npmjs.com/package/@data-client/rest" target="_blank" rel="noopener noreferrer" class="">@data-client/rest</a>, que las reexporta) en lugar de requerir el espacio de nombres <code>schema</code>. Esto ofrece una sintaxis de importación más limpia manteniendo la compatibilidad hacia atrás completa.</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> schema <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/endpoint'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> myUnion <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">schema</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">Union</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> users<span class="token operator" style="color:rgb(137, 221, 255)">:</span> User<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> groups<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Group <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  <span class="token string" style="color:rgb(195, 232, 141)">'type'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> Union <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/endpoint'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> myUnion <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">Union</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> users<span class="token operator" style="color:rgb(137, 221, 255)">:</span> User<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> groups<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Group <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  <span class="token string" style="color:rgb(195, 232, 141)">'type'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div></div></div></div></figure>
<p>Todas las clases de schema están disponibles como exportaciones directas: <a class="" href="https://dataclient.io/es/rest/api/Union">Union</a>, <a class="" href="https://dataclient.io/es/rest/api/Invalidate">Invalidate</a>, <a class="" href="https://dataclient.io/es/rest/api/Collection">Collection</a>, <a class="" href="https://dataclient.io/es/rest/api/Query">Query</a>, <a class="" href="https://dataclient.io/es/rest/api/Values">Values</a>, <a class="" href="https://dataclient.io/es/rest/api/All">All</a> y <a class="" href="https://dataclient.io/es/rest/api/Lazy">Lazy</a>. La exportación del espacio de nombres <code>schema</code> sigue disponible por compatibilidad hacia atrás.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="upgrade-support">Soporte para la actualización<a href="https://dataclient.io/es/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy#upgrade-support" class="hash-link" aria-label="Enlace directo al Soporte para la actualización" title="Enlace directo al Soporte para la actualización" translate="no">​</a></h3>
<p>Como siempre, si tienes algún problema o pregunta, no dudes en unirte a nuestro <a href="https://discord.gg/wXGV27xm6t" target="_blank" rel="noopener noreferrer" class=""><img decoding="async" loading="lazy" src="https://img.shields.io/discord/768254430381735967.svg?style=flat-square&amp;colorB=758ED3" alt="Chat" class="img_SS3x"></a> o <a href="https://github.com/reactive/data-client/issues/new/choose" target="_blank" rel="noopener noreferrer" class="">reportar un error</a></p>]]></content>
        <author>
            <name>Nathaniel Tucker</name>
            <uri>https://github.com/ntucker</uri>
        </author>
        <category label="Versiones" term="Versiones"/>
        <category label="REST" term="REST"/>
        <category label="Schemas" term="Schemas"/>
        <category label="Collections" term="Collections"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[v0.15: Vue 3, Collection.remove, actualización de useDebounce]]></title>
        <id>https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove</id>
        <link href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove"/>
        <updated>2026-01-06T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Composables para Vue 3, Collection.remove para una gestión eficiente de listas, consultas de Union mejoradas y ganancias de rendimiento]]></summary>
        <content type="html"><![CDATA[<p><strong>Nuevas plataformas:</strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#vue-3-support" target="_self" class="">Vue 3</a> con composables completos: useSuspense, useCache, useDLE, useController, useQuery</li>
</ul>
<p><strong>Nuevas funcionalidades:</strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#collectionremove" target="_self" class="">Collection.remove</a> para quitar elementos de las collections</li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#restendpointremove" target="_self" class="">RestEndpoint.remove</a> para combinar PATCH con la eliminación de la collection</li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#union-queries" target="_self" class="">Las Unions pueden hacer query() sin discriminador de tipo</a></li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#invalidate-unions" target="_self" class="">Invalidate admite Unions</a> para operaciones de borrado polimórficas</li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#mockinitialstate" target="_self" class="">mockInitialState()</a> para una configuración de pruebas más simple</li>
</ul>
<p><strong>Rendimiento:</strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#performance" target="_self" class="">Mejora del 10-20%</a> en las operaciones get/denormalize</li>
</ul>
<p><strong><a href="https://0.18.dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#migration-guide" target="_self" class="">Cambios incompatibles:</a></strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#usedebounce" target="_self" class="">useDebounce() devuelve [val, isPending]</a></li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#immutablejs" target="_self" class="">El soporte de ImmutableJS se movió a las exportaciones /imm</a></li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#schema-delegate" target="_self" class="">Consolidación de la interfaz delegate de Schema</a></li>
</ul>
<p>Actualiza con un <a href="https://dataclient.io/es/assets/files/v0.15-a09ab84c5309f63d14af1950930d3ba3.js" target="_blank" class="">codemod</a> automatizado para los cambios incompatibles más comunes:</p>
<div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc">npx jscodeshift <span class="token parameter variable" style="color:rgb(191, 199, 213)">-t</span> https://dataclient.io/codemods/v0.15.js <span class="token parameter variable" style="color:rgb(191, 199, 213)">--extensions</span><span class="token operator" style="color:rgb(137, 221, 255)">=</span>ts,tsx,js,jsx src/<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div>
<!-- -->
<!-- -->
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="vue-3-support">Soporte para Vue 3<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#vue-3-support" class="hash-link" aria-label="Enlace directo al Soporte para Vue 3" title="Enlace directo al Soporte para Vue 3" translate="no">​</a></h2>
<p>El nuevo paquete <a href="https://www.npmjs.com/package/@data-client/vue" target="_blank" rel="noopener noreferrer" class=""><code>@data-client/vue</code></a> trae toda la potencia de Reactive Data Client a Vue 3 con composables nativos. <a href="https://github.com/reactive/data-client/pull/3549" target="_blank" rel="noopener noreferrer" class="">#3549</a>, <a href="https://github.com/reactive/data-client/pull/3585" target="_blank" rel="noopener noreferrer" class="">#3585</a></p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="installation">Instalación<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#installation" class="hash-link" aria-label="Enlace directo al Instalación" title="Enlace directo al Instalación" translate="no">​</a></h3>
<div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc"><span class="token function" style="color:rgb(130, 170, 255)">npm install</span> @data-client/vue @data-client/rest<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="setup">Configuración<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#setup" class="hash-link" aria-label="Enlace directo al Configuración" title="Enlace directo al Configuración" translate="no">​</a></h3>
<p>Instala <a class="" href="https://dataclient.io/es/vue/api/DataClientPlugin">DataClientPlugin</a> en tu app:</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">main.ts</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> createApp <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'vue'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> DataClientPlugin <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/vue'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> app <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">createApp</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>App<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">app<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">use</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>DataClientPlugin<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">app<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">mount</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">'#app'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="composables">Composables<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#composables" class="hash-link" aria-label="Enlace directo al Composables" title="Enlace directo al Composables" translate="no">​</a></h3>
<p>Todos los hooks conocidos están disponibles como composables de Vue:</p>
<div class="language-html codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">ArticleDetail.vue</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-html codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag" style="color:rgb(255, 85, 114)">script </span><span class="token tag attr-name" style="color:rgb(255, 203, 107)">setup lang</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(199, 146, 234)">="</span><span class="token tag attr-value" style="color:rgb(255, 85, 114)">ts</span><span class="token tag attr-value punctuation" style="color:rgb(199, 146, 234)">"&gt;</span><br></div><div class="token-line"><span class="token script language-javascript keyword module" style="font-style:italic">import </span><span class="token script language-javascript imports punctuation" style="color:rgb(199, 146, 234)">{</span> useSuspense <span class="token script language-javascript imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token script language-javascript keyword module" style="font-style:italic">from </span><span class="token script language-javascript string" style="color:rgb(195, 232, 141)">'@data-client/vue'</span><span class="token script language-javascript punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token script language-javascript keyword module" style="font-style:italic">import </span><span class="token script language-javascript imports punctuation" style="color:rgb(199, 146, 234)">{ </span>ArticleResource <span class="token script language-javascript imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token script language-javascript keyword module" style="font-style:italic">from </span><span class="token script language-javascript string" style="color:rgb(195, 232, 141)">'./resources'</span><span class="token script language-javascript punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token script language-javascript" style="display:inline-block"></span><br></div><div class="token-line"><span class="token script language-javascript keyword" style="font-style:italic">const</span> props <span class="token script language-javascript operator" style="color:rgb(137, 221, 255)">=</span> defineProps<span class="token script language-javascript operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token script language-javascript punctuation" style="color:rgb(199, 146, 234)">{ </span>id<span class="token script language-javascript operator" style="color:rgb(137, 221, 255)">:</span> string <span class="token script language-javascript punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token script language-javascript operator" style="color:rgb(137, 221, 255)">&gt;</span><span class="token script language-javascript punctuation" style="color:rgb(199, 146, 234)">();</span><br></div><div class="token-line"><span class="token script language-javascript" style="display:inline-block"></span><br></div><div class="token-line"><span class="token script language-javascript keyword" style="font-style:italic">const</span> article <span class="token script language-javascript operator" style="color:rgb(137, 221, 255)">= </span><span class="token script language-javascript keyword control-flow" style="font-style:italic">await </span><span class="token script language-javascript function" style="color:rgb(130, 170, 255)">useSuspense</span><span class="token script language-javascript punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  ArticleResource<span class="token script language-javascript punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token script language-javascript punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token script language-javascript function" style="color:rgb(130, 170, 255)">computed</span><span class="token script language-javascript punctuation" style="color:rgb(199, 146, 234)">(() </span><span class="token script language-javascript arrow operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token script language-javascript punctuation" style="color:rgb(199, 146, 234)">({ </span>id<span class="token script language-javascript operator" style="color:rgb(137, 221, 255)">:</span> props<span class="token script language-javascript punctuation" style="color:rgb(199, 146, 234)">.</span>id <span class="token script language-javascript punctuation" style="color:rgb(199, 146, 234)">})),</span><br></div><div class="token-line"><span class="token script language-javascript punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;/</span><span class="token tag" style="color:rgb(255, 85, 114)">script</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag" style="color:rgb(255, 85, 114)">template</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line">  <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag" style="color:rgb(255, 85, 114)">article</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line">    <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag" style="color:rgb(255, 85, 114)">h1</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span>{{ article.title }}<span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;/</span><span class="token tag" style="color:rgb(255, 85, 114)">h1</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line">    <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag" style="color:rgb(255, 85, 114)">p</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span>{{ article.content }}<span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;/</span><span class="token tag" style="color:rgb(255, 85, 114)">p</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line">  <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;/</span><span class="token tag" style="color:rgb(255, 85, 114)">article</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line"><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;/</span><span class="token tag" style="color:rgb(255, 85, 114)">template</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div></code></pre></div></div>
<p>Composables disponibles:</p>
<ul>
<li class=""><a class="" href="https://dataclient.io/es/vue/api/useSuspense"><code>useSuspense()</code></a> - Obtención de datos con Suspense</li>
<li class=""><a class="" href="https://dataclient.io/es/vue/api/useCache"><code>useCache()</code></a> - Lee de la caché sin obtener datos</li>
<li class=""><a class="" href="https://dataclient.io/es/vue/api/useDLE"><code>useDLE()</code></a> - Patrón Data/Loading/Error sin Suspense <a href="https://github.com/reactive/data-client/pull/3592" target="_blank" rel="noopener noreferrer" class="">#3592</a></li>
<li class=""><a class="" href="https://dataclient.io/es/vue/api/useController"><code>useController()</code></a> - Acceso al controller para mutaciones</li>
<li class=""><a class="" href="https://dataclient.io/es/vue/api/useQuery"><code>useQuery()</code></a> - Consultas directas de schemas</li>
</ul>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="testing-with-mockplugin">Pruebas con MockPlugin<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#testing-with-mockplugin" class="hash-link" aria-label="Enlace directo al Pruebas con MockPlugin" title="Enlace directo al Pruebas con MockPlugin" translate="no">​</a></h3>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">test setup</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> createApp <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'vue'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> DataClientPlugin <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/vue'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> MockPlugin <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/vue/test'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> app <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">createApp</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>App<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">app<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">use</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>DataClientPlugin<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">app<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">use</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>MockPlugin<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span><br></div><div class="token-line">  fixtures<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">      endpoint<span class="token operator" style="color:rgb(137, 221, 255)">:</span> MyResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">1 </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}],</span><br></div><div class="token-line">      response<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> name<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'Test' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">],</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<div style="text-align:center"><a class="button button--primary" href="https://dataclient.io/es/vue/getting-started/agent-skills">Guía de primeros pasos</a></div>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="collectionremove">Collection.remove<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#collectionremove" class="hash-link" aria-label="Enlace directo al Collection.remove" title="Enlace directo al Collection.remove" translate="no">​</a></h2>
<p>Nuevo schema para quitar elementos de las <a class="" href="https://dataclient.io/es/rest/api/Collection">Collections</a> sin eliminar la entidad en sí. <a href="https://github.com/reactive/data-client/pull/3560" target="_blank" rel="noopener noreferrer" class="">#3560</a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> schema <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> TodoCollection <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">schema</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">Collection</span><span class="token punctuation" style="color:rgb(199, 146, 234)">([</span>Todo<span class="token punctuation" style="color:rgb(199, 146, 234)">]);</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> TodoResource <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">resource</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/todos/:id'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Todo<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}).</span><span class="token function" style="color:rgb(130, 170, 255)">extend</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  getList<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> schema<span class="token operator" style="color:rgb(137, 221, 255)">:</span> TodoCollection <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Remove from collection without deleting</span><br></div><div class="token-line">ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">set</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>TodoResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>getList<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>remove<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'123' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<p>Es útil cuando un elemento debe quitarse de una vista de lista pero seguir existiendo en otros lugares:</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Remove user from a specific group list</span><br></div><div class="token-line">ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">set</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>UserResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>getList<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>remove<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id<span class="token operator" style="color:rgb(137, 221, 255)">:</span> userId<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> group<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'admins' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="restendpointremove">RestEndpoint.remove<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#restendpointremove" class="hash-link" aria-label="Enlace directo al RestEndpoint.remove" title="Enlace directo al RestEndpoint.remove" translate="no">​</a></h2>
<p><a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#remove">RestEndpoint.remove</a> combina una actualización PATCH con la eliminación de la collection; perfecto para operaciones de "archivar" o "mover". <a href="https://github.com/reactive/data-client/pull/3623" target="_blank" rel="noopener noreferrer" class="">#3623</a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> getTodos <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/todos'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">schema</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">Collection</span><span class="token punctuation" style="color:rgb(199, 146, 234)">([</span>Todo<span class="token punctuation" style="color:rgb(199, 146, 234)">]),</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Removes Todo from collection AND updates it with new data</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">await</span> ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  getTodos<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>remove<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{},</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'123'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> title<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'Done'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> completed<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token boolean" style="color:rgb(255, 88, 116)">true</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> archived<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token boolean" style="color:rgb(255, 88, 116)">true </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Move user between groups</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">await</span> ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  UserResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>getList<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>remove<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> group<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'team-a' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">2</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> username<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'bob'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> group<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'team-b' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// User removed from 'team-a' list AND entity updated with group: 'team-b'</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="union-queries">Consultas de Union<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#union-queries" class="hash-link" aria-label="Enlace directo al Consultas de Union" title="Enlace directo al Consultas de Union" translate="no">​</a></h2>
<p>Las <a class="" href="https://dataclient.io/es/rest/api/Union">Unions</a> ahora pueden consultarse sin especificar el discriminador de tipo. <a href="https://github.com/reactive/data-client/pull/3558" target="_blank" rel="noopener noreferrer" class="">#3558</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Type discriminator required</span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// @ts-expect-error - missing 'type'</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> event <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useQuery</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>EventUnion<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// event is undefined</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> newsEvent <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useQuery</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>EventUnion<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> type<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'news' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// newsEvent is found</span><br></div></code></pre></div></div><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Works without type discriminator</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> event <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useQuery</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>EventUnion<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// event is found!</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> newsEvent <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useQuery</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>EventUnion<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> type<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'news' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// newsEvent is also found</span><br></div></code></pre></div></div></div></div></div></figure>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="invalidate-unions">Invalidate admite Unions<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#invalidate-unions" class="hash-link" aria-label="Enlace directo al Invalidate admite Unions" title="Enlace directo al Invalidate admite Unions" translate="no">​</a></h2>
<p><a class="" href="https://dataclient.io/es/rest/api/Invalidate">schema.Invalidate</a> ahora acepta schemas <a class="" href="https://dataclient.io/es/rest/api/Union">Union</a> para operaciones de borrado polimórficas. Además, <a class="" href="https://dataclient.io/es/rest/api/resource#delete">resource().delete</a> envuelve automáticamente los schemas Union con Invalidate. <a href="https://github.com/reactive/data-client/pull/3559" target="_blank" rel="noopener noreferrer" class="">#3559</a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> FeedUnion <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">schema</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">Union</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> posts<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Post<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> comments<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Comment <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  <span class="token string" style="color:rgb(195, 232, 141)">'type'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// resource() automatically handles Union delete</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> FeedResource <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">resource</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/feed/:id'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">:</span> FeedUnion<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">await</span> ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>FeedResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>delete<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'123' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// For standalone endpoints, use schema.Invalidate directly</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> deleteFeedItem <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/feed/:id'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  method<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'DELETE'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">schema</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">Invalidate</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>FeedUnion<span class="token punctuation" style="color:rgb(199, 146, 234)">),</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">await</span> ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>deleteFeedItem<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'123' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="testing-utilities">Utilidades de prueba<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#testing-utilities" class="hash-link" aria-label="Enlace directo al Utilidades de prueba" title="Enlace directo al Utilidades de prueba" translate="no">​</a></h2>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="mockinitialstate">mockInitialState()<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#mockinitialstate" class="hash-link" aria-label="Enlace directo al mockInitialState()" title="Enlace directo al mockInitialState()" translate="no">​</a></h3>
<p>Nueva utilidad para crear un estado prepoblado en las pruebas. <a href="https://github.com/reactive/data-client/commit/a4092a1499" target="_blank" rel="noopener noreferrer" class=""><code>a4092a1</code></a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> mockInitialState <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react/mock'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> ArticleResource <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'./resources'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> state <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">mockInitialState</span><span class="token punctuation" style="color:rgb(199, 146, 234)">([</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    endpoint<span class="token operator" style="color:rgb(137, 221, 255)">:</span> ArticleResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">5 </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}],</span><br></div><div class="token-line">    response<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> title<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'Hello'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> content<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'World' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">]);</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="data-clientcoremock">@data-client/core/mock<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#data-clientcoremock" class="hash-link" aria-label="Enlace directo al @data-client/core/mock" title="Enlace directo al @data-client/core/mock" translate="no">​</a></h3>
<p>Nuevo punto de entrada de mocks con utilidades para construir implementaciones de mock personalizadas:</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{ </span><br></div><div class="token-line">  MockController<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  collapseFixture<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  createFixtureMap<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/core/mock'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div></code></pre></div></div>
<ul>
<li class=""><code>MockController</code> - Envoltorio del Controller para simular endpoints</li>
<li class=""><code>collapseFixture</code> - Resuelve las respuestas de los fixtures (maneja respuestas en forma de función)</li>
<li class=""><code>createFixtureMap</code> - Separa los fixtures en un mapa estático e interceptors</li>
</ul>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="performance">Rendimiento<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#performance" class="hash-link" aria-label="Enlace directo al Rendimiento" title="Enlace directo al Rendimiento" translate="no">​</a></h2>
<p>Eliminar la sobrecarga de la detección automática de ImmutableJS y optimizar las rutas de código de desnormalización proporciona una <strong>mejora del 10-20%</strong> en las operaciones get/denormalize. <a href="https://github.com/reactive/data-client/pull/3421" target="_blank" rel="noopener noreferrer" class="">#3421</a>, <a href="https://github.com/reactive/data-client/pull/3468" target="_blank" rel="noopener noreferrer" class="">#3468</a></p>
<center><div style="max-width:500px"></div><p><a href="https://reactive.github.io/data-client/dev/bench/" target="_blank" rel="noopener noreferrer" class="">Benchmarks a lo largo del tiempo</a> | <a href="https://github.com/reactive/data-client/tree/master/examples/benchmark" target="_blank" rel="noopener noreferrer" class="">Ver benchmark</a></p></center>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="other-improvements">Otras mejoras<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#other-improvements" class="hash-link" aria-label="Enlace directo al Otras mejoras" title="Enlace directo al Otras mejoras" translate="no">​</a></h2>
<ul>
<li class="">Se corrigen los tipos de <code>getPage</code> cuando paginationField está en el body</li>
<li class="">Se corrige el manejo polimórfico de entidades invalidadas en <a class="" href="https://dataclient.io/es/rest/api/All">schema.All()</a></li>
<li class="">Se corrigen los tipos del argumento 'state' de <a class="" href="https://dataclient.io/es/docs/api/Controller#get">controller.get</a> y controller.getQueryMeta</li>
</ul>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="migration-guide">Guía de migración<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#migration-guide" class="hash-link" aria-label="Enlace directo al Guía de migración" title="Enlace directo al Guía de migración" translate="no">​</a></h2>
<!-- -->
<p>Esta actualización requiere actualizar todas las versiones de los paquetes simultáneamente.</p>
<div class="theme-tabs-container tabs-container tabList_J5MA"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_l0OV tabs__item--active">NPM</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">Yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">esm.sh</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_wHwb"><div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc"><span class="token function" style="color:rgb(130, 170, 255)">npm install </span><span class="token parameter variable" style="color:rgb(191, 199, 213)">--save</span> @data-client/react@^0.15.0 @data-client/rest@^0.15.0 @data-client/test@^0.15.0 @data-client/img@^0.15.0<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">yarn add @data-client/react@^0.15.0 @data-client/rest@^0.15.0 @data-client/test@^0.15.0 @data-client/img@^0.15.0<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">pnpm add @data-client/react@^0.15.0 @data-client/rest@^0.15.0 @data-client/test@^0.15.0 @data-client/img@^0.15.0<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-html language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">&lt;script type="importmap"&gt;<br></div><div class="token-line">{<br></div><div class="token-line">  "imports": {<br></div><div class="token-line">    "@data-client/react": "https://esm.sh/@data-client/react@^0.15.0",<br></div><div class="token-line">    "@data-client/rest": "https://esm.sh/@data-client/rest@^0.15.0",<br></div><div class="token-line">    "@data-client/test": "https://esm.sh/@data-client/test@^0.15.0",<br></div><div class="token-line">    "@data-client/img": "https://esm.sh/@data-client/img@^0.15.0"<br></div><div class="token-line">  }<br></div><div class="token-line">}<br></div><div class="token-line">&lt;/script&gt;<br></div></code></pre></div></div></div></div></div>
<p>Un <a href="https://dataclient.io/es/assets/files/v0.15-a09ab84c5309f63d14af1950930d3ba3.js" target="_blank" class="">codemod</a> automatizado se encarga de los cambios incompatibles que se describen a continuación:</p>
<div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc">npx jscodeshift <span class="token parameter variable" style="color:rgb(191, 199, 213)">-t</span> https://dataclient.io/codemods/v0.15.js <span class="token parameter variable" style="color:rgb(191, 199, 213)">--extensions</span><span class="token operator" style="color:rgb(137, 221, 255)">=</span>ts,tsx,js,jsx src/<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="usedebounce">useDebounce() devuelve [val, isPending]<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#usedebounce" class="hash-link" aria-label="Enlace directo al useDebounce() devuelve [val, isPending]" title="Enlace directo al useDebounce() devuelve [val, isPending]" translate="no">​</a></h3>
<p><a class="" href="https://dataclient.io/es/docs/api/useDebounce">useDebounce()</a> ahora devuelve una tupla con el estado pendiente, siguiendo el patrón de <code>useTransition</code> de React 19. <a href="https://github.com/reactive/data-client/pull/3459" target="_blank" rel="noopener noreferrer" class="">#3459</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token imports punctuation" style="color:rgb(199, 146, 234)">{</span> useDebounce <span class="token imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> debouncedQuery <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useDebounce</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>query<span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token number" style="color:rgb(247, 140, 108)">100</span><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token imports punctuation" style="color:rgb(199, 146, 234)">{</span> useDebounce <span class="token imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span>debouncedQuery<span class="token punctuation" style="color:rgb(199, 146, 234)">] </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useDebounce</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>query<span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token number" style="color:rgb(247, 140, 108)">100</span><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Or use the pending state</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span>debouncedQuery<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> isPending<span class="token punctuation" style="color:rgb(199, 146, 234)">] </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useDebounce</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>query<span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token number" style="color:rgb(247, 140, 108)">100</span><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div></div></div></div></figure>
<div class="theme-admonition theme-admonition-tip admonition_WCGJ alert alert--success"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>consejo</div><div class="admonitionContent_pbrs"><p>La firma anterior sigue disponible mediante <code>@data-client/react/next</code> para una migración gradual.</p></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="immutablejs">ImmutableJS se movió a las exportaciones /imm<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#immutablejs" class="hash-link" aria-label="Enlace directo al ImmutableJS se movió a las exportaciones /imm" title="Enlace directo al ImmutableJS se movió a las exportaciones /imm" translate="no">​</a></h3>
<p>El soporte de ImmutableJS ya no se detecta automáticamente. Usa las exportaciones explícitas de <code>/imm</code> para manejar estado de ImmutableJS. <a href="https://github.com/reactive/data-client/pull/3421" target="_blank" rel="noopener noreferrer" class="">#3421</a>, <a href="https://github.com/reactive/data-client/pull/3468" target="_blank" rel="noopener noreferrer" class="">#3468</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> MemoCache<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> denormalize <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/normalizr'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> memo <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">MemoCache</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Auto-detected ImmutableJS</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> MemoCache <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/normalizr'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> MemoPolicy<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> denormalize<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> normalize <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/normalizr/imm'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> memo <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">MemoCache</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>MemoPolicy<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div></div></div></div></figure>
<p>El punto de entrada <code>/imm</code> ahora incluye tanto <code>normalize()</code> como <code>denormalize()</code> para un manejo completo del estado de ImmutableJS:</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> normalize <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/normalizr/imm'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> fromJS <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'immutable'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> result <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">normalize</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>Article<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> responseData<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span><br></div><div class="token-line">  entities<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token function" style="color:rgb(130, 170, 255)">fromJS</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({}),</span><br></div><div class="token-line">  indexes<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token function" style="color:rgb(130, 170, 255)">fromJS</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({}),</span><br></div><div class="token-line">  entitiesMeta<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token function" style="color:rgb(130, 170, 255)">fromJS</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({}),</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// result.entities is an ImmutableJS Map</span><br></div></code></pre></div></div>
<p>Este cambio proporciona una mejora de rendimiento del 10-20% al eliminar la sobrecarga de la detección de ImmutableJS para quienes no lo usan.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="schema-delegate">Cambios en la interfaz delegate de Schema<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#schema-delegate" class="hash-link" aria-label="Enlace directo al Cambios en la interfaz delegate de Schema" title="Enlace directo al Cambios en la interfaz delegate de Schema" translate="no">​</a></h3>
<p>Si tienes schemas personalizados que sobrescriben <code>normalize()</code> o <code>queryKey()</code>, los argumentos de callback se han consolidado en un objeto <code>delegate</code>. <a href="https://github.com/reactive/data-client/pull/3449" target="_blank" rel="noopener noreferrer" class="">#3449</a></p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="normalize">normalize()<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#normalize" class="hash-link" aria-label="Enlace directo al normalize()" title="Enlace directo al normalize()" translate="no">​</a></h4>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">normalize</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  input<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  parent<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  key<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string </span><span class="token operator" style="color:rgb(137, 221, 255)">| </span><span class="token keyword" style="font-style:italic">undefined</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[],</span><br></div><div class="token-line">  <span class="token function-variable function" style="color:rgb(130, 170, 255)">visit</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">...</span>args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  addEntity<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  getEntity<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  checkLoop<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">addEntity</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> processedEntity<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> id<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">normalize</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  input<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  parent<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  key<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string </span><span class="token operator" style="color:rgb(137, 221, 255)">| </span><span class="token keyword" style="font-style:italic">undefined</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[],</span><br></div><div class="token-line">  <span class="token function-variable function" style="color:rgb(130, 170, 255)">visit</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">...</span>args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  delegate<span class="token operator" style="color:rgb(137, 221, 255)">:</span> INormalizeDelegate<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">mergeEntity</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> id<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> processedEntity<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="querykey">queryKey()<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#querykey" class="hash-link" aria-label="Enlace directo al queryKey()" title="Enlace directo al queryKey()" translate="no">​</a></h4>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">queryKey</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> queryKey<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> getEntity<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> getIndex<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">getIndex</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>key<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> indexName<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> value<span class="token punctuation" style="color:rgb(199, 146, 234)">)[</span>value<span class="token punctuation" style="color:rgb(199, 146, 234)">];</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">getEntity</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>key<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> id<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">return </span><span class="token function" style="color:rgb(130, 170, 255)">queryKey</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> getEntity<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> getIndex<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">queryKey</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> unvisit<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">  delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getIndex</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>key<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> indexName<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> value<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getEntity</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>key<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> id<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">return </span><span class="token function" style="color:rgb(130, 170, 255)">unvisit</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="delegategetentity--delegategetentities-3501">delegate.getEntity → delegate.getEntities <a href="https://github.com/reactive/data-client/pull/3501" target="_blank" rel="noopener noreferrer" class="">#3501</a><a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#delegategetentity--delegategetentities-3501" class="hash-link" aria-label="Enlace directo al delegategetentity--delegategetentities-3501" title="Enlace directo al delegategetentity--delegategetentities-3501" translate="no">​</a></h4>
<p>Al iterar sobre todas las entidades de un tipo, usa <code>delegate.getEntities()</code>, que devuelve una interfaz restringida con los métodos iteradores <code>keys()</code> y <code>entries()</code>:</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> entities <span class="token operator" style="color:rgb(137, 221, 255)">=</span> delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getEntity</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>key<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>entities<span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></div><div class="token-line">  Object<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">keys</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>entities<span class="token punctuation" style="color:rgb(199, 146, 234)">).</span><span class="token function" style="color:rgb(130, 170, 255)">forEach</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>collectionPk <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">!</span><span class="token function" style="color:rgb(130, 170, 255)">filterCollections</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token constant" style="color:rgb(130, 170, 255)">JSON</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">parse</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>collectionPk<span class="token punctuation" style="color:rgb(199, 146, 234)">))) </span><span class="token keyword" style="font-style:italic">return</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">    delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">mergeEntity</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> collectionPk<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> normalizedValue<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> entities <span class="token operator" style="color:rgb(137, 221, 255)">=</span> delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getEntities</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>key<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>entities<span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">for </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">const</span> collectionKey <span class="token keyword" style="font-style:italic">of</span> entities<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">keys</span><span class="token punctuation" style="color:rgb(199, 146, 234)">()) {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">!</span><span class="token function" style="color:rgb(130, 170, 255)">filterCollections</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token constant" style="color:rgb(130, 170, 255)">JSON</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">parse</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>collectionKey<span class="token punctuation" style="color:rgb(199, 146, 234)">))) </span><span class="token keyword" style="font-style:italic">continue</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">    delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">mergeEntity</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> collectionKey<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> normalizedValue<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="invalid-removed">Símbolo INVALID eliminado<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#invalid-removed" class="hash-link" aria-label="Enlace directo al Símbolo INVALID eliminado" title="Enlace directo al Símbolo INVALID eliminado" translate="no">​</a></h3>
<p>El símbolo <code>INVALID</code> ya no se exporta. Usa en su lugar los métodos del delegate. <a href="https://github.com/reactive/data-client/pull/3461" target="_blank" rel="noopener noreferrer" class="">#3461</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{ </span><span class="token constant" style="color:rgb(130, 170, 255)">INVALID </span><span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/endpoint'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">normalize</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">...</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">  delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">setEntity</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> pk<span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token constant" style="color:rgb(130, 170, 255)">INVALID</span><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">queryKey</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> unvisit<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">!</span>found<span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token keyword" style="font-style:italic">return </span><span class="token constant" style="color:rgb(130, 170, 255)">INVALID</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">normalize</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">...</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">  delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">invalidate</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> key<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>key <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span> pk<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">queryKey</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> unvisit<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">!</span>found<span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token keyword" style="font-style:italic">return</span> delegate<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token constant" style="color:rgb(130, 170, 255)">INVALID</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="entitiesmeta">state.entityMeta -&gt; state.entitiesMeta<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#entitiesmeta" class="hash-link" aria-label="Enlace directo al state.entityMeta -> state.entitiesMeta" title="Enlace directo al state.entityMeta -> state.entitiesMeta" translate="no">​</a></h3>
<p>Propiedad del estado interno renombrada por consistencia. Solo afecta al acceso directo al store. <a href="https://github.com/reactive/data-client/pull/3451" target="_blank" rel="noopener noreferrer" class="">#3451</a></p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="networkmanager">Cambios en la estructura de datos de NetworkManager<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#networkmanager" class="hash-link" aria-label="Enlace directo al Cambios en la estructura de datos de NetworkManager" title="Enlace directo al Cambios en la estructura de datos de NetworkManager" translate="no">​</a></h3>
<p><code>fetched</code>, <code>rejectors</code>, <code>resolvers</code> y <code>fetchedAt</code> de <a class="" href="https://dataclient.io/es/docs/api/NetworkManager">NetworkManager</a>
se han consolidado en <code>fetching</code>. <a href="https://github.com/reactive/data-client/pull/3394" target="_blank" rel="noopener noreferrer" class="">#3394</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>key <span class="token keyword" style="font-style:italic">in this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>fetched<span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>fetching<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">has</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>key<span class="token punctuation" style="color:rgb(199, 146, 234)">))</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="memocache">Cambios en la API de MemoCache (normalizr)<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#memocache" class="hash-link" aria-label="Enlace directo al Cambios en la API de MemoCache (normalizr)" title="Enlace directo al Cambios en la API de MemoCache (normalizr)" translate="no">​</a></h3>
<p>Para quienes usan <a href="https://www.npmjs.com/package/@data-client/normalizr" target="_blank" rel="noopener noreferrer" class="">@data-client/normalizr</a> directamente:</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="memocachequery-and-buildquerykey-take-state-as-one-argument-3372">MemoCache.query() y buildQueryKey() reciben el estado como un solo argumento <a href="https://github.com/reactive/data-client/pull/3372" target="_blank" rel="noopener noreferrer" class="">#3372</a><a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#memocachequery-and-buildquerykey-take-state-as-one-argument-3372" class="hash-link" aria-label="Enlace directo al memocachequery-and-buildquerykey-take-state-as-one-argument-3372" title="Enlace directo al memocachequery-and-buildquerykey-take-state-as-one-argument-3372" translate="no">​</a></h4>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>memo<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">buildQueryKey</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> state<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>entities<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> state<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>indexes<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> key<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>memo<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">query</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> state<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>entities<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> state<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>indexes<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>memo<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">buildQueryKey</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> state<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> key<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>memo<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">query</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> state<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div></div></div></div></figure>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="memocachequery-returns--data-paths-">MemoCache.query() devuelve { data, paths }<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#memocachequery-returns--data-paths-" class="hash-link" aria-label="Enlace directo al MemoCache.query() devuelve { data, paths }" title="Enlace directo al MemoCache.query() devuelve { data, paths }" translate="no">​</a></h4>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> data <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>memo<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">query</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> state<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">return typeof</span> data <span class="token operator" style="color:rgb(137, 221, 255)">=== </span><span class="token string" style="color:rgb(195, 232, 141)">'symbol' </span><span class="token operator" style="color:rgb(137, 221, 255)">? </span><span class="token keyword" style="font-style:italic">undefined </span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>data <span class="token keyword" style="font-style:italic">as </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="upgrade-support">Soporte para la actualización<a href="https://dataclient.io/es/blog/2026/01/06/v0.15-vue-support-collection-remove#upgrade-support" class="hash-link" aria-label="Enlace directo al Soporte para la actualización" title="Enlace directo al Soporte para la actualización" translate="no">​</a></h3>
<p>Como siempre, si tienes algún problema o pregunta, no dudes en unirte a nuestro <a href="https://discord.gg/wXGV27xm6t" target="_blank" rel="noopener noreferrer" class=""><img decoding="async" loading="lazy" src="https://img.shields.io/discord/768254430381735967.svg?style=flat-square&amp;colorB=758ED3" alt="Chat" class="img_SS3x"></a> o <a href="https://github.com/reactive/data-client/issues/new/choose" target="_blank" rel="noopener noreferrer" class="">reportar un error</a></p>]]></content>
        <author>
            <name>Nathaniel Tucker</name>
            <uri>https://github.com/ntucker</uri>
        </author>
        <category label="Versiones" term="Versiones"/>
        <category label="Vue" term="Vue"/>
        <category label="Schemas" term="Schemas"/>
        <category label="Validación" term="Validación"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[v0.14: APIs de Manager simplificadas, rendimiento y GC]]></title>
        <id>https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement</id>
        <link href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement"/>
        <updated>2024-07-13T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Obtención de datos más rápida, bundles 30% más pequeños, recolección de basura automática y APIs de Manager más limpias]]></summary>
        <content type="html"><![CDATA[<p><strong>Managers:</strong></p>
<p>Las APIs de Manager se han simplificado: formas de acción más planas reducen la complejidad del código y mejoran el rendimiento al minimizar las entradas distintas de la caché inline, mientras que APIs de configuración más simples hacen que la personalización sea más agradable.</p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#action-shapes" target="_self" class="">Formas de acción simplificadas</a></li>
<li class="">Propiedad <a href="https://0.18.dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#manager-middleware" target="_self" class="">Manager.middleware</a></li>
<li class="">Configuración de <a href="https://0.18.dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#getdefaultmanagers" target="_self" class="">getDefaultManagers()</a></li>
</ul>
<p><strong>Rendimiento:</strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#immediate-fetching" target="_self" class="">Llamadas fetch inmediatas</a>: ya no se espera a que el sistema esté inactivo</li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#bundle-size" target="_self" class="">Bundles 30% más pequeños</a> al eliminar polyfills innecesarios</li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#normalization-performance" target="_self" class="">Normalización 10% más rápida, desnormalización 32% más rápida</a></li>
</ul>
<p><strong>Schema/Modelado de datos:</strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#query-joins" target="_self" class="">Joins con Query</a> usando Object Schemas</li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#entitymixin" target="_self" class="">EntityMixin</a> para componer el comportamiento de Entity</li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#entity-pk-default" target="_self" class="">Valor predeterminado de Entity.pk()</a> usa <code>id</code></li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#dynamic-invalidation" target="_self" class="">Invalidación dinámica</a> mediante Entity.process()</li>
</ul>
<p><strong>Pruebas:</strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#renderdatahook" target="_self" class="">renderDataHook()</a> para pruebas más simples</li>
</ul>
<p><strong>Recolección de basura:</strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#gcpolicy" target="_self" class="">GCPolicy</a>: recolección de basura automática de datos obsoletos</li>
</ul>
<p><strong><a href="https://0.18.dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#migration-guide" target="_self" class="">Cambios incompatibles:</a></strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#networkmanager" target="_self" class="">NetworkManager obtiene los datos de inmediato</a></li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#action-response" target="_self" class="">action.payload -&gt; action.response</a></li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#action-args" target="_self" class="">action.meta.args -&gt; action.args</a></li>
</ul>
<!-- -->
<!-- -->
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="managers">Managers<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#managers" class="hash-link" aria-label="Enlace directo al Managers" title="Enlace directo al Managers" translate="no">​</a></h2>
<p>Las APIs de Manager se han simplificado: formas de acción más planas reducen la complejidad del código y mejoran el rendimiento al minimizar las entradas distintas de la caché inline, mientras que APIs de configuración más simples hacen que la personalización sea más agradable.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="action-shapes">Formas de acción<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#action-shapes" class="hash-link" aria-label="Enlace directo al Formas de acción" title="Enlace directo al Formas de acción" translate="no">​</a></h3>
<p>Las formas de acción son más simples y consistentes. <a href="https://github.com/reactive/data-client/pull/3143" target="_blank" rel="noopener noreferrer" class="">#3143</a>, <a href="https://github.com/reactive/data-client/pull/3139" target="_blank" rel="noopener noreferrer" class="">#3139</a></p>
<ul>
<li class=""><code>action.meta.args</code> -&gt; <code>action.args</code></li>
<li class=""><code>action.meta.key</code> -&gt; <code>action.key</code></li>
<li class=""><code>action.meta.nm</code> eliminado (no se usaba)</li>
<li class=""><code>action.payload</code> -&gt; <code>action.response</code> (para SET_RESPONSE)</li>
</ul>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-json codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-json codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  "type"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"rdc/setresponse"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  "meta"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    "key"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"PATCH https://jsonplaceholder.typicode.com/todos/1"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    "payload"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">      "userId"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      "id"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      "title"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"delectus aut autem"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      "completed"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token boolean" style="color:rgb(255, 88, 116)">true</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">    "args"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><br></div><div class="token-line">      <span class="token punctuation" style="color:rgb(199, 146, 234)">{ </span>"id"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">1 </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">      <span class="token punctuation" style="color:rgb(199, 146, 234)">{ </span>"completed"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token boolean" style="color:rgb(255, 88, 116)">true </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">],</span><br></div><div class="token-line">    "nm"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token boolean" style="color:rgb(255, 88, 116)">true</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    "endpoint"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">      "name"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"Todo.partialUpdate"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      "schema"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">        "key"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"Todo"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">        "schema"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{}</span><br></div><div class="token-line">      <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">      "sideEffect"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token boolean" style="color:rgb(255, 88, 116)">true</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">    "fetchedAt"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"12:44:24.206 PM"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    "date"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"12:44:24.334 PM"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    "expiresAt"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"1:44:24.334 PM"</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  "error"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token boolean" style="color:rgb(255, 88, 116)">false</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-json codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-json codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  "type"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"rdc/setresponse"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  "key"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"PATCH https://jsonplaceholder.typicode.com/todos/1"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  "response"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    "userId"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    "id"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    "title"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"delectus aut autem"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    "completed"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token boolean" style="color:rgb(255, 88, 116)">true</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  "args"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">{ </span>"id"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">1 </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">{ </span>"completed"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token boolean" style="color:rgb(255, 88, 116)">true </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">],</span><br></div><div class="token-line">  "endpoint"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    "name"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"Todo.partialUpdate"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    "schema"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">      "key"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"Todo"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      "schema"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{}</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">    "sideEffect"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token boolean" style="color:rgb(255, 88, 116)">true</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  "meta"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    "fetchedAt"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"12:44:24.206 PM"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    "date"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"12:44:24.334 PM"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    "expiresAt"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"1:44:24.334 PM"</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  "error"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token boolean" style="color:rgb(255, 88, 116)">false</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="manager-middleware">Manager.middleware<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#manager-middleware" class="hash-link" aria-label="Enlace directo al Manager.middleware" title="Enlace directo al Manager.middleware" translate="no">​</a></h3>
<p>Los Managers ahora pueden usar una propiedad <code>middleware</code> en lugar del método <code>getMiddleware()</code>. <a href="https://github.com/reactive/data-client/pull/3164" target="_blank" rel="noopener noreferrer" class="">#3164</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyManager </span><span class="token keyword" style="font-style:italic">implements </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  getMiddleware <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">()</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span> Middleware <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> controller <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> next <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token keyword" style="font-style:italic">async</span> action <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// handle action</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">cleanup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyManager </span><span class="token keyword" style="font-style:italic">implements </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  middleware<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token function-variable function" style="color:rgb(130, 170, 255)">Middleware </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> controller <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> next <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token keyword" style="font-style:italic">async</span> action <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// handle action</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">cleanup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<div class="theme-admonition theme-admonition-tip admonition_WCGJ alert alert--success"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>consejo</div><div class="admonitionContent_pbrs"><p><code>getMiddleware()</code> sigue funcionando por compatibilidad hacia atrás.</p></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="actiontypes-without-_type-suffix">actionTypes sin el sufijo _TYPE<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#actiontypes-without-_type-suffix" class="hash-link" aria-label="Enlace directo al actionTypes sin el sufijo _TYPE" title="Enlace directo al actionTypes sin el sufijo _TYPE" translate="no">​</a></h3>
<p>Ya están disponibles nombres de tipos de acción más limpios (no es un cambio incompatible: también conservamos los nombres anteriores). <a href="https://github.com/reactive/data-client/pull/3244" target="_blank" rel="noopener noreferrer" class="">#3244</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import type </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> Manager<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> Middleware <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> actionTypes <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export default class </span><span class="token class-name" style="color:rgb(255, 203, 107)">LoggingManager </span><span class="token keyword" style="font-style:italic">implements </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  middleware<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token function-variable function" style="color:rgb(130, 170, 255)">Middleware </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> controller <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> next <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token keyword" style="font-style:italic">async</span> action <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">switch </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>type<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">case</span> actionTypes<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token constant" style="color:rgb(130, 170, 255)">SET_RESPONSE_TYPE</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><br></div><div class="token-line">        <span class="token builtin" style="color:rgb(130, 170, 255)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">info</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">          <span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">${</span>action<span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span>endpoint<span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span>name<span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">} ${</span><span class="token template-string interpolation constant" style="color:rgb(130, 170, 255)">JSON</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token template-string interpolation function" style="color:rgb(130, 170, 255)">stringify</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span>response<span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">)}</span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">        <span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">default</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><br></div><div class="token-line">        <span class="token keyword" style="font-style:italic">return </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">cleanup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import type </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> Manager<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> Middleware <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> actionTypes <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export default class </span><span class="token class-name" style="color:rgb(255, 203, 107)">LoggingManager </span><span class="token keyword" style="font-style:italic">implements </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  middleware<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token function-variable function" style="color:rgb(130, 170, 255)">Middleware </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> controller <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> next <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token keyword" style="font-style:italic">async</span> action <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">switch </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>type<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">case</span> actionTypes<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token constant" style="color:rgb(130, 170, 255)">SET_RESPONSE</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><br></div><div class="token-line">        <span class="token builtin" style="color:rgb(130, 170, 255)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">info</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">          <span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">${</span>action<span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span>endpoint<span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span>name<span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">} ${</span><span class="token template-string interpolation constant" style="color:rgb(130, 170, 255)">JSON</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token template-string interpolation function" style="color:rgb(130, 170, 255)">stringify</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span>response<span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">)}</span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">        <span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">default</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><br></div><div class="token-line">        <span class="token keyword" style="font-style:italic">return </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">cleanup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="getdefaultmanagers">getDefaultManagers()<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#getdefaultmanagers" class="hash-link" aria-label="Enlace directo al getDefaultManagers()" title="Enlace directo al getDefaultManagers()" translate="no">​</a></h3>
<p><a class="" href="https://dataclient.io/es/docs/api/getDefaultManagers">getDefaultManagers()</a> ahora acepta opciones de configuración. <a href="https://github.com/reactive/data-client/pull/3161" target="_blank" rel="noopener noreferrer" class="">#3161</a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> getDefaultManagers <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Remove DevToolsManager</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> managers <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">getDefaultManagers</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> devToolsManager<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">null </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Configure DevToolsManager</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> managers <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">getDefaultManagers</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  devToolsManager<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    latency<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">1000</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    <span class="token function-variable function" style="color:rgb(130, 170, 255)">predicate</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>state<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> action<span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> action<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>type <span class="token operator" style="color:rgb(137, 221, 255)">!==</span> actionTypes<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token constant" style="color:rgb(130, 170, 255)">SET_RESPONSE</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Use custom NetworkManager</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> managers <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">getDefaultManagers</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  networkManager<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">IdlingNetworkManager</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(),</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="networkmanager-constructor">Constructor de NetworkManager<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#networkmanager-constructor" class="hash-link" aria-label="Enlace directo al Constructor de NetworkManager" title="Enlace directo al Constructor de NetworkManager" translate="no">​</a></h3>
<p>El constructor de <a class="" href="https://dataclient.io/es/docs/api/NetworkManager">NetworkManager</a> ahora usa argumentos con nombre para mayor claridad.</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">NetworkManager</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">42</span><span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token number" style="color:rgb(247, 140, 108)">7</span><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">NetworkManager</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> dataExpiryLength<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">42</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> errorExpiryLength<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">7 </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div></div></div></div></figure>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="performance">Rendimiento<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#performance" class="hash-link" aria-label="Enlace directo al Rendimiento" title="Enlace directo al Rendimiento" translate="no">​</a></h2>
<p>El modo concurrente y el batching automático de React 18+ cambian cómo debemos optimizar. Esperar a los callbacks de inactividad ya no es lo óptimo: obtener los datos de inmediato ahora da mejores resultados. Los cambios internos aprovechan closures y estructuras de datos <code>Map</code> para una normalización y búsqueda más rápidas, mientras que eliminar dependencias de polyfills infladas reduce significativamente los bundles.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="immediate-fetching">Obtención inmediata<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#immediate-fetching" class="hash-link" aria-label="Enlace directo al Obtención inmediata" title="Enlace directo al Obtención inmediata" translate="no">​</a></h3>
<p><a class="" href="https://dataclient.io/es/docs/api/NetworkManager">NetworkManager</a> ahora obtiene los datos de inmediato en lugar de esperar a los callbacks de inactividad. <a href="https://github.com/reactive/data-client/pull/3146" target="_blank" rel="noopener noreferrer" class="">#3146</a></p>
<p>Esto se traduce en una carga de datos más rápida, especialmente en aplicaciones con árboles de renderizado complejos.</p>
<p><code>IdlingNetworkManager</code> sigue disponible para quienes prefieran el comportamiento anterior:</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> IdlingNetworkManager<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> getDefaultManagers <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> managers <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">getDefaultManagers</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  networkManager<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">IdlingNetworkManager</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(),</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="bundle-size">Tamaño del bundle<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#bundle-size" class="hash-link" aria-label="Enlace directo al Tamaño del bundle" title="Enlace directo al Tamaño del bundle" translate="no">​</a></h3>
<p>Los paquetes ahora son <strong>30% más pequeños</strong> tras eliminar paquetes de polyfills inflados. <a href="https://github.com/reactive/data-client/pull/3384" target="_blank" rel="noopener noreferrer" class="">#3384</a></p>
<p>Además, los polyfills ya no contaminan el ámbito global. <a href="https://github.com/reactive/data-client/pull/3353" target="_blank" rel="noopener noreferrer" class="">#3353</a></p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="normalization-performance">Rendimiento de la normalización<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#normalization-performance" class="hash-link" aria-label="Enlace directo al Rendimiento de la normalización" title="Enlace directo al Rendimiento de la normalización" translate="no">​</a></h3>
<p>Los cambios internos en la interfaz de schema aportan una <strong>mejora del 10% en el rendimiento de la normalización</strong>. <a href="https://github.com/reactive/data-client/pull/3134" target="_blank" rel="noopener noreferrer" class="">#3134</a></p>
<p>Usar <code>Map</code> en lugar de objetos planos para almacenar entidades ofrece búsquedas <strong>hasta 32% más rápidas</strong> con conjuntos de datos grandes. <a href="https://github.com/reactive/data-client/pull/3390" target="_blank" rel="noopener noreferrer" class="">#3390</a></p>
<center><div style="max-width:500px"></div><p><a href="https://reactive.github.io/data-client/dev/bench/" target="_blank" rel="noopener noreferrer" class="">Benchmarks a lo largo del tiempo</a> | <a href="https://github.com/reactive/data-client/tree/master/examples/benchmark" target="_blank" rel="noopener noreferrer" class="">Ver benchmark</a></p></center>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="schemadata-modeling">Schema/Modelado de datos<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#schemadata-modeling" class="hash-link" aria-label="Enlace directo al Schema/Modelado de datos" title="Enlace directo al Schema/Modelado de datos" translate="no">​</a></h2>
<p>Las APIs de schema reducen el código repetitivo en los patrones comunes y a la vez permiten casos de uso más avanzados. Los joins del lado del cliente ahora funcionan entre entidades arbitrarias (no solo relaciones anidadas), la invalidación dinámica cubre la lógica de eliminación que solo conoce el servidor, y valores predeterminados sensatos como <code>Entity.pk()</code> usando <code>id</code> eliminan código repetitivo.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="query-joins">Joins con Query<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#query-joins" class="hash-link" aria-label="Enlace directo al Joins con Query" title="Enlace directo al Joins con Query" translate="no">​</a></h3>
<p><a class="" href="https://dataclient.io/es/rest/api/Query">Query</a> ahora puede recibir <a class="" href="https://dataclient.io/es/rest/api/Object">Object Schemas</a>, lo que permite joins entre varios tipos de entidad. <a href="https://github.com/reactive/data-client/pull/3165" target="_blank" rel="noopener noreferrer" class="">#3165</a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">Ticker </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  product_id <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  price <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">pk</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() { </span><span class="token keyword" style="font-style:italic">return this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>product_id<span class="token punctuation" style="color:rgb(199, 146, 234)">; }</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">Stats </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  product_id <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  last <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">pk</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() { </span><span class="token keyword" style="font-style:italic">return this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>product_id<span class="token punctuation" style="color:rgb(199, 146, 234)">; }</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Join Ticker and Stats by product_id</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> queryPrice <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">schema</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">Query</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> ticker<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Ticker<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> stats<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Stats <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> ticker<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> stats <span class="token punctuation" style="color:rgb(199, 146, 234)">}) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> ticker<span class="token operator" style="color:rgb(137, 221, 255)">?.</span>price <span class="token operator" style="color:rgb(137, 221, 255)">??</span> stats<span class="token operator" style="color:rgb(137, 221, 255)">?.</span>last<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Use in components</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> price <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useQuery</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>queryPrice<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> product_id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'BTC-USD' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="entitymixin">EntityMixin<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#entitymixin" class="hash-link" aria-label="Enlace directo al EntityMixin" title="Enlace directo al EntityMixin" translate="no">​</a></h3>
<p>Nuevo <a class="" href="https://dataclient.io/es/rest/api/EntityMixin">EntityMixin</a> para componer el comportamiento de Entity con clases existentes. <a href="https://github.com/reactive/data-client/pull/3243" target="_blank" rel="noopener noreferrer" class="">#3243</a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> EntityMixin <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Your existing class</span><br></div><div class="token-line"><span class="token class-name keyword" style="color:rgb(255, 203, 107);font-style:italic">export </span><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">Article </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  id <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  title <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  content <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  tags<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[] </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[];</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Add Entity behavior</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export class </span><span class="token class-name" style="color:rgb(255, 203, 107)">ArticleEntity </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">EntityMixin</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>Article<span class="token punctuation" style="color:rgb(199, 146, 234)">) {}</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="entity-pk-default">Valor predeterminado de Entity.pk()<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#entity-pk-default" class="hash-link" aria-label="Enlace directo al Valor predeterminado de Entity.pk()" title="Enlace directo al Valor predeterminado de Entity.pk()" translate="no">​</a></h3>
<p><a class="" href="https://dataclient.io/es/rest/api/Entity#pk">Entity.pk()</a> ahora devuelve <code>this.id</code> de forma predeterminada. <a href="https://github.com/reactive/data-client/pull/3188" target="_blank" rel="noopener noreferrer" class="">#3188</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">Todo </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  id <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  title <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  completed <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token boolean" style="color:rgb(255, 88, 116)">false</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">pk</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>id<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">Todo </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  id <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  title <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  completed <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token boolean" style="color:rgb(255, 88, 116)">false</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="dynamic-invalidation">Invalidación dinámica<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#dynamic-invalidation" class="hash-link" aria-label="Enlace directo al Invalidación dinámica" title="Enlace directo al Invalidación dinámica" translate="no">​</a></h3>
<p>Devuelve <code>undefined</code> desde <a class="" href="https://dataclient.io/es/rest/api/Entity#process">Entity.process()</a> para <a class="" href="https://dataclient.io/es/docs/concepts/expiry-policy#invalidate-entity">invalidar</a> entidades dinámicamente según los datos de la respuesta. <a href="https://github.com/reactive/data-client/pull/3407" target="_blank" rel="noopener noreferrer" class="">#3407</a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">PriceLevel </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  price <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  amount <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">pk</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() { </span><span class="token keyword" style="font-style:italic">return </span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">${</span><span class="token template-string interpolation keyword" style="font-style:italic">this</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span>price<span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token punctuation" style="color:rgb(199, 146, 234)">; }</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">static </span><span class="token function" style="color:rgb(130, 170, 255)">process</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>input<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token builtin" style="color:rgb(130, 170, 255)">number</span><span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token builtin" style="color:rgb(130, 170, 255)">number</span><span class="token punctuation" style="color:rgb(199, 146, 234)">],</span> parent<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> key<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string </span><span class="token operator" style="color:rgb(137, 221, 255)">| </span><span class="token keyword" style="font-style:italic">undefined</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">const </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span>price<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> amount<span class="token punctuation" style="color:rgb(199, 146, 234)">] </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> input<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">    <span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Invalidate when amount is 0</span><br></div><div class="token-line theme-code-block-highlighted-line">    <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>amount <span class="token operator" style="color:rgb(137, 221, 255)">=== </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token keyword" style="font-style:italic">return undefined</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> price<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> amount <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="resource">resource()<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#resource" class="hash-link" aria-label="Enlace directo al resource()" title="Enlace directo al resource()" translate="no">​</a></h3>
<p><code>createResource()</code> pasa a llamarse <code>resource()</code> por brevedad. <a href="https://github.com/reactive/data-client/pull/3158" target="_blank" rel="noopener noreferrer" class="">#3158</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> createResource <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> TodoResource <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">createResource</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/todos/:id'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Todo<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> resource <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> TodoResource <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">resource</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/todos/:id'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Todo<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div></div></div></div></figure>
<div class="theme-admonition theme-admonition-note admonition_WCGJ alert alert--secondary"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>nota</div><div class="admonitionContent_pbrs"><p><code>createResource</code> sigue exportándose por compatibilidad hacia atrás.</p></div></div>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="testing">Pruebas<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#testing" class="hash-link" aria-label="Enlace directo al Pruebas" title="Enlace directo al Pruebas" translate="no">​</a></h2>
<p>Probar debería ser simple. Los nuevos helpers usan valores predeterminados sensatos para eliminar el código repetitivo en los escenarios de prueba más comunes.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="renderdatahook">renderDataHook()<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#renderdatahook" class="hash-link" aria-label="Enlace directo al renderDataHook()" title="Enlace directo al renderDataHook()" translate="no">​</a></h3>
<p>El nuevo <a class="" href="https://dataclient.io/es/docs/api/renderDataHook">renderDataHook()</a> usa el <a class="" href="https://dataclient.io/es/docs/api/DataProvider">DataProvider</a> predeterminado, eliminando código repetitivo. <a href="https://github.com/reactive/data-client/pull/3238" target="_blank" rel="noopener noreferrer" class="">#3238</a></p>
<p>Además, <code>makeRenderDataClient()</code> pasa a llamarse <a class="" href="https://dataclient.io/es/docs/api/makeRenderDataHook">makeRenderDataHook()</a> por consistencia (el nombre anterior sigue funcionando).</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> renderDataHook <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/test'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> result <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">renderDataHook</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">() </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token function" style="color:rgb(130, 170, 255)">useSuspense</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>ArticleResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">5 </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}),</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    initialFixtures<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><br></div><div class="token-line">      <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">        endpoint<span class="token operator" style="color:rgb(137, 221, 255)">:</span> ArticleResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">        args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">5 </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}],</span><br></div><div class="token-line">        response<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> title<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'Test' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">      <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">],</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="garbage-collection">Recolección de basura<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#garbage-collection" class="hash-link" aria-label="Enlace directo al Recolección de basura" title="Enlace directo al Recolección de basura" translate="no">​</a></h2>
<p>Las aplicaciones de larga duración acumulan datos obsoletos en memoria. Las nuevas políticas de recolección de basura limpian automáticamente las entradas caducadas usando conteo de referencias para saber qué datos están activamente vinculados a componentes.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="gcpolicy">GCPolicy<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#gcpolicy" class="hash-link" aria-label="Enlace directo al GCPolicy" title="Enlace directo al GCPolicy" translate="no">​</a></h3>
<p>GCPolicy habilita la recolección de basura automática de datos obsoletos. <a href="https://github.com/reactive/data-client/pull/3343" target="_blank" rel="noopener noreferrer" class="">#3343</a></p>
<div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token imports punctuation" style="color:rgb(199, 146, 234)">{ </span>GCPolicy<span class="token imports punctuation" style="color:rgb(199, 146, 234)">, </span>DataProvider <span class="token imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Run GC sweep every 10 minutes</span><br></div><div class="token-line"><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">DataProvider gcPolicy</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(199, 146, 234)">={</span><span class="token tag script language-javascript keyword" style="color:rgb(255, 85, 114);font-style:italic">new </span><span class="token tag script language-javascript class-name" style="color:rgb(255, 203, 107)">GCPolicy</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">({</span><span class="token tag script language-javascript" style="color:rgb(255, 85, 114)"> intervalMS</span><span class="token tag script language-javascript operator" style="color:rgb(137, 221, 255)">: </span><span class="token tag script language-javascript number" style="color:rgb(247, 140, 108)">60 </span><span class="token tag script language-javascript operator" style="color:rgb(137, 221, 255)">* </span><span class="token tag script language-javascript number" style="color:rgb(247, 140, 108)">1000 </span><span class="token tag script language-javascript operator" style="color:rgb(137, 221, 255)">* </span><span class="token tag script language-javascript number" style="color:rgb(247, 140, 108)">10 </span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">})}&gt;</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span>children<span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;/</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">DataProvider</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div></code></pre></div></div>
<p>Configura el comportamiento de caducidad:</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">GCPolicy</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  intervalMS<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">60 </span><span class="token operator" style="color:rgb(137, 221, 255)">* </span><span class="token number" style="color:rgb(247, 140, 108)">1000 </span><span class="token operator" style="color:rgb(137, 221, 255)">* </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,  </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// How often to run GC</span><br></div><div class="token-line">  expiryMultiplier<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">2</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,        </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// How many stale lifetimes before GC</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">})</span><br></div></code></pre></div></div>
<p>Usa <code>ImmortalGCPolicy</code> para desactivar la recolección de basura (el comportamiento predeterminado anterior):</p>
<div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token imports punctuation" style="color:rgb(199, 146, 234)">{ </span>ImmortalGCPolicy<span class="token imports punctuation" style="color:rgb(199, 146, 234)">, </span>DataProvider <span class="token imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">DataProvider gcPolicy</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(199, 146, 234)">={</span><span class="token tag script language-javascript keyword" style="color:rgb(255, 85, 114);font-style:italic">new </span><span class="token tag script language-javascript class-name" style="color:rgb(255, 203, 107)">ImmortalGCPolicy</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">()}&gt;</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span>children<span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;/</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">DataProvider</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="other-improvements">Otras mejoras<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#other-improvements" class="hash-link" aria-label="Enlace directo al Otras mejoras" title="Enlace directo al Otras mejoras" translate="no">​</a></h2>
<ul>
<li class="">Las Collections funcionan con schemas polimórficos como Union <a href="https://github.com/reactive/data-client/pull/3151" target="_blank" rel="noopener noreferrer" class="">#3151</a></li>
<li class="">Las Collections funcionan con argumentos anidados (compatibilidad con la biblioteca qs) <a href="https://github.com/reactive/data-client/pull/3281" target="_blank" rel="noopener noreferrer" class="">#3281</a></li>
<li class="">Los interceptors funcionan con acciones despachadas por managers <a href="https://github.com/reactive/data-client/pull/3365" target="_blank" rel="noopener noreferrer" class="">#3365</a></li>
<li class="">Los mensajes de NetworkError incluyen la URL para facilitar la depuración</li>
<li class="">React Native: <code>InteractionManager.runAfterInteractions</code> para reducir la pérdida de frames <a href="https://github.com/reactive/data-client/pull/3127" target="_blank" rel="noopener noreferrer" class="">#3127</a></li>
<li class="">React Native: entrada <code>react-native</code> en los exports de package.json <a href="https://github.com/reactive/data-client/pull/3371" target="_blank" rel="noopener noreferrer" class="">#3371</a></li>
<li class="">Mejor compatibilidad con React 19 <a href="https://github.com/reactive/data-client/pull/3279" target="_blank" rel="noopener noreferrer" class="">#3279</a></li>
</ul>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="migration-guide">Guía de migración<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#migration-guide" class="hash-link" aria-label="Enlace directo al Guía de migración" title="Enlace directo al Guía de migración" translate="no">​</a></h2>
<!-- -->
<p>Esta actualización requiere actualizar todas las versiones de los paquetes al mismo tiempo.</p>
<div class="theme-tabs-container tabs-container tabList_J5MA"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_l0OV tabs__item--active">NPM</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">Yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">esm.sh</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_wHwb"><div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc"><span class="token function" style="color:rgb(130, 170, 255)">npm install </span><span class="token parameter variable" style="color:rgb(191, 199, 213)">--save</span> @data-client/react@^0.14.0 @data-client/rest@^0.14.0 @data-client/test@^0.14.0 @data-client/img@^0.14.0<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">yarn add @data-client/react@^0.14.0 @data-client/rest@^0.14.0 @data-client/test@^0.14.0 @data-client/img@^0.14.0<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">pnpm add @data-client/react@^0.14.0 @data-client/rest@^0.14.0 @data-client/test@^0.14.0 @data-client/img@^0.14.0<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-html language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">&lt;script type="importmap"&gt;<br></div><div class="token-line">{<br></div><div class="token-line">  "imports": {<br></div><div class="token-line">    "@data-client/react": "https://esm.sh/@data-client/react@^0.14.0",<br></div><div class="token-line">    "@data-client/rest": "https://esm.sh/@data-client/rest@^0.14.0",<br></div><div class="token-line">    "@data-client/test": "https://esm.sh/@data-client/test@^0.14.0",<br></div><div class="token-line">    "@data-client/img": "https://esm.sh/@data-client/img@^0.14.0"<br></div><div class="token-line">  }<br></div><div class="token-line">}<br></div><div class="token-line">&lt;/script&gt;<br></div></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="for-all-users">Para todos los usuarios<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#for-all-users" class="hash-link" aria-label="Enlace directo al Para todos los usuarios" title="Enlace directo al Para todos los usuarios" translate="no">​</a></h3>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="networkmanager">NetworkManager obtiene los datos de inmediato<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#networkmanager" class="hash-link" aria-label="Enlace directo al NetworkManager obtiene los datos de inmediato" title="Enlace directo al NetworkManager obtiene los datos de inmediato" translate="no">​</a></h4>
<p><a class="" href="https://dataclient.io/es/docs/api/NetworkManager">NetworkManager</a> ahora obtiene los datos de inmediato en lugar de esperar a la inactividad. Esto mejora el rendimiento con React 18+. <a href="https://github.com/reactive/data-client/pull/3146" target="_blank" rel="noopener noreferrer" class="">#3146</a></p>
<p>Para conservar el comportamiento anterior, usa <code>IdlingNetworkManager</code>:</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> IdlingNetworkManager<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> getDefaultManagers <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> managers <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">getDefaultManagers</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  networkManager<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">IdlingNetworkManager</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(),</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="custom-managers">Para autores de Managers personalizados<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#custom-managers" class="hash-link" aria-label="Enlace directo al Para autores de Managers personalizados" title="Enlace directo al Para autores de Managers personalizados" translate="no">​</a></h3>
<p>Omite esta sección si no tienes <a class="" href="https://dataclient.io/es/docs/concepts/managers">Managers</a> personalizados.</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="action-response">action.payload -&gt; action.response<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#action-response" class="hash-link" aria-label="Enlace directo al action.payload -> action.response" title="Enlace directo al action.payload -> action.response" translate="no">​</a></h4>
<p>Para <a class="" href="https://dataclient.io/es/docs/concepts/managers">Managers</a> personalizados que manejan <a class="" href="https://dataclient.io/es/docs/api/Actions#set_response">SET_RESPONSE</a>: <a href="https://github.com/reactive/data-client/pull/3141" target="_blank" rel="noopener noreferrer" class="">#3141</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token constant" style="color:rgb(130, 170, 255)">SET_RESPONSE_TYPE</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">type </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">type </span><span class="token class-name" style="color:rgb(255, 203, 107)">Middleware</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export default class </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyManager </span><span class="token keyword" style="font-style:italic">implements </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  getMiddleware <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">()</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span> Middleware <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> controller <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> next <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token keyword" style="font-style:italic">async</span> action <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">switch </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>type<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">case </span><span class="token constant" style="color:rgb(130, 170, 255)">SET_RESPONSE_TYPE</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><br></div><div class="token-line">        <span class="token builtin" style="color:rgb(130, 170, 255)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">'Resolved with value'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> action<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>payload<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">        <span class="token keyword" style="font-style:italic">return </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">default</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><br></div><div class="token-line">        <span class="token keyword" style="font-style:italic">return </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">cleanup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token constant" style="color:rgb(130, 170, 255)">SET_RESPONSE_TYPE</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">type </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">type </span><span class="token class-name" style="color:rgb(255, 203, 107)">Middleware</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export default class </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyManager </span><span class="token keyword" style="font-style:italic">implements </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  getMiddleware <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">()</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span> Middleware <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> controller <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> next <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token keyword" style="font-style:italic">async</span> action <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">switch </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>type<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">case </span><span class="token constant" style="color:rgb(130, 170, 255)">SET_RESPONSE_TYPE</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><br></div><div class="token-line">        <span class="token builtin" style="color:rgb(130, 170, 255)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">'Resolved with value'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> action<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>response<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">        <span class="token keyword" style="font-style:italic">return </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">default</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><br></div><div class="token-line">        <span class="token keyword" style="font-style:italic">return </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">cleanup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="fetch-payload">fetchAction.payload eliminado<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#fetch-payload" class="hash-link" aria-label="Enlace directo al fetchAction.payload eliminado" title="Enlace directo al fetchAction.payload eliminado" translate="no">​</a></h4>
<p>Para <a class="" href="https://dataclient.io/es/docs/concepts/managers">Managers</a> personalizados que manejan <a class="" href="https://dataclient.io/es/docs/api/Actions#fetch">FETCH</a>: <a href="https://github.com/reactive/data-client/pull/3141" target="_blank" rel="noopener noreferrer" class="">#3141</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token constant" style="color:rgb(130, 170, 255)">FETCH_TYPE</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">type </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">type </span><span class="token class-name" style="color:rgb(255, 203, 107)">Middleware</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export default class </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyManager </span><span class="token keyword" style="font-style:italic">implements </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  getMiddleware <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">()</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span> Middleware <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> controller <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> next <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token keyword" style="font-style:italic">async</span> action <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">switch </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>type<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">case </span><span class="token constant" style="color:rgb(130, 170, 255)">FETCH_TYPE</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><br></div><div class="token-line">        <span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// consume fetch, and print the resolution</span><br></div><div class="token-line">        action<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">payload</span><span class="token punctuation" style="color:rgb(199, 146, 234)">().</span><span class="token function" style="color:rgb(130, 170, 255)">then</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>response <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token builtin" style="color:rgb(130, 170, 255)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>response<span class="token punctuation" style="color:rgb(199, 146, 234)">));</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">default</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><br></div><div class="token-line">        <span class="token keyword" style="font-style:italic">return </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">cleanup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token constant" style="color:rgb(130, 170, 255)">FETCH_TYPE</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">type </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">type </span><span class="token class-name" style="color:rgb(255, 203, 107)">Middleware</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export default class </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyManager </span><span class="token keyword" style="font-style:italic">implements </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  getMiddleware <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">()</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span> Middleware <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> controller <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> next <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token keyword" style="font-style:italic">async</span> action <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">switch </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>type<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">case </span><span class="token constant" style="color:rgb(130, 170, 255)">FETCH_TYPE</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><br></div><div class="token-line">        <span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// consume fetch, and print the resolution</span><br></div><div class="token-line">        action<br></div><div class="token-line">        <span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">endpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">...</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>args<span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></div><div class="token-line">          <span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">then</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>response <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token builtin" style="color:rgb(130, 170, 255)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>response<span class="token punctuation" style="color:rgb(199, 146, 234)">));</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">default</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><br></div><div class="token-line">        <span class="token keyword" style="font-style:italic">return </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">cleanup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="action-args">action.meta.args -&gt; action.args<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#action-args" class="hash-link" aria-label="Enlace directo al action.meta.args -> action.args" title="Enlace directo al action.meta.args -> action.args" translate="no">​</a></h4>
<p>Los argumentos de la acción se movieron de <code>meta</code> al nivel superior. <a href="https://github.com/reactive/data-client/pull/3143" target="_blank" rel="noopener noreferrer" class="">#3143</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> key <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> action<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>meta<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> key <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> action<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="custom-schemas">Para autores de Schemas personalizados<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#custom-schemas" class="hash-link" aria-label="Enlace directo al Para autores de Schemas personalizados" title="Enlace directo al Para autores de Schemas personalizados" translate="no">​</a></h3>
<p>Omite esta sección si no tienes schemas personalizados que implementen <code>normalize()</code> o <code>denormalize()</code>.</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="schema-interface">Cambios en la interfaz de Schema<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#schema-interface" class="hash-link" aria-label="Enlace directo al Cambios en la interfaz de Schema" title="Enlace directo al Cambios en la interfaz de Schema" translate="no">​</a></h4>
<p>Las interfaces <code>normalize()</code> y <code>denormalize()</code> han cambiado. <a href="https://github.com/reactive/data-client/pull/3134" target="_blank" rel="noopener noreferrer" class="">#3134</a></p>
<p>Esto aporta una mejora de rendimiento del 10% para todos los usuarios.</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="schemanormalize-visit">visit() de Schema.normalize<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#schemanormalize-visit" class="hash-link" aria-label="Enlace directo al visit() de Schema.normalize" title="Enlace directo al visit() de Schema.normalize" translate="no">​</a></h4>
<p>La interfaz <code>visit()</code> ahora elimina los argumentos que no dependen del contexto:</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token doc-comment comment" style="color:rgb(105, 112, 152);font-style:italic">/** Visits next data + schema while recurisvely normalizing */</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export interface </span><span class="token class-name" style="color:rgb(255, 203, 107)">Visit </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>schema<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> value<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> parent<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> key<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">readonly </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[])</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  creating<span class="token operator" style="color:rgb(137, 221, 255)">?: </span><span class="token builtin" style="color:rgb(130, 170, 255)">boolean</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">processedEntity<span class="token punctuation" style="color:rgb(199, 146, 234)">[</span>key<span class="token punctuation" style="color:rgb(199, 146, 234)">] </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">visit</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  processedEntity<span class="token punctuation" style="color:rgb(199, 146, 234)">[</span>key<span class="token punctuation" style="color:rgb(199, 146, 234)">],</span><br></div><div class="token-line">  processedEntity<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  key<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">[</span>key<span class="token punctuation" style="color:rgb(199, 146, 234)">],</span><br></div><div class="token-line">  addEntity<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  visitedEntities<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  storeEntities<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">processedEntity<span class="token punctuation" style="color:rgb(199, 146, 234)">[</span>key<span class="token punctuation" style="color:rgb(199, 146, 234)">] </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">visit</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">[</span>key<span class="token punctuation" style="color:rgb(199, 146, 234)">],</span><br></div><div class="token-line">  processedEntity<span class="token punctuation" style="color:rgb(199, 146, 234)">[</span>key<span class="token punctuation" style="color:rgb(199, 146, 234)">],</span><br></div><div class="token-line">  processedEntity<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  key<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div></div></div></div></figure>
<p>La información que se necesitaba de esos argumentos se obtiene <a href="https://en.wikipedia.org/wiki/Closure_(computer_programming)" target="_blank" rel="noopener noreferrer" class="">encerrando</a> <code>visit()</code> sobre ellos en un closure.</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="schemanormalize-interface">Interfaz de Schema.normalize<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#schemanormalize-interface" class="hash-link" aria-label="Enlace directo al Interfaz de Schema.normalize" title="Enlace directo al Interfaz de Schema.normalize" translate="no">​</a></h4>
<p>Cambió del acceso directo a los datos al uso de funciones como <code>getEntity</code>:</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">interface </span><span class="token class-name" style="color:rgb(255, 203, 107)">SchemaSimple </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">normalize</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">    input<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    parent<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    key<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[],</span><br></div><div class="token-line">    <span class="token function-variable function" style="color:rgb(130, 170, 255)">visit</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">      schema<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      value<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      parent<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      key<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">readonly </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[],</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    <span class="token function-variable function" style="color:rgb(130, 170, 255)">addEntity</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">...</span>args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    <span class="token function-variable function" style="color:rgb(130, 170, 255)">getEntity</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">...</span>args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    <span class="token function-variable function" style="color:rgb(130, 170, 255)">checkLoop</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">...</span>args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div>
<p>También agregamos <code>checkLoop()</code>, que traslada parte de la lógica de <a class="" href="https://dataclient.io/es/rest/api/Entity">Entity</a>
al algoritmo central de normalización.</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token doc-comment comment" style="color:rgb(105, 112, 152);font-style:italic">/** Returns true if a circular reference is found */</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export interface </span><span class="token class-name" style="color:rgb(255, 203, 107)">CheckLoop </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>entityKey<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> pk<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> input<span class="token operator" style="color:rgb(137, 221, 255)">:</span> object<span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">boolean</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="schemadenormalize-unvisit">unvisit() de Schema.denormalize<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#schemadenormalize-unvisit" class="hash-link" aria-label="Enlace directo al unvisit() de Schema.denormalize" title="Enlace directo al unvisit() de Schema.denormalize" translate="no">​</a></h4>
<p>El argumento <code>unvisit</code> ahora recibe primero el argumento <a class="" href="https://dataclient.io/es/rest/api/schema">schema</a>:</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">interface </span><span class="token class-name" style="color:rgb(255, 203, 107)">SchemaSimple </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">denormalize</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">    input<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{},</span><br></div><div class="token-line">    args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">readonly </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[],</span><br></div><div class="token-line">    <span class="token function-variable function" style="color:rgb(130, 170, 255)">unvisit</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>schema<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> input<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token constant" style="color:rgb(130, 170, 255)">T</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="upgrade-support">Soporte para la actualización<a href="https://dataclient.io/es/blog/2024/07/13/v0.14-release-announcement#upgrade-support" class="hash-link" aria-label="Enlace directo al Soporte para la actualización" title="Enlace directo al Soporte para la actualización" translate="no">​</a></h3>
<p>Como siempre, si tienes algún problema o pregunta, no dudes en unirte a nuestro <a href="https://discord.gg/wXGV27xm6t" target="_blank" rel="noopener noreferrer" class=""><img decoding="async" loading="lazy" src="https://img.shields.io/discord/768254430381735967.svg?style=flat-square&amp;colorB=758ED3" alt="Chat" class="img_SS3x"></a> o <a href="https://github.com/reactive/data-client/issues/new/choose" target="_blank" rel="noopener noreferrer" class="">reportar un error</a></p>]]></content>
        <author>
            <name>Nathaniel Tucker</name>
            <uri>https://github.com/ntucker</uri>
        </author>
        <category label="Versiones" term="Versiones"/>
        <category label="Managers" term="Managers"/>
        <category label="Rendimiento" term="Rendimiento"/>
        <category label="Validación" term="Validación"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[v0.13: NextJS App Router, Expo, React 19, Redux]]></title>
        <id>https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native</id>
        <link href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native"/>
        <updated>2024-06-17T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Soporte para NextJS App Router y React 19, con mejoras de compatibilidad con React Native y Expo]]></summary>
        <content type="html"><![CDATA[<p>Plataformas:</p>
<ul>
<li class=""><a href="https://nextjs.org/docs/app" target="_blank" rel="noopener noreferrer" class="">NextJS App Router</a></li>
<li class=""><a href="https://expo.dev/" target="_blank" rel="noopener noreferrer" class="">Expo</a></li>
<li class=""><a href="https://react.dev/blog/2024/12/05/react-19" target="_blank" rel="noopener noreferrer" class="">React 19</a></li>
</ul>
<p><strong>Pruebas:</strong></p>
<ul>
<li class=""><a class="" href="https://dataclient.io/es/docs/api/MockResolver">MockResolver</a> marcado como código 'client' para NextJS App Router</li>
<li class="">Se exporta <a class="" href="https://dataclient.io/es/docs/api/renderDataHook">renderDataHook()</a> - compatible con React 17 y 18</li>
</ul>
<p>Paquetes movidos dentro de <a href="https://www.npmjs.com/package/@data-client/react" target="_blank" rel="noopener noreferrer" class="">@data-client/react</a>:</p>
<ul>
<li class="">Redux</li>
<li class="">Hooks</li>
</ul>
<p><strong>Otras mejoras</strong></p>
<ul>
<li class="">Se agregó <a href="https://0.18.dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#controllerset" target="_self" class="">controller.set(Todo, { id }, { id, completed: false })</a></li>
<li class="">RestEndpoint.path <a href="https://0.18.dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#path-strings" target="_self" class="">admite +, * y {}</a></li>
<li class="">Se corrigió el <a href="https://0.18.dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#ctrlfetch-and-unions" target="_self" class="">valor de retorno de controller.fetch() para Unions</a></li>
</ul>
<p><a href="https://0.18.dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#migration-guide" target="_self" class=""><strong>Cambios incompatibles:</strong></a></p>
<ul>
<li class="">actionTypes.SET_TYPE -&gt; <a href="https://dataclient.io/docs/api/Actions#set_response" target="_blank" rel="noopener noreferrer" class="">actionTypes.SET_RESPONSE_TYPE</a></li>
<li class="">SetAction -&gt; SetResponseAction</li>
<li class="">Versión mínima de React 16.8.4 -&gt; 16.14</li>
</ul>
<div class="theme-admonition theme-admonition-note admonition_WCGJ alert alert--secondary"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>nota</div><div class="admonitionContent_pbrs"><p>La versión 0.12 se omitió debido a un percance en la publicación.</p></div></div>
<!-- -->
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="platforms">Plataformas<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#platforms" class="hash-link" aria-label="Enlace directo al Plataformas" title="Enlace directo al Plataformas" translate="no">​</a></h2>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="nextjs-app-router">NextJS App Router<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#nextjs-app-router" class="hash-link" aria-label="Enlace directo al NextJS App Router" title="Enlace directo al NextJS App Router" translate="no">​</a></h3>
<p>NextJS 12 incluye una <a href="https://nextjs.org/docs/app" target="_blank" rel="noopener noreferrer" class="">nueva forma de enrutamiento en el directorio '/app'</a>. Esto permite más mejoras de rendimiento, así como enrutamiento dinámico y anidado. Esto convierte a NextJS en una plataforma viable para construir aplicaciones dinámicas ricas, en lugar
de solo sitios web estáticos.</p>
<p>Mientras que <a href="https://nextjs.org/docs/app/building-your-application/data-fetching/fetching#fetching-data-on-the-client" target="_blank" rel="noopener noreferrer" class="">otros métodos de obtención de datos</a>
requieren una lenta obtención del lado del cliente, Reactive Data Client ofrece lo mejor de las <abbr title="Aplicación de una sola página">SPA</abbr> y de las
<abbr title="Aplicación de múltiples páginas">MPA</abbr>. <a href="https://github.com/reactive/data-client/pull/3074" target="_blank" rel="noopener noreferrer" class="">#3074</a>, <a href="https://github.com/reactive/data-client/pull/3093" target="_blank" rel="noopener noreferrer" class="">#3093</a></p>
<p>Como las MPA, el SSR con Data Client significa la <em>carga inicial de página</em> más rápida posible. Como las SPA, Data Client ofrece una
<em>navegación</em>, unas <em>mutaciones del lado del cliente</em> y unas <em>mutaciones impulsadas desde el servidor</em> (como websockets) más rápidas que las MPA.</p>
<p>Además, Data Client con SSR sigue ofreciendo las ventajas de rendimiento frente a otras bibliotecas de obtención de datos
del lado del cliente.</p>
<figure class="perfChart_LYCy"><figcaption class="text--center text--bold margin-bottom--sm">Rendimiento vs obtención en el cliente<div class="text--normal"><small>Bar lengths use a log scale</small></div></figcaption><div class="bars_HVEW" style="--perf-one:0%"><div class="row_OlYf" aria-hidden="true"><span></span><span class="oneLabel_y_xM">1x</span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">LCP</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:17.1591950743891%;--perf-split:0%"></span></span><span class="text--bold">3x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">Client fetch<!-- --> <!-- -->1200<!-- --> <!-- -->ms<!-- --> → <!-- -->Data Client<!-- --> <strong>400<!-- --> <!-- -->ms</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">Mutation</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:100%;--perf-split:0%"></span></span><span class="text--bold">603x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">Client fetch<!-- --> <!-- -->1810<!-- --> <!-- -->ms<!-- --> → <!-- -->Data Client<!-- --> <strong>3<!-- --> <!-- -->ms</strong></span></span></div><div class="anchor_tRSI row_OlYf" tabindex="0"><span class="label_dFrN">List to detail navigation</span><span class="track_Wj4m" aria-hidden="true"><span class="bar_eNox" style="width:29.79992018679698%;--perf-split:0%"></span></span><span class="text--bold">6.7x</span><span class="tip_L8pU tip_kDq8"><span class="bubble_XBbb">Client fetch<!-- --> <!-- -->310<!-- --> <!-- -->ms<!-- --> → <!-- -->Data Client<!-- --> <strong>46<!-- --> <!-- -->ms</strong></span></span></div></div></figure>
<center><video width="600" controls="" muted="" playsinline="" loop="" aria-label="Una app de tareas en NextJS cargando en una ventana de incógnito nueva: la lista de usuarios y las tareas renderizadas en el servidor son interactivas de inmediato, se marcan y agregan tareas, y al cambiar de usuario se actualiza la lista, todo sin obtenciones de datos del lado del cliente."><source src="/es/videos/blog/data-client-nextjs.mp4" type="video/mp4">Una app de tareas en NextJS cargando en una ventana de incógnito nueva: la lista de usuarios y las tareas renderizadas en el servidor son interactivas de inmediato, se marcan y agregan tareas, y al cambiar de usuario se actualiza la lista, todo sin obtenciones de datos del lado del cliente.</video></center>
<p><abbr title="Reactive Data Client">Data Client</abbr> realiza SSR en streaming del HTML, agilizando la experiencia de carga inicial
de la aplicación. De forma única, <abbr title="Reactive Data Client">Data Client</abbr> queda entonces interactivo de inmediato
con 0 obtenciones de datos del lado del cliente. Esto se logra inicializando el <a class="" href="https://dataclient.io/es/docs/getting-started/debugging#state-inspection">Store del cliente</a>
con <a class="" href="https://dataclient.io/es/docs/concepts/normalization">datos normalizados</a> durante la fase de SSR.</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="usage">Uso<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#usage" class="hash-link" aria-label="Enlace directo al Uso" title="Enlace directo al Uso" translate="no">​</a></h4>
<p>Renderiza <a class="" href="https://dataclient.io/es/docs/api/DataProvider">DataProvider</a> desde el <a href="https://dataclient.io/docs/guides/ssr#app-router" target="_blank" rel="noopener noreferrer" class="">punto de entrada /nextjs</a> en tu <a href="https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts#root-layout-required" target="_blank" rel="noopener noreferrer" class="">layout raíz</a>.</p>
<div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">app/layout.tsx</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token imports punctuation" style="color:rgb(199, 146, 234)">{ </span>DataProvider <span class="token imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react/nextjs'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token imports punctuation" style="color:rgb(199, 146, 234)">{ </span>AsyncBoundary <span class="token imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export default function </span><span class="token function" style="color:rgb(130, 170, 255)">RootLayout</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> children <span class="token punctuation" style="color:rgb(199, 146, 234)">}) {</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">return </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">    <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag" style="color:rgb(255, 85, 114)">html</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line">      <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag" style="color:rgb(255, 85, 114)">body</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line theme-code-block-highlighted-line">        <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">DataProvider</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line">          <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag" style="color:rgb(255, 85, 114)">header</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span>Title<span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;/</span><span class="token tag" style="color:rgb(255, 85, 114)">header</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line">          <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">AsyncBoundary</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;{</span>children<span class="token punctuation" style="color:rgb(199, 146, 234)">}&lt;/</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">AsyncBoundary</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line">          <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag" style="color:rgb(255, 85, 114)">footer</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;&lt;/</span><span class="token tag" style="color:rgb(255, 85, 114)">footer</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line theme-code-block-highlighted-line">        <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;/</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">DataProvider</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line">      <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;/</span><span class="token tag" style="color:rgb(255, 85, 114)">body</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line">    <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;/</span><span class="token tag" style="color:rgb(255, 85, 114)">html</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div>
<div style="text-align:center"><a class="button button--primary" href="https://dataclient.io/es/docs/guides/ssr#nextjs">Guía completa de NextJS</a></div>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="mutations-demo">Demo de mutaciones<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#mutations-demo" class="hash-link" aria-label="Enlace directo al Demo de mutaciones" title="Enlace directo al Demo de mutaciones" translate="no">​</a></h4>
<div class="card_wNtI"><p class="cardTitle_q8VY">Explora el ejemplo nextjs</p><div class="cardLinks_EoYh"><a href="https://stackblitz.com/github/reactive/data-client/tree/master/examples/nextjs?file=components%2Ftodo%2FTodoList.tsx%2Capp%2Flayout.tsx" target="_blank" rel="noopener noreferrer" class="button button--primary">Abrir en StackBlitz</a><a href="https://github.com/reactive/data-client/tree/master/examples/nextjs" target="_blank" rel="noopener noreferrer" class="button button--secondary">Ver código fuente</a></div></div><div class="wrapper_ZhQy"><span class="loading_rblT" aria-hidden="true">Cargando la demo…</span><iframe width="100%" height="500" title="Demo de nextjs en StackBlitz" class="frame_PtfY"></iframe></div><p style="text-align:center"><a class="button button--secondary button--sm" href="https://dataclient.io/es/demos">Más demos</a></p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="live-data-demo">Demo de datos en vivo<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#live-data-demo" class="hash-link" aria-label="Enlace directo al Demo de datos en vivo" title="Enlace directo al Demo de datos en vivo" translate="no">​</a></h4>
<div><iframe src="https://coin-app-lake.vercel.app" width="100%" height="400"></iframe><p style="text-align:center"><a href="https://coin-app-lake.vercel.app/" target="_blank" rel="noopener noreferrer" class="button button--secondary button--sm">Abrir en una pestaña nueva</a>&nbsp;<a href="https://github.com/reactive/coin-app" target="_blank" rel="noopener noreferrer" class="button button--secondary button--sm">Github</a></p></div>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="other-ssr">Otros SSR<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#other-ssr" class="hash-link" aria-label="Enlace directo al Otros SSR" title="Enlace directo al Otros SSR" translate="no">​</a></h4>
<p>Se agrega el <a class="" href="https://dataclient.io/es/docs/guides/ssr#express-js-ssr">punto de entrada /ssr</a>, eliminando por completo la necesidad del paquete @data-client/ssr <a href="https://github.com/reactive/data-client/commit/d1b9e96dffe69527f9ce0ebff4727f0b1226c9d5" target="_blank" rel="noopener noreferrer" class=""><code>d1b9e96</code></a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token imports punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  createPersistedStore<span class="token imports punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  createServerDataComponent<span class="token imports punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/ssr'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div></code></pre></div></div><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token imports punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  createPersistedStore<span class="token imports punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  createServerDataComponent<span class="token imports punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react/ssr'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div></code></pre></div></div></div></div></div></figure>
<p>Esto hace posible integrar fácilmente Data Client en cualquier framework de SSR.
Agradecemos las <a href="https://github.com/reactive/data-client/blob/master/CONTRIBUTING.md" target="_blank" rel="noopener noreferrer" class="">contribuciones</a> para la integración
con cualquier framework de código abierto.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="expo">Expo<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#expo" class="hash-link" aria-label="Enlace directo al Expo" title="Enlace directo al Expo" translate="no">​</a></h3>
<p>Hemos comenzado a trabajar en demos de Expo/ExpoGo y, gracias a ello, encontramos y corregimos algunos problemas de compatibilidad
con estas integraciones. Por favor, <a href="https://github.com/reactive/data-client/issues/new/choose" target="_blank" rel="noopener noreferrer" class="">reporta cualquier problema</a>
que se nos haya podido escapar.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="react-19">React 19<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#react-19" class="hash-link" aria-label="Enlace directo al React 19" title="Enlace directo al React 19" translate="no">​</a></h3>
<p>Ahora admitimos React 19. <a href="https://github.com/reactive/data-client/pull/3071" target="_blank" rel="noopener noreferrer" class="">#3071</a></p>
<p>Esto requirió abandonar el soporte para versiones anteriores a 16.14, ya que debemos usar el runtime de jsx
exportado por el propio React. Esto tiene el beneficio adicional de reducir el tamaño del bundle.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="redux">Redux<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#redux" class="hash-link" aria-label="Enlace directo al Redux" title="Enlace directo al Redux" translate="no">​</a></h3>
<p>Se agrega <a class="" href="https://dataclient.io/es/docs/guides/redux">@data-client/react/redux</a> <a href="https://github.com/reactive/data-client/pull/3099" target="_blank" rel="noopener noreferrer" class="">#3099</a>.
Esto elimina la necesidad del paquete separado @data-client/redux.</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token imports punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  ExternalDataProvider<span class="token imports punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  PromiseifyMiddleware<span class="token imports punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  applyManager<span class="token imports punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  initialState<span class="token imports punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  createReducer<span class="token imports punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  prepareStore<span class="token imports punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/redux'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div></code></pre></div></div><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token imports punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  ExternalDataProvider<span class="token imports punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  PromiseifyMiddleware<span class="token imports punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  applyManager<span class="token imports punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  initialState<span class="token imports punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  createReducer<span class="token imports punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  prepareStore<span class="token imports punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react/redux'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div></code></pre></div></div></div></div></div></figure>
<p>Se agrega el argumento middlewares a prepareStore() <a href="https://github.com/reactive/data-client/pull/3099" target="_blank" rel="noopener noreferrer" class="">#3099</a></p>
<div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> store<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> selector<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> controller <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">prepareStore</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  initialState<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  managers<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  Controller<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  otherReducers<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line theme-code-block-highlighted-line">  extraMiddlewares<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="controllerset">controller.set()<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#controllerset" class="hash-link" aria-label="Enlace directo al controller.set()" title="Enlace directo al controller.set()" translate="no">​</a></h2>
<p><a class="" href="https://dataclient.io/es/docs/api/Controller#set">controller.set()</a> actualiza cualquier <a class="" href="https://dataclient.io/es/rest/api/schema#schema-overview">Schema</a> <a class="" href="https://dataclient.io/es/rest/api/schema#queryable">Queryable</a>. <a href="https://github.com/reactive/data-client/pull/3105" target="_blank" rel="noopener noreferrer" class="">#3105</a>, <a href="https://github.com/reactive/data-client/pull/3129" target="_blank" rel="noopener noreferrer" class="">#3129</a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">set</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  Todo<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'5' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'5'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> title<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'tell me friends how great Data Client is' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div>
<p>Se pueden usar funciones como valor cuando se trabaja con datos derivados. Esto <a href="https://react.dev/reference/react/useState#updating-state-based-on-the-previous-state" target="_blank" rel="noopener noreferrer" class="">evita condiciones de carrera</a>.</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> id <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">'2'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">set</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>Article<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span> article <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> id<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> votes<span class="token operator" style="color:rgb(137, 221, 255)">:</span> article<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>votes <span class="token operator" style="color:rgb(137, 221, 255)">+ </span><span class="token number" style="color:rgb(247, 140, 108)">1 </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}));</span><br></div></code></pre></div></div>
<div class="theme-admonition theme-admonition-note admonition_WCGJ alert alert--secondary"><div class="admonitionHeading_GCBg"><span class="admonitionIcon_L39b"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>nota</div><div class="admonitionContent_pbrs"><p>La respuesta debe incluir valores suficientes para calcular Entity.pk()</p></div></div>
<p>Esto hace más directo manipular el store con <a class="" href="https://dataclient.io/es/docs/concepts/managers">Managers</a>.
Por ejemplo, podemos establecer directamente nuestra entidad <code>Ticker</code> al recibir mensajes de websocket:</p>
<!-- -->
<div class="card_wNtI"><p class="cardTitle_q8VY">Explora el ejemplo coin-app</p><div class="cardLinks_EoYh"><a href="https://stackblitz.com/github/reactive/data-client/tree/master/examples/coin-app?file=src%2FgetManagers.ts%2Csrc%2Fresources%2FTicker.ts%2Csrc%2Fpages%2FAssetDetail%2FAssetPrice.tsx%2Csrc%2Fresources%2FStreamManager.ts" target="_blank" rel="noopener noreferrer" class="button button--primary">Abrir en StackBlitz</a><a href="https://github.com/reactive/data-client/tree/master/examples/coin-app" target="_blank" rel="noopener noreferrer" class="button button--secondary">Ver código fuente</a></div></div><div class="wrapper_ZhQy"><span class="loading_rblT" aria-hidden="true">Cargando la demo…</span><iframe width="100%" height="600" title="Demo de coin-app en StackBlitz" class="frame_PtfY"></iframe></div><p style="text-align:center"><a class="button button--secondary button--sm" href="https://dataclient.io/es/demos">Más demos</a></p>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="type-improvements">Mejoras de tipos<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#type-improvements" class="hash-link" aria-label="Enlace directo al Mejoras de tipos" title="Enlace directo al Mejoras de tipos" translate="no">​</a></h2>
<ul>
<li class="">
<p>Se mejora la coincidencia de tipos del <a class="" href="https://dataclient.io/es/docs/api/Controller">controller</a> para sus métodos <a href="https://github.com/reactive/data-client/pull/3043" target="_blank" rel="noopener noreferrer" class="">#3043</a></p>
</li>
<li class="">
<p>Se mejora la coincidencia de tipos de los argumentos de <a class="" href="https://dataclient.io/es/docs/api/useFetch">useFetch()</a>, de forma similar a <a class="" href="https://dataclient.io/es/docs/api/useSuspense">useSuspense()</a> <a href="https://github.com/reactive/data-client/pull/3043" target="_blank" rel="noopener noreferrer" class="">#3043</a></p>
</li>
</ul>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="rest-changes">Cambios en REST<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#rest-changes" class="hash-link" aria-label="Enlace directo al Cambios en REST" title="Enlace directo al Cambios en REST" translate="no">​</a></h2>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="path-strings">Cadenas de path<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#path-strings" class="hash-link" aria-label="Enlace directo al Cadenas de path" title="Enlace directo al Cadenas de path" translate="no">​</a></h3>
<p>Se admiten + y * y {} en <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#path">RestEndpoint.path</a>. <a href="https://github.com/reactive/data-client/commit/a6b4f4aabbfd06f5106a96e809a6c1a5e7045172" target="_blank" rel="noopener noreferrer" class=""><code>a6b4f4a</code></a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> getThing <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/:attr1?{-:attr2}?{-:attr3}?'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">getThing</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> attr1<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'hi' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">getThing</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> attr2<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'hi' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">getThing</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> attr3<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'hi' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">getThing</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> attr1<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'hi'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> attr3<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'ho' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">getThing</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> attr2<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'hi'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> attr3<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'ho' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="ctrlfetch-and-unions">ctrl.fetch() y Unions<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#ctrlfetch-and-unions" class="hash-link" aria-label="Enlace directo al ctrl.fetch() y Unions" title="Enlace directo al ctrl.fetch() y Unions" translate="no">​</a></h3>
<p>Los valores de <a class="" href="https://dataclient.io/es/rest/api/Union">Unions</a> en el valor de retorno de <a class="" href="https://dataclient.io/es/docs/api/Controller#fetch">ctrl.fetch()</a> ahora son una instancia de su clase Entity. <a href="https://github.com/reactive/data-client/pull/3063" target="_blank" rel="noopener noreferrer" class="">#3063</a></p>
<div class="playgroundQueryContainer_vBqa"><div class="playgroundContainer_sLUA standaloneEditor_OHub row_YGZs"><div class="playgroundTextEdit_rt2K"><div class="playgroundHeader_Zx4K noupper_WDCF tabControls_trxh small_xksL"><div class="tabs_m54V" role="tablist" aria-orientation="horizontal" aria-label="Archivos"><div role="tab" aria-selected="false" tabindex="-1" class="tab_bTGw">Feed</div><div role="tab" aria-selected="true" tabindex="0" class="tab_bTGw selected_QXZk">useFeed</div></div></div><div class="editorDocs_INVk"><div class="playgroundEditor_lYwu hidden_Hh8i"></div><div class="playgroundEditor_lYwu"><div><pre class="prism-code language-ts" style="margin:0;outline:none;padding:10px;font-family:inherit;color:#bfc7d5;background-color:transparent" spellcheck="false"><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token punctuation" style="color:#c792ea">{ </span>getFeed <span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'./Feed'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">
</span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">function </span>useFeedHandler<span class="token punctuation" style="color:#c792ea">() {
</span></span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">const </span>ctrl <span class="token punctuation" style="color:#c792ea">= </span>useController<span class="token punctuation" style="color:#c792ea">();
</span></span><span class="token-line">
</span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">const </span>handleSomething <span class="token punctuation" style="color:#c792ea">= </span><span class="token keyword" style="color:#7da4f6;font-style:italic">async </span><span class="token punctuation" style="color:#c792ea">() =&gt; {
</span></span><span class="token-line">    <span class="token keyword" style="color:#7da4f6;font-style:italic">const </span>feed <span class="token punctuation" style="color:#c792ea">= </span><span class="token keyword" style="color:#7da4f6;font-style:italic">await </span>ctrl<span class="token punctuation" style="color:#c792ea">.</span>fetch<span class="token punctuation" style="color:#c792ea">(</span>getFeed<span class="token punctuation" style="color:#c792ea">);
</span></span><span class="token-line">    <span class="token keyword" style="color:#7da4f6;font-style:italic">return </span>feed<span class="token punctuation" style="color:#c792ea">.</span>map<span class="token punctuation" style="color:#c792ea">(</span>item <span class="token punctuation" style="color:#c792ea">=&gt; {
</span></span><span class="token-line">      <span class="token keyword" style="color:#7da4f6;font-style:italic">if </span><span class="token punctuation" style="color:#c792ea">(</span>item<span class="token punctuation" style="color:#c792ea">.</span><span class="token keyword" style="color:#7da4f6;font-style:italic">type </span><span class="token punctuation" style="color:#c792ea">== </span><span class="token string" style="color:#b6d986">'link'</span><span class="token punctuation" style="color:#c792ea">) {
</span></span><span class="token-line">        <span class="token comment" style="color:#697098;font-style:italic">// we can use class defined getter
</span></span><span class="token-line">        <span class="token keyword" style="color:#7da4f6;font-style:italic">return </span>item<span class="token punctuation" style="color:#c792ea">.</span>anchor<span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">      <span class="token punctuation" style="color:#c792ea">}
</span></span><span class="token-line">    <span class="token punctuation" style="color:#c792ea">});
</span></span><span class="token-line">  <span class="token punctuation" style="color:#c792ea">}
</span></span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">return </span>handleSomething<span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">}
</span></span></pre></div></div></div></div></div></div>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="migration-guide">Guía de migración<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#migration-guide" class="hash-link" aria-label="Enlace directo al Guía de migración" title="Enlace directo al Guía de migración" translate="no">​</a></h2>
<!-- -->
<p>Esta actualización requiere actualizar todas las versiones de los paquetes simultáneamente.</p>
<div class="theme-tabs-container tabs-container tabList_J5MA"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_l0OV tabs__item--active">NPM</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">Yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">esm.sh</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_wHwb"><div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc"><span class="token function" style="color:rgb(130, 170, 255)">npm install </span><span class="token parameter variable" style="color:rgb(191, 199, 213)">--save</span> @data-client/react@^0.13.0 @data-client/rest@^0.13.0 @data-client/test@^0.13.0 @data-client/img@^0.13.0<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">yarn add @data-client/react@^0.13.0 @data-client/rest@^0.13.0 @data-client/test@^0.13.0 @data-client/img@^0.13.0<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">pnpm add @data-client/react@^0.13.0 @data-client/rest@^0.13.0 @data-client/test@^0.13.0 @data-client/img@^0.13.0<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-html language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">&lt;script type="importmap"&gt;<br></div><div class="token-line">{<br></div><div class="token-line">  "imports": {<br></div><div class="token-line">    "@data-client/react": "https://esm.sh/@data-client/react@^0.13.0",<br></div><div class="token-line">    "@data-client/rest": "https://esm.sh/@data-client/rest@^0.13.0",<br></div><div class="token-line">    "@data-client/test": "https://esm.sh/@data-client/test@^0.13.0",<br></div><div class="token-line">    "@data-client/img": "https://esm.sh/@data-client/img@^0.13.0"<br></div><div class="token-line">  }<br></div><div class="token-line">}<br></div><div class="token-line">&lt;/script&gt;<br></div></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="set_response_type">actionTypes.SET_TYPE -&gt; actionTypes.SET_RESPONSE_TYPE<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#set_response_type" class="hash-link" aria-label="Enlace directo al actionTypes.SET_TYPE -> actionTypes.SET_RESPONSE_TYPE" title="Enlace directo al actionTypes.SET_TYPE -> actionTypes.SET_RESPONSE_TYPE" translate="no">​</a></h3>
<p>Si escribiste un Manager personalizado que manejaba <code>actionTypes.SET_TYPE</code>, tendrás que
renombrarlo a <a class="" href="https://dataclient.io/es/docs/api/Actions#set_response">actionTypes.SET_RESPONSE_TYPE</a>.</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import type </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{ </span>Manager<span class="token punctuation" style="color:rgb(199, 146, 234)">, </span>Middleware <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token imports punctuation" style="color:rgb(199, 146, 234)">{</span> actionTypes <span class="token imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export default class </span><span class="token class-name" style="color:rgb(255, 203, 107)">LoggingManager </span><span class="token keyword" style="font-style:italic">implements </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  middleware<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token function-variable function" style="color:rgb(130, 170, 255)">Middleware </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> controller <span class="token arrow operator" style="color:rgb(137, 221, 255)">=&gt;</span> next <span class="token arrow operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token keyword" style="font-style:italic">async</span> action <span class="token arrow operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">switch </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>type<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">case</span> actionTypes<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token constant" style="color:rgb(130, 170, 255)">SET_TYPE</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><br></div><div class="token-line">        <span class="token console class-name" style="color:rgb(255, 203, 107)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">info</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">          <span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">${</span>action<span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span>endpoint<span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span>name<span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">} ${</span><span class="token template-string interpolation constant" style="color:rgb(130, 170, 255)">JSON</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token template-string interpolation function" style="color:rgb(130, 170, 255)">stringify</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span>response<span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">)}</span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">        <span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">        <span class="token keyword" style="font-style:italic">return </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">      <span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// actions must be explicitly passed to next middleware</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">default</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><br></div><div class="token-line">        <span class="token keyword" style="font-style:italic">return </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">cleanup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import type </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{ </span>Manager<span class="token punctuation" style="color:rgb(199, 146, 234)">, </span>Middleware <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token imports punctuation" style="color:rgb(199, 146, 234)">{</span> actionTypes <span class="token imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export default class </span><span class="token class-name" style="color:rgb(255, 203, 107)">LoggingManager </span><span class="token keyword" style="font-style:italic">implements </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  middleware<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token function-variable function" style="color:rgb(130, 170, 255)">Middleware </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> controller <span class="token arrow operator" style="color:rgb(137, 221, 255)">=&gt;</span> next <span class="token arrow operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token keyword" style="font-style:italic">async</span> action <span class="token arrow operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">switch </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>type<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">case</span> actionTypes<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token constant" style="color:rgb(130, 170, 255)">SET_RESPONSE_TYPE</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><br></div><div class="token-line">        <span class="token console class-name" style="color:rgb(255, 203, 107)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">info</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">          <span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">${</span>action<span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span>endpoint<span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span>name<span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">} ${</span><span class="token template-string interpolation constant" style="color:rgb(130, 170, 255)">JSON</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token template-string interpolation function" style="color:rgb(130, 170, 255)">stringify</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span>response<span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">)}</span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">        <span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">        <span class="token keyword" style="font-style:italic">return </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">      <span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// actions must be explicitly passed to next middleware</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">default</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><br></div><div class="token-line">        <span class="token keyword" style="font-style:italic">return </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">cleanup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="set-action">SetAction -&gt; SetResponseAction<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#set-action" class="hash-link" aria-label="Enlace directo al SetAction -> SetResponseAction" title="Enlace directo al SetAction -> SetResponseAction" translate="no">​</a></h3>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="react-version">React 16.14+<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#react-version" class="hash-link" aria-label="Enlace directo al React 16.14+" title="Enlace directo al React 16.14+" translate="no">​</a></h3>
<p>Cambia la versión mínima de React de 16.8.4 -&gt; 16.14. No se necesitan cambios en el código.</p>
<div class="theme-tabs-container tabs-container tabList_J5MA"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_l0OV tabs__item--active">NPM</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">Yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">esm.sh</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_wHwb"><div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc"><span class="token function" style="color:rgb(130, 170, 255)">npm install </span><span class="token parameter variable" style="color:rgb(191, 199, 213)">--save</span> react@16.14 react-dom@16.14<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">yarn add react@16.14 react-dom@16.14<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">pnpm add react@16.14 react-dom@16.14<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-html language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">&lt;script type="importmap"&gt;<br></div><div class="token-line">{<br></div><div class="token-line">  "imports": {<br></div><div class="token-line">    "react": "https://esm.sh/react@16.14",<br></div><div class="token-line">    "react-dom": "https://esm.sh/react-dom@16.14"<br></div><div class="token-line">  }<br></div><div class="token-line">}<br></div><div class="token-line">&lt;/script&gt;<br></div></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="data-provider">CacheProvider -&gt; DataProvider<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#data-provider" class="hash-link" aria-label="Enlace directo al CacheProvider -> DataProvider" title="Enlace directo al CacheProvider -> DataProvider" translate="no">​</a></h3>
<p>Pásate a <a class="" href="https://dataclient.io/es/docs/api/DataProvider">DataProvider</a> para mantener la compatibilidad con versiones futuras. También se
exporta como <code>CacheProvider</code>, así que no es un cambio incompatible. <a href="https://github.com/reactive/data-client/pull/3095" target="_blank" rel="noopener noreferrer" class="">#3095</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token imports punctuation" style="color:rgb(199, 146, 234)">{ </span>CacheProvider <span class="token imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">import </span>ReactDOM <span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'react-dom'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">ReactDOM<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">createRoot</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token dom variable" style="color:rgb(191, 199, 213)">document</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>body<span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">render</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">CacheProvider</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line">    <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">App </span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">/&gt;</span><br></div><div class="token-line">  <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;/</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">CacheProvider</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token imports punctuation" style="color:rgb(199, 146, 234)">{ </span>DataProvider <span class="token imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">import </span>ReactDOM <span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'react-dom'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">ReactDOM<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">createRoot</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token dom variable" style="color:rgb(191, 199, 213)">document</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>body<span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">render</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">DataProvider</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div><div class="token-line">    <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">App </span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">/&gt;</span><br></div><div class="token-line">  <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;/</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">DataProvider</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="upgrade-support">Soporte para la actualización<a href="https://dataclient.io/es/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#upgrade-support" class="hash-link" aria-label="Enlace directo al Soporte para la actualización" title="Enlace directo al Soporte para la actualización" translate="no">​</a></h3>
<p>Como siempre, si tienes algún problema o pregunta, no dudes en unirte a nuestro <a href="https://discord.gg/wXGV27xm6t" target="_blank" rel="noopener noreferrer" class=""><img decoding="async" loading="lazy" src="https://img.shields.io/discord/768254430381735967.svg?style=flat-square&amp;colorB=758ED3" alt="Chat" class="img_SS3x"></a> o <a href="https://github.com/reactive/data-client/issues/new/choose" target="_blank" rel="noopener noreferrer" class="">reportar un error</a></p>]]></content>
        <author>
            <name>Nathaniel Tucker</name>
            <uri>https://github.com/ntucker</uri>
        </author>
        <category label="Versiones" term="Versiones"/>
        <category label="NextJS" term="NextJS"/>
        <category label="Expo" term="Expo"/>
        <category label="React Native" term="React Native"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[v0.11 Queries, Queryable y useQuery]]></title>
        <id>https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery</id>
        <link href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery"/>
        <updated>2024-04-08T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[La 0.11 de Data Client trae un nuevo acceso directo y memoizado al store mediante cualquier Schema Queryable con el hook useQuery]]></summary>
        <content type="html"><![CDATA[<p>Además de las ventajas de rendimiento e integridad de datos de <a href="https://react.dev/learn/choosing-the-state-structure" target="_blank" rel="noopener noreferrer" class="">normalizar el estado</a>,
obtenemos el beneficio adicional de poder acceder al store y consultarlo directamente de forma segura.</p>
<p>En esta versión ajustamos y simplificamos esta funcionalidad unificándola en torno al concepto de <a class="" href="https://dataclient.io/es/docs/api/useQuery#queryable">Schemas Queryable</a>. Estos incluyen
<a class="" href="https://dataclient.io/es/rest/api/Entity">Entity</a>, <a class="" href="https://dataclient.io/es/rest/api/All">All</a>, <a class="" href="https://dataclient.io/es/rest/api/Collection">Collection</a>, <a class="" href="https://dataclient.io/es/rest/api/Query">Query</a>
y <a class="" href="https://dataclient.io/es/rest/api/Union">Union</a></p>
<p>El mayor impacto de este cambio es la introducción de un nuevo hook, <a href="https://0.18.dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#usequery" target="_self" class="">useQuery()</a>, que permite búsquedas directas en el store
usando los <a class="" href="https://dataclient.io/es/docs/api/useQuery#queryable">Schemas Queryable</a>.</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">User </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  username <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  id <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  groupId <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">pk</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>id<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">static</span> index <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">'username' </span><span class="token keyword" style="font-style:italic">as const</span><span class="token punctuation" style="color:rgb(199, 146, 234)">];</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> bob <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useQuery</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>User<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> username<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'bob' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> bob <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useQuery</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>User<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'5' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<p>De manera similar, podemos buscar Queryables con el controller y el snapshot usando <a href="https://0.18.dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#controllerget" target="_self" class="">controller.get</a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> bob <span class="token operator" style="color:rgb(137, 221, 255)">=</span> snapshot<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">get</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>User<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> username<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'bob' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<p>Adicionalmente, hemos invertido en más <a href="https://0.18.dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#performance" target="_self" class="">mejoras de rendimiento</a>, que resultan en un aumento de rendimiento de alrededor de 2x
para la mayoría de las operaciones y en que las <a class="" href="https://dataclient.io/es/rest/api/Query">Queries</a> sean 16x más rápidas.</p>
<center><a href="https://0.18.dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#migration-guide" target="_self" class="button button--secondary">Guía de migración</a></center>
<p><strong>Cambios incompatibles:</strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#removed-index" target="_self" class="">useCache(new Index(MyEntity)) -&gt; useQuery(MyEntity)</a></li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#query-migration" target="_self" class="">new Query -&gt; new schema.Query</a>
<ul>
<li class="">useCache(myQuery) -&gt; useQuery(myQuery)</li>
</ul>
</li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#snap.abort" target="_self" class="">new AbortOptimistic() -&gt; snapshot.abort</a></li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#shouldupdate" target="_self" class="">Entity.useIncoming → Entity.shouldUpdate</a></li>
</ul>
<p><a href="https://0.18.dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#other-improvements" target="_self" class=""><strong>Otros puntos destacados:</strong></a></p>
<ul>
<li class="">useCache() acepta Endpoints con sideEffects (como <a class="" href="https://dataclient.io/es/rest/api/resource#update">Resource.update</a>)</li>
<li class="">Se permite que Entity.pk() devuelva números.</li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#performance" target="_self" class="">Mejoras de rendimiento</a> de 2-16x</li>
</ul>
<!-- -->
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="querable">Querable<a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#querable" class="hash-link" aria-label="Enlace directo al Querable" title="Enlace directo al Querable" translate="no">​</a></h3>
<p>Los schemas <a class="" href="https://dataclient.io/es/rest/api/schema#queryable">Queryable</a> requieren un método <code>queryKey()</code> que devuelva algo. Estos incluyen
<a class="" href="https://dataclient.io/es/rest/api/Entity">Entity</a>, <a class="" href="https://dataclient.io/es/rest/api/All">All</a>, <a class="" href="https://dataclient.io/es/rest/api/Collection">Collection</a>, <a class="" href="https://dataclient.io/es/rest/api/Query">Query</a>
y <a class="" href="https://dataclient.io/es/rest/api/Union">Union</a>.</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">interface </span><span class="token class-name" style="color:rgb(255, 203, 107)">Queryable </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">queryKey</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">    args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">readonly </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[],</span><br></div><div class="token-line">    <span class="token function-variable function" style="color:rgb(130, 170, 255)">queryKey</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">...</span>args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    getEntity<span class="token operator" style="color:rgb(137, 221, 255)">:</span> GetEntity<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    getIndex<span class="token operator" style="color:rgb(137, 221, 255)">:</span> GetIndex<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    <span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// `{}` means non-void</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{};</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="schemaquery">schema.Query<a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#schemaquery" class="hash-link" aria-label="Enlace directo al schema.Query" title="Enlace directo al schema.Query" translate="no">​</a></h3>
<p><code>Query</code> antes se implementaba como un Endpoint. Como ahora tenemos métodos para recuperar schemas Queryable
directamente, podemos simplemente convertir Query en otro schema Queryable más. Debería ser básicamente igual,
permitiendo cálculos arbitrarios sobre el valor de un store. <a href="https://github.com/reactive/data-client/pull/2921" target="_blank" rel="noopener noreferrer" class="">#2921</a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> getUserCount <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">schema</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">Query</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">schema</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">All</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>User<span class="token punctuation" style="color:rgb(199, 146, 234)">),</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>entries<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> isAdmin <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{}) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>isAdmin <span class="token operator" style="color:rgb(137, 221, 255)">!== </span><span class="token keyword" style="font-style:italic">undefined</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">return</span> entries<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">filter</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>user <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> user<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>isAdmin <span class="token operator" style="color:rgb(137, 221, 255)">===</span> isAdmin<span class="token punctuation" style="color:rgb(199, 146, 234)">).</span>length<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return</span> entries<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>length<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> userCount <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useQuery</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>getUserCount<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> adminCount <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useQuery</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>getUserCount<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> isAdmin<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token boolean" style="color:rgb(255, 88, 116)">true </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<p>schema.Query ahora rechaza los schemas que no son Queryable.</p>
<div class="playgroundQueryContainer_vBqa"><div class="playgroundContainer_sLUA standaloneEditor_OHub row_YGZs"><div class="playgroundTextEdit_rt2K"><div class="editorDocs_INVk"><div class="playgroundEditor_lYwu"><div><pre class="prism-code language-ts" style="margin:0;outline:none;padding:10px;font-family:inherit;color:#bfc7d5;background-color:transparent" spellcheck="false"><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">const </span>getBob <span class="token punctuation" style="color:#c792ea">= </span><span class="token keyword" style="color:#7da4f6;font-style:italic">new </span>schema<span class="token punctuation" style="color:#c792ea">.</span><span class="token class-name" style="color:#ffcb6b">Query</span><span class="token punctuation" style="color:#c792ea">(
</span></span><span class="token-line">  <span class="token comment" style="color:#697098;font-style:italic">// Array is not Queryable
</span></span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">new </span>schema<span class="token punctuation" style="color:#c792ea">.</span><span class="token class-name" style="color:#ffcb6b">Array</span><span class="token punctuation" style="color:#c792ea">({ </span>bob<span class="token punctuation" style="color:#c792ea">: </span><span class="token string" style="color:#b6d986">'' </span><span class="token punctuation" style="color:#c792ea">}),
</span></span><span class="token-line">  thing <span class="token punctuation" style="color:#c792ea">=&gt; {
</span></span><span class="token-line">    <span class="token keyword" style="color:#7da4f6;font-style:italic">return </span>thing<span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">  <span class="token punctuation" style="color:#c792ea">},
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">);
</span></span></pre></div></div></div></div></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="controllerget">controller.get / snapshot.get<a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#controllerget" class="hash-link" aria-label="Enlace directo al controller.get / snapshot.get" title="Enlace directo al controller.get / snapshot.get" translate="no">​</a></h3>
<p>Ahora podemos <a class="" href="https://dataclient.io/es/docs/api/Controller#get">acceder al store</a> con solo un Schema Queryable; ya no necesitamos un Endpoint completo.
<a href="https://github.com/reactive/data-client/pull/2921" target="_blank" rel="noopener noreferrer" class="">#2921</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">getOptimisticResponse</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>snapshot<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">}) {</span><br></div><div class="token-line theme-code-block-highlighted-line">  <span class="token keyword" style="font-style:italic">const </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> data<span class="token operator" style="color:rgb(137, 221, 255)">:</span> post <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> snapshot<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getResponse</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>Base<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">!</span>post<span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token keyword" style="font-style:italic">throw</span> snapshot<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>abort<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">return </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    id<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    votes<span class="token operator" style="color:rgb(137, 221, 255)">:</span> post<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>votes <span class="token operator" style="color:rgb(137, 221, 255)">+ </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">getOptimisticResponse</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>snapshot<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">}) {</span><br></div><div class="token-line theme-code-block-highlighted-line">  <span class="token keyword" style="font-style:italic">const</span> post <span class="token operator" style="color:rgb(137, 221, 255)">=</span> snapshot<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">get</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>Post<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">!</span>post<span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token keyword" style="font-style:italic">throw</span> snapshot<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>abort<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">return </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    id<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    votes<span class="token operator" style="color:rgb(137, 221, 255)">:</span> post<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>votes <span class="token operator" style="color:rgb(137, 221, 255)">+ </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<p>Como ya no necesitamos acceder a otros <a class="" href="https://dataclient.io/es/rest/api/resource#members">miembros del Resource</a> para obtener <code>Post</code>,
podemos usar la sobrecarga mucho más simple de <a class="" href="https://dataclient.io/es/rest/api/resource#extend-new">Resource.extend()</a>.</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">export const</span> PostResource <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">createResource</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/posts/:id'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Post<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line theme-code-block-highlighted-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}).</span><span class="token function" style="color:rgb(130, 170, 255)">extend</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>Base <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  vote<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">    path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/posts/:id/vote'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    method<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'POST'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    body<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">undefined</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    schema<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Post<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    <span class="token function" style="color:rgb(130, 170, 255)">getOptimisticResponse</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>snapshot<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">}) {</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">const </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> data<span class="token operator" style="color:rgb(137, 221, 255)">:</span> post <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> snapshot<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getResponse</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>Base<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">!</span>post<span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token keyword" style="font-style:italic">throw</span> snapshot<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>abort<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">return </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">        id<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">        votes<span class="token operator" style="color:rgb(137, 221, 255)">:</span> post<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>votes <span class="token operator" style="color:rgb(137, 221, 255)">+ </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}),</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}));</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">export const</span> PostResource <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">createResource</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/posts/:id'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Post<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line theme-code-block-highlighted-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}).</span><span class="token function" style="color:rgb(130, 170, 255)">extend</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">'vote'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/posts/:id/vote'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  method<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'POST'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  body<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">undefined</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Post<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">getOptimisticResponse</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>snapshot<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">}) {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">const</span> post <span class="token operator" style="color:rgb(137, 221, 255)">=</span> snapshot<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">get</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>Post<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">!</span>post<span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token keyword" style="font-style:italic">throw</span> snapshot<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>abort<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">      id<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      votes<span class="token operator" style="color:rgb(137, 221, 255)">:</span> post<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>votes <span class="token operator" style="color:rgb(137, 221, 255)">+ </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="usequery">useQuery<a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#usequery" class="hash-link" aria-label="Enlace directo al useQuery" title="Enlace directo al useQuery" translate="no">​</a></h3>
<p>Renderiza cualquier <a class="" href="https://dataclient.io/es/rest/api/schema#queryable">Schema Queryable</a> desde el store.
Las <a class="" href="https://dataclient.io/es/rest/api/Query">Queries</a> son un gran complemento para renderizar eficientemente cálculos agregados como los que usan <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/groupBy#browser_compatibility" target="_blank" rel="noopener noreferrer" class="">groupBy</a>,
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map" target="_blank" rel="noopener noreferrer" class="">map</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce" target="_blank" rel="noopener noreferrer" class="">reduce</a> y <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter" target="_blank" rel="noopener noreferrer" class="">filter</a>. <a href="https://github.com/reactive/data-client/pull/2921" target="_blank" rel="noopener noreferrer" class="">#2921</a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">User </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  username <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  id <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  groupId <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">pk</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>id<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">static</span> index <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">'username' </span><span class="token keyword" style="font-style:italic">as const</span><span class="token punctuation" style="color:rgb(199, 146, 234)">];</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> bob <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useQuery</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>User<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> username<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'bob' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> getUserCount <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">schema</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">Query</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">schema</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">All</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>User<span class="token punctuation" style="color:rgb(199, 146, 234)">),</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>entries<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> isAdmin <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{}) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>isAdmin <span class="token operator" style="color:rgb(137, 221, 255)">!== </span><span class="token keyword" style="font-style:italic">undefined</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">return</span> entries<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">filter</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>user <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> user<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>isAdmin <span class="token operator" style="color:rgb(137, 221, 255)">===</span> isAdmin<span class="token punctuation" style="color:rgb(199, 146, 234)">).</span>length<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return</span> entries<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>length<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> userCount <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useQuery</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>getUserCount<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> adminCount <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useQuery</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>getUserCount<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> isAdmin<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token boolean" style="color:rgb(255, 88, 116)">true </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> UserCollection <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">schema</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">Collection</span><span class="token punctuation" style="color:rgb(199, 146, 234)">([</span>User<span class="token punctuation" style="color:rgb(199, 146, 234)">], {</span><br></div><div class="token-line">  <span class="token function-variable function" style="color:rgb(130, 170, 255)">argsKey</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>urlParams<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> groupId<span class="token operator" style="color:rgb(137, 221, 255)">?: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">    <span class="token operator" style="color:rgb(137, 221, 255)">...</span>urlParams<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}),</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> usersInGroup <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useQuery</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>UserCollection<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> groupId<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'5' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="performance">Rendimiento<a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#performance" class="hash-link" aria-label="Enlace directo al Rendimiento" title="Enlace directo al Rendimiento" translate="no">​</a></h2>
<p>Nuevas optimizaciones tanto del sistema de caché como de todas las rutas de código críticas han dado un
impulso considerable de 2x a las operaciones más comunes. Con la incorporación de la <a href="https://github.com/reactive/data-client/pull/2978" target="_blank" rel="noopener noreferrer" class="">capacidad de caché de queries</a>, vemos una mejora aún más impresionante de 16x en nuestro benchmark de ordenamiento de Query.</p>
<p>Esto se suma a la <a class="" href="https://dataclient.io/es/docs/concepts/normalization#benchmarks">ventaja existente (de hasta 23x) sobre la biblioteca normalizr heredada</a>.</p>
<center><div style="max-width:600px"></div><p><a href="https://reactive.github.io/data-client/dev/bench/" target="_blank" rel="noopener noreferrer" class="">Benchmarks a lo largo del tiempo</a> | <a href="https://github.com/reactive/data-client/tree/master/examples/benchmark" target="_blank" rel="noopener noreferrer" class="">Ver benchmark</a></p></center>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="other-improvements">Otras mejoras<a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#other-improvements" class="hash-link" aria-label="Enlace directo al Otras mejoras" title="Enlace directo al Otras mejoras" translate="no">​</a></h2>
<ul>
<li class="">useCache() acepta Endpoints con sideEffects (como <a class="" href="https://dataclient.io/es/rest/api/resource#update">Resource.update</a>) <a href="https://github.com/reactive/data-client/pull/2963" target="_blank" rel="noopener noreferrer" class="">#2963</a>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> lastCreated <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useCache</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>MyResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>getList<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>push<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div>
</li>
<li class="">Se permite que pk devuelva números <a href="https://github.com/reactive/data-client/pull/2961" target="_blank" rel="noopener noreferrer" class="">#2961</a>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyEntity </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  id <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">pk</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {</span><br></div><div class="token-line theme-code-block-highlighted-line">    <span class="token keyword" style="font-style:italic">return </span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">${</span><span class="token template-string interpolation keyword" style="font-style:italic">this</span><span class="token template-string interpolation punctuation" style="color:rgb(199, 146, 234)">.</span>id<span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token template-string template-punctuation string" style="color:rgb(195, 232, 141)">`</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyEntity </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  id <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">pk</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {</span><br></div><div class="token-line theme-code-block-highlighted-line">    <span class="token keyword" style="font-style:italic">return this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>id<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
</li>
<li class="">Tipado<!-- -->
<ul>
<li class="">Mejora del tipado de .extend() al usar <a href="https://www.typescriptlang.org/tsconfig#strictNullChecks" target="_blank" rel="noopener noreferrer" class="">comprobaciones de null laxas</a> y sin parámetro body <a href="https://github.com/reactive/data-client/pull/2962" target="_blank" rel="noopener noreferrer" class="">#2962</a>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">Parameters<span class="token operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token keyword" style="font-style:italic">typeof new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/test' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}).</span><span class="token function" style="color:rgb(130, 170, 255)">extend</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/test2' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">})</span><span class="token operator" style="color:rgb(137, 221, 255)">&gt; === </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[]</span><br></div></code></pre></div></div>
</li>
<li class="">El tipo predeterminado de Args de Collection es: <a href="https://github.com/reactive/data-client/commit/8377e0a157419f0f4c237c392a895fec1772854d" target="_blank" rel="noopener noreferrer" class="">8377e</a>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token operator" style="color:rgb(137, 221, 255)">| </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[]</span><br></div><div class="token-line"><span class="token operator" style="color:rgb(137, 221, 255)">| </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span>urlParams<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Record<span class="token operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token operator" style="color:rgb(137, 221, 255)">&gt;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><br></div><div class="token-line"><span class="token operator" style="color:rgb(137, 221, 255)">| </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span>urlParams<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Record<span class="token operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token operator" style="color:rgb(137, 221, 255)">&gt;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> body<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><br></div></code></pre></div></div>
</li>
</ul>
</li>
<li class="">Correcciones<!-- -->
<ul>
<li class="">El caso INVALID al desnormalizar schema.All también debe funcionar cuando se alteran los nombres de clase (mangling) en builds de producción <a href="https://github.com/reactive/data-client/pull/2954" target="_blank" rel="noopener noreferrer" class="">#2954</a>
<ul>
<li class=""><code>unvisit()</code> siempre devuelve <code>undefined</code> cuando recibe <code>undefined</code> como entrada.</li>
<li class=""><code>All</code> devuelve INVALID desde <code>queryKey()</code> para invalidar lo que antes era un caso especial en <code>unvisit()</code> (cuando no hay entrada en la tabla para la entidad dada)</li>
</ul>
</li>
<li class="">Las entidades anidadas faltantes deben aparecer una vez que estén presentes <a href="https://github.com/reactive/data-client/pull/2956" target="_blank" rel="noopener noreferrer" class="">#2956</a>, <a href="https://github.com/reactive/data-client/pull/2961" target="_blank" rel="noopener noreferrer" class="">#2961</a></li>
</ul>
</li>
</ul>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="migration-guide">Guía de migración<a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#migration-guide" class="hash-link" aria-label="Enlace directo al Guía de migración" title="Enlace directo al Guía de migración" translate="no">​</a></h2>
<!-- -->
<p>Esta actualización requiere actualizar todas las versiones de los paquetes simultáneamente.</p>
<div class="theme-tabs-container tabs-container tabList_J5MA"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_l0OV tabs__item--active">NPM</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">Yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">esm.sh</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_wHwb"><div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc"><span class="token function" style="color:rgb(130, 170, 255)">npm install </span><span class="token parameter variable" style="color:rgb(191, 199, 213)">--save</span> @data-client/react@^0.11.0 @data-client/rest@^0.11.0 @data-client/test@^0.11.0 @data-client/img@^0.11.0 @data-client/hooks@^0.11.0<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">yarn add @data-client/react@^0.11.0 @data-client/rest@^0.11.0 @data-client/test@^0.11.0 @data-client/img@^0.11.0 @data-client/hooks@^0.11.0<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">pnpm add @data-client/react@^0.11.0 @data-client/rest@^0.11.0 @data-client/test@^0.11.0 @data-client/img@^0.11.0 @data-client/hooks@^0.11.0<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-html language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">&lt;script type="importmap"&gt;<br></div><div class="token-line">{<br></div><div class="token-line">  "imports": {<br></div><div class="token-line">    "@data-client/react": "https://esm.sh/@data-client/react@^0.11.0",<br></div><div class="token-line">    "@data-client/rest": "https://esm.sh/@data-client/rest@^0.11.0",<br></div><div class="token-line">    "@data-client/test": "https://esm.sh/@data-client/test@^0.11.0",<br></div><div class="token-line">    "@data-client/img": "https://esm.sh/@data-client/img@^0.11.0",<br></div><div class="token-line">    "@data-client/hooks": "https://esm.sh/@data-client/hooks@^0.11.0"<br></div><div class="token-line">  }<br></div><div class="token-line">}<br></div><div class="token-line">&lt;/script&gt;<br></div></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="removed-index">Index eliminado<a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#removed-index" class="hash-link" aria-label="Enlace directo al Index eliminado" title="Enlace directo al Index eliminado" translate="no">​</a></h3>
<p>Simplemente usa las Entities directamente en <a class="" href="https://dataclient.io/es/docs/api/useQuery">useQuery</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const </span>UserIndex <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">Index</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>User<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> bob <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useCache</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>UserIndex<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> username<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'bob' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> bob <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useQuery</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>User<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> username<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'bob' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="query-migration">new Query -&gt; new schema.Query<a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#query-migration" class="hash-link" aria-label="Enlace directo al new Query -> new schema.Query" title="Enlace directo al new Query -> new schema.Query" translate="no">​</a></h3>
<p><a class="" href="https://dataclient.io/es/rest/api/Query">Query</a> ahora es un schema; se usa con <a class="" href="https://dataclient.io/es/docs/api/useQuery">useQuery</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line theme-code-block-highlighted-line"><span class="token keyword" style="font-style:italic">const</span> getUserCount <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">Query</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">schema</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access maybe-class-name" style="color:rgb(130, 170, 255)">All</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>User<span class="token punctuation" style="color:rgb(199, 146, 234)">),</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>entries<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> isAdmin <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{}) </span><span class="token arrow operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>isAdmin <span class="token operator" style="color:rgb(137, 221, 255)">!== </span><span class="token keyword" style="font-style:italic">undefined</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">return</span> entries<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">filter</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>user <span class="token arrow operator" style="color:rgb(137, 221, 255)">=&gt;</span> user<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>isAdmin <span class="token operator" style="color:rgb(137, 221, 255)">===</span> isAdmin<span class="token punctuation" style="color:rgb(199, 146, 234)">).</span>length<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return</span> entries<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>length<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> userCount <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useCache</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>getUserCount<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> adminCount <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useCache</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>getUserCount<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> isAdmin<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token boolean" style="color:rgb(255, 88, 116)">true </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line theme-code-block-highlighted-line"><span class="token keyword" style="font-style:italic">const</span> getUserCount <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">schema</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access maybe-class-name" style="color:rgb(130, 170, 255)">Query</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">schema</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access maybe-class-name" style="color:rgb(130, 170, 255)">All</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>User<span class="token punctuation" style="color:rgb(199, 146, 234)">),</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>entries<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> isAdmin <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{}) </span><span class="token arrow operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>isAdmin <span class="token operator" style="color:rgb(137, 221, 255)">!== </span><span class="token keyword" style="font-style:italic">undefined</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></div><div class="token-line">      <span class="token keyword" style="font-style:italic">return</span> entries<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token method function property-access" style="color:rgb(130, 170, 255)">filter</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>user <span class="token arrow operator" style="color:rgb(137, 221, 255)">=&gt;</span> user<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>isAdmin <span class="token operator" style="color:rgb(137, 221, 255)">===</span> isAdmin<span class="token punctuation" style="color:rgb(199, 146, 234)">).</span>length<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return</span> entries<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>length<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> userCount <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useQuery</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>getUserCount<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> adminCount <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useQuery</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>getUserCount<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> isAdmin<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token boolean" style="color:rgb(255, 88, 116)">true </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="snap.abort">new AbortOptimistic() -&gt; snapshot.abort<a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#snap.abort" class="hash-link" aria-label="Enlace directo al new AbortOptimistic() -> snapshot.abort" title="Enlace directo al new AbortOptimistic() -> snapshot.abort" translate="no">​</a></h3>
<p><a href="https://dataclient.io/docs/api/Snapshot#abort" target="_blank" rel="noopener noreferrer" class="">snapshot.abort</a> elimina la necesidad de importar AbortOptimistic <a href="https://github.com/reactive/data-client/pull/2957" target="_blank" rel="noopener noreferrer" class="">#2957</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">getOptimisticResponse</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>snapshot<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">}) {</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">const </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> data <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> snapshot<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getResponse</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>Base<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line theme-code-block-highlighted-line">  <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">!</span>data<span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token keyword" style="font-style:italic">throw new </span><span class="token class-name" style="color:rgb(255, 203, 107)">AbortOptimistic</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">return </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    id<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    votes<span class="token operator" style="color:rgb(137, 221, 255)">:</span> data<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>votes <span class="token operator" style="color:rgb(137, 221, 255)">+ </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">getOptimisticResponse</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>snapshot<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">}) {</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">const </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> data <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span> snapshot<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getResponse</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>Base<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>get<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> id <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line theme-code-block-highlighted-line">  <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">!</span>data<span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token keyword" style="font-style:italic">throw</span> snapshot<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>abort<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">return </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    id<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    votes<span class="token operator" style="color:rgb(137, 221, 255)">:</span> data<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>votes <span class="token operator" style="color:rgb(137, 221, 255)">+ </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="shouldupdate">Entity.useIncoming → Entity.shouldUpdate<a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#shouldupdate" class="hash-link" aria-label="Enlace directo al Entity.useIncoming → Entity.shouldUpdate" title="Enlace directo al Entity.useIncoming → Entity.shouldUpdate" translate="no">​</a></h3>
<p>Hace que el nombre de <a class="" href="https://dataclient.io/es/rest/api/Entity#shouldupdate">Entity.shouldUpdate</a> sea consistente con <a class="" href="https://dataclient.io/es/rest/api/Entity#shouldreorder">Entity.shouldReorder</a> <a href="https://github.com/reactive/data-client/pull/2972" target="_blank" rel="noopener noreferrer" class="">#2972</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyEntity </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line theme-code-block-highlighted-line">  <span class="token keyword" style="font-style:italic">static </span><span class="token function" style="color:rgb(130, 170, 255)">useIncoming</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">    existingMeta<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> date<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">number </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">    incomingMeta<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> date<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">number </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">    existing<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    incoming<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return </span><span class="token operator" style="color:rgb(137, 221, 255)">!</span><span class="token function" style="color:rgb(130, 170, 255)">deepEquals</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>existing<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> incoming<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyEntity </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line theme-code-block-highlighted-line">  <span class="token keyword" style="font-style:italic">static </span><span class="token function" style="color:rgb(130, 170, 255)">shouldUpdate</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">    existingMeta<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> date<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">number </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">    incomingMeta<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> date<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">number </span><span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">    existing<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    incoming<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return </span><span class="token operator" style="color:rgb(137, 221, 255)">!</span><span class="token function" style="color:rgb(130, 170, 255)">deepEquals</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>existing<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> incoming<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="usedle-reactive-native-focus-handling">Manejo de foco en React Native con useDLE()<a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#usedle-reactive-native-focus-handling" class="hash-link" aria-label="Enlace directo al Manejo de foco en React Native con useDLE()" title="Enlace directo al Manejo de foco en React Native con useDLE()" translate="no">​</a></h3>
<p>Al igual que <a class="" href="https://dataclient.io/es/docs/api/useSuspense">useSuspense()</a> y <a class="" href="https://dataclient.io/es/docs/api/useFetch">useFetch()</a>, <a class="" href="https://dataclient.io/es/docs/api/useDLE">useDLE()</a> ahora
podrá revalidar los datos ante eventos de foco.</p>
<p>Al usar React Navigation, useDLE() disparará obtenciones de datos al recibir el foco si los datos se consideran
obsoletos.</p>
<p>Esto podría resultar en más obtenciones de datos de las que ocurrían antes.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="potential-but-unlikely-breaking-changes">Cambios potencialmente incompatibles, aunque poco probables<a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#potential-but-unlikely-breaking-changes" class="hash-link" aria-label="Enlace directo al Cambios potencialmente incompatibles, aunque poco probables" title="Enlace directo al Cambios potencialmente incompatibles, aunque poco probables" translate="no">​</a></h3>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="schemainfer---schemaquerykey-2977">Schema.infer() -&gt; Schema.queryKey() <a href="https://github.com/reactive/data-client/pull/2977" target="_blank" rel="noopener noreferrer" class="">#2977</a><a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#schemainfer---schemaquerykey-2977" class="hash-link" aria-label="Enlace directo al schemainfer---schemaquerykey-2977" title="Enlace directo al schemainfer---schemaquerykey-2977" translate="no">​</a></h4>
<p>La mayoría de las personas no ha sobrescrito el método <code>infer()</code>. Si lo hiciste, necesitas renombrarlo a <code>queryKey()</code>,
además de actualizar la lista de parámetros.</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyEntity </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line theme-code-block-highlighted-line">  <span class="token keyword" style="font-style:italic">static </span><span class="token function" style="color:rgb(130, 170, 255)">infer</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line theme-code-block-highlighted-line">    args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">readonly </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[],</span><br></div><div class="token-line theme-code-block-highlighted-line">    indexes<span class="token operator" style="color:rgb(137, 221, 255)">:</span> NormalizedIndex<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line theme-code-block-highlighted-line">    recurse<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line theme-code-block-highlighted-line">    entities<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line theme-code-block-highlighted-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token constant" style="color:rgb(130, 170, 255)">SILLYCONDITION</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token keyword" style="font-style:italic">return undefined</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>entities<span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>key<span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token operator" style="color:rgb(137, 221, 255)">?.</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span>someId<span class="token punctuation" style="color:rgb(199, 146, 234)">]) </span><span class="token keyword" style="font-style:italic">return</span> someId<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return super</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">infer</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> indexes<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> recurse<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> entities<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyEntity </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line theme-code-block-highlighted-line">  <span class="token keyword" style="font-style:italic">static </span><span class="token function" style="color:rgb(130, 170, 255)">queryKey</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line theme-code-block-highlighted-line">    args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">readonly </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[],</span><br></div><div class="token-line theme-code-block-highlighted-line">    <span class="token function-variable function" style="color:rgb(130, 170, 255)">queryKey</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token operator" style="color:rgb(137, 221, 255)">...</span>args<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line theme-code-block-highlighted-line">    getEntity<span class="token operator" style="color:rgb(137, 221, 255)">:</span> GetEntity<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line theme-code-block-highlighted-line">    getIndex<span class="token operator" style="color:rgb(137, 221, 255)">:</span> GetIndex<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line theme-code-block-highlighted-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token constant" style="color:rgb(130, 170, 255)">SILLYCONDITION</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token keyword" style="font-style:italic">return undefined</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token function" style="color:rgb(130, 170, 255)">getEntity</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>key<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> someId<span class="token punctuation" style="color:rgb(199, 146, 234)">)) </span><span class="token keyword" style="font-style:italic">return</span> someId<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return super</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">queryKey</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> queryKey<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> getEntity<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> getIndex<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<h5 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="getentitykey-pk">getEntity(key, pk?)<a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#getentitykey-pk" class="hash-link" aria-label="Enlace directo al getEntity(key, pk?)" title="Enlace directo al getEntity(key, pk?)" translate="no">​</a></h5>
<p>Obtiene todas las entidades de un tipo con un argumento, o una sola entidad con dos</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">One argument</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> entitiesEntry <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">getEntity</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>key<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>entitiesEntry <span class="token operator" style="color:rgb(137, 221, 255)">=== </span><span class="token keyword" style="font-style:italic">undefined</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token keyword" style="font-style:italic">return </span><span class="token constant" style="color:rgb(130, 170, 255)">INVALID</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">return</span> Object<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">values</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>entitiesEntry<span class="token punctuation" style="color:rgb(199, 146, 234)">).</span><span class="token function" style="color:rgb(130, 170, 255)">map</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  entity <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> entity <span class="token operator" style="color:rgb(137, 221, 255)">&amp;&amp; </span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">pk</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>entity<span class="token punctuation" style="color:rgb(199, 146, 234)">),</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Two arguments</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">if </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token function" style="color:rgb(130, 170, 255)">getEntity</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>key<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> id<span class="token punctuation" style="color:rgb(199, 146, 234)">)) </span><span class="token keyword" style="font-style:italic">return</span> id<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div></code></pre></div></div>
<h5 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="getindexkey-indexname-value">getIndex(key, indexName, value)<a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#getindexkey-indexname-value" class="hash-link" aria-label="Enlace directo al getIndex(key, indexName, value)" title="Enlace directo al getIndex(key, indexName, value)" translate="no">​</a></h5>
<p>Devuelve la entrada del índice (mapa de valor-&gt;pk)</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> value <span class="token operator" style="color:rgb(137, 221, 255)">=</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">][</span>indexName<span class="token punctuation" style="color:rgb(199, 146, 234)">];</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">return </span><span class="token function" style="color:rgb(130, 170, 255)">getIndex</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>schema<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>key<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> indexName<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> value<span class="token punctuation" style="color:rgb(199, 146, 234)">)[</span>value<span class="token punctuation" style="color:rgb(199, 146, 234)">];</span><br></div></code></pre></div></div>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="always-normalize-pk-to-string-type-2961">Siempre se normaliza pk al tipo string <a href="https://github.com/reactive/data-client/pull/2961" target="_blank" rel="noopener noreferrer" class="">#2961</a><a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#always-normalize-pk-to-string-type-2961" class="hash-link" aria-label="Enlace directo al always-normalize-pk-to-string-type-2961" title="Enlace directo al always-normalize-pk-to-string-type-2961" translate="no">​</a></h4>
<p>Cambio sutil en lo que habrá en el store. Probablemente solo importe al usar <a href="https://www.npmjs.com/package/@data-client/normalizr" target="_blank" rel="noopener noreferrer" class="">@data-client/normalizr</a>
directamente.</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-json codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-json codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  "Article"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    "123"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line theme-code-block-highlighted-line">      "author"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">8472</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      "id"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">123</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      "title"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"A Great Article"</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  "User"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    "8472"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">      "id"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">8472</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      "name"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"Paul"</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-json codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-json codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  "Article"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    "123"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line theme-code-block-highlighted-line">      "author"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"8472"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      "id"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">123</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      "title"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"A Great Article"</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  "User"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    "8472"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">      "id"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">8472</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      "name"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"Paul"</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="stateresults---stateendpoints-2971">state.results -&gt; state.endpoints <a href="https://github.com/reactive/data-client/pull/2971" target="_blank" rel="noopener noreferrer" class="">#2971</a><a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#stateresults---stateendpoints-2971" class="hash-link" aria-label="Enlace directo al stateresults---stateendpoints-2971" title="Enlace directo al stateresults---stateendpoints-2971" translate="no">​</a></h4>
<p>Probablemente solo importe al consumir <a href="https://www.npmjs.com/package/@data-client/core" target="_blank" rel="noopener noreferrer" class="">@data-client/core</a> directamente, ya que la estructura del estado interno
es opaca para <a href="https://www.npmjs.com/package/@data-client/react" target="_blank" rel="noopener noreferrer" class="">@data-client/react</a>.</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-json codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-json codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  "entities"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    "Article"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">      "5"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">        "content"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"more things here"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">        "id"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">        "title"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"hi"</span><br></div><div class="token-line">      <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line theme-code-block-highlighted-line">  "results"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    "GET http://test.com/articles/5"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"5"</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-json codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-json codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  "entities"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    "Article"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">      "5"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">        "content"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"more things here"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">        "id"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">5</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">        "title"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"hi"</span><br></div><div class="token-line">      <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line theme-code-block-highlighted-line">  "endpoints"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    "GET http://test.com/articles/5"<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">"5"</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="inferresults---memobuildquerykey-2977-2978">inferResults() -&gt; memo.buildQueryKey() <a href="https://github.com/reactive/data-client/pull/2977" target="_blank" rel="noopener noreferrer" class="">#2977</a>, <a href="https://github.com/reactive/data-client/pull/2978" target="_blank" rel="noopener noreferrer" class="">#2978</a><a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#inferresults---memobuildquerykey-2977-2978" class="hash-link" aria-label="Enlace directo al inferresults---memobuildquerykey-2977-2978" title="Enlace directo al inferresults---memobuildquerykey-2977-2978" translate="no">​</a></h4>
<p>Estos métodos se exportan en <a href="https://www.npmjs.com/package/@data-client/core" target="_blank" rel="noopener noreferrer" class="">@data-client/core</a> y <a href="https://www.npmjs.com/package/@data-client/normalizr" target="_blank" rel="noopener noreferrer" class="">@data-client/normalizr</a>.</p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="denormalizecached---memodenormalize-2978">denormalizeCached() -&gt; memo.denormalize() <a href="https://github.com/reactive/data-client/pull/2978" target="_blank" rel="noopener noreferrer" class="">#2978</a><a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#denormalizecached---memodenormalize-2978" class="hash-link" aria-label="Enlace directo al denormalizecached---memodenormalize-2978" title="Enlace directo al denormalizecached---memodenormalize-2978" translate="no">​</a></h4>
<p>Exportado en <a href="https://www.npmjs.com/package/@data-client/normalizr" target="_blank" rel="noopener noreferrer" class="">@data-client/normalizr</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> endpointCache <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">WeakEntityMap</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> entityCache <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{};</span><br></div><div class="token-line"><span class="token function" style="color:rgb(130, 170, 255)">denormalizeCached</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  input<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  state<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>entities<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  entityCache<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  endpointCache<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> memo <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">MemoCached</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div><div class="token-line">memo<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">denormalize</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">  input<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  state<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>entities<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div></div></div></div></figure>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="weakentitymap---weakdependencymap-2978">WeakEntityMap -&gt; WeakDependencyMap <a href="https://github.com/reactive/data-client/pull/2978" target="_blank" rel="noopener noreferrer" class="">#2978</a><a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#weakentitymap---weakdependencymap-2978" class="hash-link" aria-label="Enlace directo al weakentitymap---weakdependencymap-2978" title="Enlace directo al weakentitymap---weakdependencymap-2978" translate="no">​</a></h4>
<p>Exportado en <a href="https://www.npmjs.com/package/@data-client/normalizr" target="_blank" rel="noopener noreferrer" class="">@data-client/normalizr</a></p>
<p>Generalizamos este tipo de datos para que pueda usarse con otras dependencias.</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">WeakEntityMap</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">WeakDependencyMap</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token class-name" style="color:rgb(255, 203, 107)">EntityPath</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&gt;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="upgrade-support">Soporte para la actualización<a href="https://dataclient.io/es/blog/2024/04/08/v0.11-queries-querable-usequery#upgrade-support" class="hash-link" aria-label="Enlace directo al Soporte para la actualización" title="Enlace directo al Soporte para la actualización" translate="no">​</a></h3>
<p>Como siempre, si tienes algún problema o pregunta, no dudes en unirte a nuestro <a href="https://discord.gg/wXGV27xm6t" target="_blank" rel="noopener noreferrer" class=""><img decoding="async" loading="lazy" src="https://img.shields.io/discord/768254430381735967.svg?style=flat-square&amp;colorB=758ED3" alt="Chat" class="img_SS3x"></a> o <a href="https://github.com/reactive/data-client/issues/new/choose" target="_blank" rel="noopener noreferrer" class="">reportar un error</a></p>]]></content>
        <author>
            <name>Nathaniel Tucker</name>
            <uri>https://github.com/ntucker</uri>
        </author>
        <category label="Versiones" term="Versiones"/>
        <category label="Queryable" term="Queryable"/>
        <category label="Schemas" term="Schemas"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[v0.10: Manejo consistente de null, utilidades de URL]]></title>
        <id>https://dataclient.io/es/blog/2024/02/15/v0.10-null-consistency-url-utilities</id>
        <link href="https://dataclient.io/es/blog/2024/02/15/v0.10-null-consistency-url-utilities"/>
        <updated>2024-02-15T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Data Client 0.10 trae un manejo consistente de null en todos los schemas, nuevas utilidades para construir URLs en RestEndpoint y corrige fugas de memoria en DevTools.]]></summary>
        <content type="html"><![CDATA[<p>Esta versión se centra en la consistencia y la extensibilidad. El <a href="https://0.18.dataclient.io/es/blog/2024/02/15/v0.10-null-consistency-url-utilities#null-consistency" target="_self" class="">manejo de null</a> ahora es uniforme en todos los tipos de schema,
lo que hace que las transformaciones de datos sean más predecibles. Las nuevas <a href="https://0.18.dataclient.io/es/blog/2024/02/15/v0.10-null-consistency-url-utilities#url-utilities" target="_self" class="">utilidades de URL</a> permiten construir URLs personalizadas y codificar parámetros de búsqueda.</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyEndpoint</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token class-name constant" style="color:rgb(130, 170, 255)">O </span><span class="token class-name keyword" style="color:rgb(255, 203, 107);font-style:italic">extends</span><span class="token class-name" style="color:rgb(255, 203, 107)"> RestGenerics </span><span class="token class-name operator" style="color:rgb(137, 221, 255)">= </span><span class="token class-name builtin" style="color:rgb(130, 170, 255)">any</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&gt; </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token class-name constant" style="color:rgb(130, 170, 255)">O</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">searchToString</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>searchParams<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">    <span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Use qs library for complex nested object encoding</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return</span> qs<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">stringify</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>searchParams<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div>
<center><a href="https://0.18.dataclient.io/es/blog/2024/02/15/v0.10-null-consistency-url-utilities#migration-guide" target="_self" class="button button--secondary">Guía de migración</a></center>
<p><strong>Cambios incompatibles:</strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/02/15/v0.10-null-consistency-url-utilities#null-consistency" target="_self" class="">Los valores null se conservan en los schemas Array/Object</a></li>
</ul>
<p><strong>Otras mejoras:</strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/02/15/v0.10-null-consistency-url-utilities#searchtostring" target="_self" class="">RestEndpoint.searchToString()</a> para codificar parámetros de búsqueda de forma personalizada</li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/02/15/v0.10-null-consistency-url-utilities#url-utilities" target="_self" class="">Exportaciones getUrlBase y getUrlTokens</a> para construir URLs personalizadas</li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/02/15/v0.10-null-consistency-url-utilities#devtools-fix" target="_self" class="">Corrección de fuga de memoria en DevToolsManager</a></li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="null-consistency">Manejo consistente de null<a href="https://dataclient.io/es/blog/2024/02/15/v0.10-null-consistency-url-utilities#null-consistency" class="hash-link" aria-label="Enlace directo al Manejo consistente de null" title="Enlace directo al Manejo consistente de null" translate="no">​</a></h2>
<p>Los valores <code>null</code> ahora se conservan de forma consistente en todos los tipos de schema. Antes, la abreviatura <code>[]</code> y <a class="" href="https://dataclient.io/es/rest/api/Array">schema.Array</a>
se comportaban de manera distinta al encontrar valores <code>null</code>. <a href="https://github.com/reactive/data-client/pull/2912" target="_blank" rel="noopener noreferrer" class="">#2912</a></p>
<ul>
<li class=""><code>[]</code> y <a class="" href="https://dataclient.io/es/rest/api/Array">schema.Array</a> ahora se comportan de forma idéntica</li>
<li class="">Los valores <code>null</code> se conservan en todas partes (ya se conservaban en las <a class="" href="https://dataclient.io/es/rest/guides/relational-data#nesting">Entities anidadas</a>)</li>
<li class="">Los valores <code>undefined</code> siguen filtrándose</li>
</ul>
<p>Este cambio garantiza un comportamiento más predecible al trabajar con APIs que devuelven <code>null</code> explícitamente para indicar
ausencia de datos frente a <code>undefined</code> para campos faltantes.</p>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="url-utilities">Utilidades de URL<a href="https://dataclient.io/es/blog/2024/02/15/v0.10-null-consistency-url-utilities#url-utilities" class="hash-link" aria-label="Enlace directo al Utilidades de URL" title="Enlace directo al Utilidades de URL" translate="no">​</a></h2>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="searchtostring">RestEndpoint.searchToString()<a href="https://dataclient.io/es/blog/2024/02/15/v0.10-null-consistency-url-utilities#searchtostring" class="hash-link" aria-label="Enlace directo al RestEndpoint.searchToString()" title="Enlace directo al RestEndpoint.searchToString()" translate="no">​</a></h3>
<p><a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#searchToString">RestEndpoint.searchToString()</a> permite codificar los parámetros de búsqueda de forma personalizada.
Esto es especialmente útil para APIs que esperan objetos anidados complejos en las cadenas de consulta.
<a href="https://github.com/reactive/data-client/pull/2919" target="_blank" rel="noopener noreferrer" class="">#2919</a></p>
<p>Por ejemplo, para codificar objetos complejos con la biblioteca <a href="https://github.com/ljharb/qs" target="_blank" rel="noopener noreferrer" class="">qs</a>:</p>
<div class="language-typescript codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-typescript codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> RestEndpoint<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> RestGenerics <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">import</span> qs <span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'qs'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyEndpoint</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token class-name constant" style="color:rgb(130, 170, 255)">O </span><span class="token class-name keyword" style="color:rgb(255, 203, 107);font-style:italic">extends</span><span class="token class-name" style="color:rgb(255, 203, 107)"> RestGenerics </span><span class="token class-name operator" style="color:rgb(137, 221, 255)">= </span><span class="token class-name builtin" style="color:rgb(130, 170, 255)">any</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&gt; </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token class-name constant" style="color:rgb(130, 170, 255)">O</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">searchToString</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>searchParams<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return</span> qs<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">stringify</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>searchParams<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="geturlbase">getUrlBase, getUrlTokens<a href="https://dataclient.io/es/blog/2024/02/15/v0.10-null-consistency-url-utilities#geturlbase" class="hash-link" aria-label="Enlace directo al getUrlBase, getUrlTokens" title="Enlace directo al getUrlBase, getUrlTokens" translate="no">​</a></h3>
<p>Las nuevas exportaciones <code>getUrlBase</code> y <code>getUrlTokens</code> proporcionan los bloques de construcción para implementaciones
personalizadas de <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#url">RestEndpoint.url()</a>.
<a href="https://github.com/reactive/data-client/pull/2919" target="_blank" rel="noopener noreferrer" class="">#2919</a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> getUrlBase<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> getUrlTokens <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Parse path tokens for custom URL logic</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> tokens <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">getUrlTokens</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">'/users/:id/posts/:postId'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// =&gt; ['id', 'postId']</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Get base URL without path parameters</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> base <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">getUrlBase</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">'/users/:id'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// =&gt; '/users/'</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="devtools-fix">Corrección de memoria en DevToolsManager<a href="https://dataclient.io/es/blog/2024/02/15/v0.10-null-consistency-url-utilities#devtools-fix" class="hash-link" aria-label="Enlace directo al Corrección de memoria en DevToolsManager" title="Enlace directo al Corrección de memoria en DevToolsManager" translate="no">​</a></h2>
<p>El búfer de acciones de DevToolsManager ahora está limitado a 100 entradas, lo que evita fugas de memoria en aplicaciones
de larga duración o con actualizaciones frecuentes. <a href="https://github.com/reactive/data-client/commit/4e6a39ea2bfdb1390051f12781e899488609e1a8" target="_blank" rel="noopener noreferrer" class=""><code>4e6a39e</code></a></p>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="migration-guide">Guía de migración<a href="https://dataclient.io/es/blog/2024/02/15/v0.10-null-consistency-url-utilities#migration-guide" class="hash-link" aria-label="Enlace directo al Guía de migración" title="Enlace directo al Guía de migración" translate="no">​</a></h2>
<p>Esta actualización requiere actualizar todas las versiones de los paquetes al mismo tiempo.</p>
<div class="theme-tabs-container tabs-container tabList_J5MA"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_l0OV tabs__item--active">NPM</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">Yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">esm.sh</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_wHwb"><div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc"><span class="token function" style="color:rgb(130, 170, 255)">npm install </span><span class="token parameter variable" style="color:rgb(191, 199, 213)">--save</span> @data-client/react@^0.10.0 @data-client/rest@^0.10.0 @data-client/test@^0.10.0 @data-client/img@^0.10.0<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">yarn add @data-client/react@^0.10.0 @data-client/rest@^0.10.0 @data-client/test@^0.10.0 @data-client/img@^0.10.0<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">pnpm add @data-client/react@^0.10.0 @data-client/rest@^0.10.0 @data-client/test@^0.10.0 @data-client/img@^0.10.0<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-html language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">&lt;script type="importmap"&gt;<br></div><div class="token-line">{<br></div><div class="token-line">  "imports": {<br></div><div class="token-line">    "@data-client/react": "https://esm.sh/@data-client/react@^0.10.0",<br></div><div class="token-line">    "@data-client/rest": "https://esm.sh/@data-client/rest@^0.10.0",<br></div><div class="token-line">    "@data-client/test": "https://esm.sh/@data-client/test@^0.10.0",<br></div><div class="token-line">    "@data-client/img": "https://esm.sh/@data-client/img@^0.10.0"<br></div><div class="token-line">  }<br></div><div class="token-line">}<br></div><div class="token-line">&lt;/script&gt;<br></div></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="null-arrays">Valores null en arreglos<a href="https://dataclient.io/es/blog/2024/02/15/v0.10-null-consistency-url-utilities#null-arrays" class="hash-link" aria-label="Enlace directo al Valores null en arreglos" title="Enlace directo al Valores null en arreglos" translate="no">​</a></h3>
<p>Si tu código dependía de que los valores <code>null</code> se filtraran de los arreglos, tendrás que manejarlo explícitamente:</p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> Entity<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> schema<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> RestEndpoint <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">User </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  id <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  name <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">pk</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() { </span><span class="token keyword" style="font-style:italic">return this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>id<span class="token punctuation" style="color:rgb(199, 146, 234)">; }</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> getUsers <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/users'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">schema</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">Array</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>User<span class="token punctuation" style="color:rgb(199, 146, 234)">),</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// API response: [{ id: '1' }, null, { id: '2' }]</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> usersWithoutNull <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useSuspense</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>getUsers<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> Entity<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> schema<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> RestEndpoint <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">User </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  id <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  name <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token string" style="color:rgb(195, 232, 141)">''</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">pk</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() { </span><span class="token keyword" style="font-style:italic">return this</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>id<span class="token punctuation" style="color:rgb(199, 146, 234)">; }</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> getUsers <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/users'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">schema</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">Array</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>User<span class="token punctuation" style="color:rgb(199, 146, 234)">),</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// API response: [{ id: '1' }, null, { id: '2' }]</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> usersWithoutNull <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">useSuspense</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>getUsers<span class="token punctuation" style="color:rgb(199, 146, 234)">).</span><span class="token function" style="color:rgb(130, 170, 255)">filter</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>Boolean<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div></div></div></div></figure>
<p>Este cambio se alinea con la forma en que las <a class="" href="https://dataclient.io/es/rest/guides/relational-data#nesting">Entities anidadas</a> ya manejaban los valores <code>null</code>,
haciendo que el comportamiento sea consistente en todos los tipos de schema.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="upgrade-support">Soporte para la actualización<a href="https://dataclient.io/es/blog/2024/02/15/v0.10-null-consistency-url-utilities#upgrade-support" class="hash-link" aria-label="Enlace directo al Soporte para la actualización" title="Enlace directo al Soporte para la actualización" translate="no">​</a></h3>
<p>Como siempre, si tienes algún problema o pregunta, no dudes en unirte a nuestro <a href="https://discord.gg/wXGV27xm6t" target="_blank" rel="noopener noreferrer" class=""><img decoding="async" loading="lazy" src="https://img.shields.io/discord/768254430381735967.svg?style=flat-square&amp;colorB=758ED3" alt="Chat" class="img_SS3x"></a> o <a href="https://github.com/reactive/data-client/issues/new/choose" target="_blank" rel="noopener noreferrer" class="">reportar un error</a></p>]]></content>
        <author>
            <name>Nathaniel Tucker</name>
            <uri>https://github.com/ntucker</uri>
        </author>
        <category label="Versiones" term="Versiones"/>
        <category label="REST" term="REST"/>
        <category label="Endpoint" term="Endpoint"/>
        <category label="Schemas" term="Schemas"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[v0.9: DevTools, Resource.extend y limpieza de APIs heredadas]]></title>
        <id>https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement</id>
        <link href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement"/>
        <updated>2024-01-15T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Data Client 0.9 trae una mejor experiencia con DevTools, Resource.extend() para personalizar recursos, nuevos métodos del controller y elimina APIs heredadas para una biblioteca más limpia y rápida.]]></summary>
        <content type="html"><![CDATA[<p>Esta versión se centra en la experiencia de desarrollo con un <a href="https://0.18.dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#devtools-button" target="_self" class="">botón de devtools</a> que aparece en modo
de desarrollo, un mejor <a href="https://0.18.dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#devtools-improvements" target="_self" class="">historial de DevTools</a> y nuevos métodos del controller como
<a href="https://0.18.dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#controllerexpireall" target="_self" class="">controller.expireAll()</a> y <a href="https://0.18.dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#controllerfetchifstale" target="_self" class="">controller.fetchIfStale()</a>.</p>
<p><a class="" href="https://dataclient.io/es/rest/api/resource#extend">Resource.extend()</a> ofrece tres formas potentes de personalizar recursos: agregar nuevos endpoints,
sobrescribir los existentes o derivar a partir de los endpoints base.</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> UserResource <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">createResource</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/users/:id'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">:</span> User<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}).</span><span class="token function" style="color:rgb(130, 170, 255)">extend</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">'current'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/users/current'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<center><a href="https://0.18.dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#migration-guide" target="_self" class="button button--secondary">Guía de migración</a></center>
<p><strong>Cambios incompatibles:</strong></p>
<ul>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#remove-next-exports" target="_self" class="">Se eliminan todas las exportaciones /next</a></li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#makecacheprovider-removed" target="_self" class="">makeCacheProvider eliminado</a></li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#delete-invalidate" target="_self" class="">Tipo de acción DELETE -&gt; INVALIDATE</a></li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#legacy-schema-support-dropped" target="_self" class="">Se abandona el soporte de schemas heredados</a></li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#schema-serializers" target="_self" class="">Los serializadores de Schema deben admitir llamadas como función</a></li>
<li class=""><a href="https://0.18.dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#action-types-prefix" target="_self" class="">Tipos de acción con el prefijo 'rdc'</a></li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="resourceextend">Resource.extend() <small>(desde 0.5)</small><a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#resourceextend" class="hash-link" aria-label="Enlace directo al resourceextend" title="Enlace directo al resourceextend" translate="no">​</a></h2>
<p><a class="" href="https://dataclient.io/es/rest/api/resource#extend">Resource.extend()</a> ofrece tres formas potentes de personalizar recursos.
<a href="https://github.com/reactive/data-client/commit/51b4b0d188" target="_blank" rel="noopener noreferrer" class="">51b4b0d</a></p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="add-new-endpoints">Agregar nuevos endpoints<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#add-new-endpoints" class="hash-link" aria-label="Enlace directo al Agregar nuevos endpoints" title="Enlace directo al Agregar nuevos endpoints" translate="no">​</a></h3>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> UserResource <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">createResource</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/users/:id'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">:</span> User<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}).</span><span class="token function" style="color:rgb(130, 170, 255)">extend</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">'current'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/users/current'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="override-existing-endpoints">Sobrescribir endpoints existentes<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#override-existing-endpoints" class="hash-link" aria-label="Enlace directo al Sobrescribir endpoints existentes" title="Enlace directo al Sobrescribir endpoints existentes" translate="no">​</a></h3>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> CachedArticleResource <span class="token operator" style="color:rgb(137, 221, 255)">=</span> ArticleResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">extend</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  getList<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    dataExpiryLength<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token number" style="color:rgb(247, 140, 108)">10 </span><span class="token operator" style="color:rgb(137, 221, 255)">* </span><span class="token number" style="color:rgb(247, 140, 108)">60 </span><span class="token operator" style="color:rgb(137, 221, 255)">* </span><span class="token number" style="color:rgb(247, 140, 108)">1000</span><span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// 10 minutes</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="derive-from-base-endpoints">Derivar a partir de los endpoints base<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#derive-from-base-endpoints" class="hash-link" aria-label="Enlace directo al Derivar a partir de los endpoints base" title="Enlace directo al Derivar a partir de los endpoints base" translate="no">​</a></h3>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> IssueResource <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">createResource</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/issues/:id'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Issue<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}).</span><span class="token function" style="color:rgb(130, 170, 255)">extend</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>Base <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  byRepo<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Base<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>getList<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">extend</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">    path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/repos/:owner/:repo/issues'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}),</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}));</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="controller-methods">Métodos del Controller<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#controller-methods" class="hash-link" aria-label="Enlace directo al Métodos del Controller" title="Enlace directo al Métodos del Controller" translate="no">​</a></h2>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="controllerexpireall">controller.expireAll() <small>(desde 0.3)</small><a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#controllerexpireall" class="hash-link" aria-label="Enlace directo al controllerexpireall" title="Enlace directo al controllerexpireall" translate="no">​</a></h3>
<p>Marca todas las respuestas coincidentes como <em>obsoletas</em>, lo que dispara una nueva obtención en segundo plano mientras se muestran los datos existentes.
<a href="https://github.com/reactive/data-client/pull/2802" target="_blank" rel="noopener noreferrer" class="">#2802</a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Mark all article lists as stale - they'll refetch when rendered</span><br></div><div class="token-line">controller<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">expireAll</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>ArticleResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>getList<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div>
<p>Esto difiere de <code>invalidateAll()</code>, que elimina los datos por completo. <code>expireAll()</code> sigue mostrando
los datos en caché mientras obtiene datos frescos en segundo plano.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="controllerfetchifstale">controller.fetchIfStale() <small>(desde 0.4)</small><a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#controllerfetchifstale" class="hash-link" aria-label="Enlace directo al controllerfetchifstale" title="Enlace directo al controllerfetchifstale" translate="no">​</a></h3>
<p>Obtiene los datos solo si se consideran obsoletos; de lo contrario, devuelve los datos en caché.
<a href="https://github.com/reactive/data-client/pull/2804" target="_blank" rel="noopener noreferrer" class="">#2804</a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Perfect for prefetching - won't overfetch fresh data</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const </span><span class="token function-variable function" style="color:rgb(130, 170, 255)">resolveData </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">async </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>controller<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> owner<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> repo <span class="token punctuation" style="color:rgb(199, 146, 234)">}) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">await</span> controller<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetchIfStale</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>IssueResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>getList<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> owner<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> repo <span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="devtools-improvements">Mejoras en DevTools<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#devtools-improvements" class="hash-link" aria-label="Enlace directo al Mejoras en DevTools" title="Enlace directo al Mejoras en DevTools" translate="no">​</a></h2>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="devtools-button">Botón de DevTools<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#devtools-button" class="hash-link" aria-label="Enlace directo al Botón de DevTools" title="Enlace directo al Botón de DevTools" translate="no">​</a></h3>
<p>Ahora aparece un botón flotante en modo de desarrollo para abrir rápidamente la extensión Redux DevTools.
<a href="https://github.com/reactive/data-client/pull/2803" target="_blank" rel="noopener noreferrer" class="">#2803</a></p>
<p>Configúralo o desactívalo con la prop <code>devButton</code>:</p>
<div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Disable the button</span><br></div><div class="token-line"><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">CacheProvider devButton</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(199, 146, 234)">={</span><span class="token tag script language-javascript keyword" style="color:rgb(255, 85, 114);font-style:italic">null</span><span class="token tag script language-javascript punctuation" style="color:rgb(199, 146, 234)">}&gt;</span><br></div><div class="token-line">  <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">App </span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">/&gt;</span><br></div><div class="token-line"><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;/</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">CacheProvider</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div></code></pre></div></div>
<div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Position it differently</span><br></div><div class="token-line"><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">CacheProvider devButton</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(199, 146, 234)">="</span><span class="token tag attr-value" style="color:rgb(255, 85, 114)">top-right</span><span class="token tag attr-value punctuation" style="color:rgb(199, 146, 234)">"&gt;</span><br></div><div class="token-line">  <span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">App </span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">/&gt;</span><br></div><div class="token-line"><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&lt;/</span><span class="token tag class-name" style="color:rgb(255, 203, 107)">CacheProvider</span><span class="token tag punctuation" style="color:rgb(199, 146, 234)">&gt;</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="persistent-history">Historial persistente<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#persistent-history" class="hash-link" aria-label="Enlace directo al Historial persistente" title="Enlace directo al Historial persistente" translate="no">​</a></h3>
<p>DevTools ya no olvida el historial si no estaba abierto al cargar la página.
<a href="https://github.com/reactive/data-client/commit/2d2e94126e" target="_blank" rel="noopener noreferrer" class="">2d2e941</a></p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="better-state-tracking">Mejor seguimiento del estado<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#better-state-tracking" class="hash-link" aria-label="Enlace directo al Mejor seguimiento del estado" title="Enlace directo al Mejor seguimiento del estado" translate="no">​</a></h3>
<p>Como React 18 agrupa las actualizaciones, el estado real a veces puede actualizarse a partir de varias acciones.
Cuando las devtools están abiertas, un estado sombra refleja con precisión los cambios de cada acción para facilitar la depuración.
<a href="https://github.com/reactive/data-client/commit/c9ca31f3f4" target="_blank" rel="noopener noreferrer" class="">c9ca31f</a></p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="endpoint-properties-visible">Propiedades de Endpoint visibles<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#endpoint-properties-visible" class="hash-link" aria-label="Enlace directo al Propiedades de Endpoint visibles" title="Enlace directo al Propiedades de Endpoint visibles" translate="no">​</a></h3>
<p>Las propiedades de los Endpoints ahora son completamente visibles en el inspector de devtools.
<a href="https://github.com/reactive/data-client/commit/a7da00e82d" target="_blank" rel="noopener noreferrer" class="">a7da00e</a></p>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="collection-enhancements">Mejoras en Collection<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#collection-enhancements" class="hash-link" aria-label="Enlace directo al Mejoras en Collection" title="Enlace directo al Mejoras en Collection" translate="no">​</a></h2>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="formdataargumentfiltering">Filtrado por argumentos FormData <small>(desde 0.4)</small><a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#formdataargumentfiltering" class="hash-link" aria-label="Enlace directo al formdataargumentfiltering" title="Enlace directo al formdataargumentfiltering" translate="no">​</a></h3>
<p>Las <a class="" href="https://dataclient.io/es/rest/api/Collection">Collections</a> ahora pueden filtrar según argumentos FormData. <a href="https://github.com/reactive/data-client/commit/f95dbc64d1" target="_blank" rel="noopener noreferrer" class="">f95dbc6</a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>getPosts<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>push<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> group<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'react' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}, </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">FormData</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>e<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>currentTarget<span class="token punctuation" style="color:rgb(199, 146, 234)">));</span><br></div></code></pre></div></div>
<p>Si el FormData contiene un campo <code>author</code>, el elemento recién creado se agregará correctamente a
las collections filtradas por ese autor.</p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="paginationfield">paginationField <small>(desde 0.7)</small><a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#paginationfield" class="hash-link" aria-label="Enlace directo al paginationfield" title="Enlace directo al paginationfield" translate="no">​</a></h3>
<p>Usa <a class="" href="https://dataclient.io/es/rest/api/RestEndpoint#paginationfield">paginationField</a> para un soporte de paginación sencillo.
<a href="https://github.com/reactive/data-client/commit/c8c5575e5a" target="_blank" rel="noopener noreferrer" class="">c8c557</a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> TodoResource <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">createResource</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/todos/:id'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Todo<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  paginationField<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'page'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// Fetches page 2 and appends to the collection</span><br></div><div class="token-line">ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>TodoResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>getList<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>getPage<span class="token punctuation" style="color:rgb(199, 146, 234)">, {</span> page<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'2' </span><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="other-improvements">Otras mejoras<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#other-improvements" class="hash-link" aria-label="Enlace directo al Otras mejoras" title="Enlace directo al Otras mejoras" translate="no">​</a></h2>
<ul>
<li class="">Se agrega <code>className</code> a ErrorBoundary y <code>errorClassName</code> a <a class="" href="https://dataclient.io/es/docs/api/AsyncBoundary">AsyncBoundary</a> <a href="https://github.com/reactive/data-client/pull/2785" target="_blank" rel="noopener noreferrer" class="">#2785</a></li>
<li class="">Nueva exportación <code>getDefaultManagers()</code> para un control explícito de los managers <a href="https://github.com/reactive/data-client/pull/2791" target="_blank" rel="noopener noreferrer" class="">#2791</a></li>
<li class="">Se reemplaza BackupBoundary por UniversalSuspense + BackupLoading <a href="https://github.com/reactive/data-client/pull/2803" target="_blank" rel="noopener noreferrer" class="">#2803</a></li>
<li class="">Entity.process() recibe los <code>args</code> del endpoint como cuarto parámetro <em>(desde 0.7)</em> <a href="https://github.com/reactive/data-client/commit/a8936f5e6d" target="_blank" rel="noopener noreferrer" class="">a8936f5</a></li>
<li class=""><code>nonFilterArgumentKeys</code> en Collection para excluir los parámetros de ordenamiento del filtrado <em>(desde 0.7)</em> <a href="https://github.com/reactive/data-client/commit/318df89bf7" target="_blank" rel="noopener noreferrer" class="">318df89</a></li>
</ul>
<h2 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="migration-guide">Guía de migración<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#migration-guide" class="hash-link" aria-label="Enlace directo al Guía de migración" title="Enlace directo al Guía de migración" translate="no">​</a></h2>
<p>Esta actualización requiere actualizar todas las versiones de los paquetes al mismo tiempo.</p>
<div class="theme-tabs-container tabs-container tabList_J5MA"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_l0OV tabs__item--active">NPM</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">Yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_l0OV">esm.sh</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_wHwb"><div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc"><span class="token function" style="color:rgb(130, 170, 255)">npm install </span><span class="token parameter variable" style="color:rgb(191, 199, 213)">--save</span> @data-client/react@^0.9.0 @data-client/rest@^0.9.0 @data-client/test@^0.9.0 @data-client/img@^0.9.0 @data-client/hooks@^0.9.0<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">yarn add @data-client/react@^0.9.0 @data-client/rest@^0.9.0 @data-client/test@^0.9.0 @data-client/img@^0.9.0 @data-client/hooks@^0.9.0<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-bash language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">pnpm add @data-client/react@^0.9.0 @data-client/rest@^0.9.0 @data-client/test@^0.9.0 @data-client/img@^0.9.0 @data-client/hooks@^0.9.0<br></div></code></pre></div></div></div><div role="tabpanel" class="tabItem_wHwb" hidden=""><div class="language-html language-text codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-text codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line">&lt;script type="importmap"&gt;<br></div><div class="token-line">{<br></div><div class="token-line">  "imports": {<br></div><div class="token-line">    "@data-client/react": "https://esm.sh/@data-client/react@^0.9.0",<br></div><div class="token-line">    "@data-client/rest": "https://esm.sh/@data-client/rest@^0.9.0",<br></div><div class="token-line">    "@data-client/test": "https://esm.sh/@data-client/test@^0.9.0",<br></div><div class="token-line">    "@data-client/img": "https://esm.sh/@data-client/img@^0.9.0",<br></div><div class="token-line">    "@data-client/hooks": "https://esm.sh/@data-client/hooks@^0.9.0"<br></div><div class="token-line">  }<br></div><div class="token-line">}<br></div><div class="token-line">&lt;/script&gt;<br></div></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="remove-next-exports">Se eliminan las exportaciones /next<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#remove-next-exports" class="hash-link" aria-label="Enlace directo al Se eliminan las exportaciones /next" title="Enlace directo al Se eliminan las exportaciones /next" translate="no">​</a></h3>
<p>Se eliminaron todas las exportaciones de la subruta <code>/next</code>. Las funcionalidades que antes estaban en <code>/next</code> ahora son
las exportaciones estándar. <a href="https://github.com/reactive/data-client/commit/f65cf832f0" target="_blank" rel="noopener noreferrer" class="">f65cf83</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> useController <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react/next'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> useController <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="makecacheprovider-removed">makeCacheProvider eliminado<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#makecacheprovider-removed" class="hash-link" aria-label="Enlace directo al makeCacheProvider eliminado" title="Enlace directo al makeCacheProvider eliminado" translate="no">​</a></h3>
<p>Usa el componente proveedor directamente con makeRenderDataClient.
<a href="https://github.com/reactive/data-client/pull/2787" target="_blank" rel="noopener noreferrer" class="">#2787</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token imports punctuation" style="color:rgb(199, 146, 234)">{</span> makeCacheProvider <span class="token imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> renderDataClient <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">makeRenderDataClient</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>makeCacheProvider<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div><div class="language-tsx codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-tsx codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token imports punctuation" style="color:rgb(199, 146, 234)">{ </span>CacheProvider <span class="token imports punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> renderDataClient <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">makeRenderDataClient</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>CacheProvider<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="delete-invalidate">Tipo de acción DELETE -&gt; INVALIDATE<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#delete-invalidate" class="hash-link" aria-label="Enlace directo al Tipo de acción DELETE -> INVALIDATE" title="Enlace directo al Tipo de acción DELETE -> INVALIDATE" translate="no">​</a></h3>
<p>El tipo de acción DELETE pasa a llamarse INVALIDATE para mayor claridad.
<a href="https://github.com/reactive/data-client/pull/2784" target="_blank" rel="noopener noreferrer" class="">#2784</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{ </span><span class="token constant" style="color:rgb(130, 170, 255)">DELETE_TYPE </span><span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{ </span><span class="token constant" style="color:rgb(130, 170, 255)">INVALIDATE_TYPE </span><span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="legacy-schema-support-dropped">Se abandona el soporte de schemas heredados<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#legacy-schema-support-dropped" class="hash-link" aria-label="Enlace directo al Se abandona el soporte de schemas heredados" title="Enlace directo al Se abandona el soporte de schemas heredados" translate="no">​</a></h3>
<p>Se eliminó todo el soporte para schemas heredados. Asegúrate de estar usando la clase
Entity actual. <a href="https://github.com/reactive/data-client/pull/2784" target="_blank" rel="noopener noreferrer" class="">#2784</a></p>
<ul>
<li class=""><code>entity.expiresAt</code> eliminado</li>
<li class="">Se eliminan todas las sobrescrituras de Entity que existían por compatibilidad hacia atrás</li>
</ul>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="schema-serializers">Los serializadores de Schema deben admitir llamadas como función<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#schema-serializers" class="hash-link" aria-label="Enlace directo al Los serializadores de Schema deben admitir llamadas como función" title="Enlace directo al Los serializadores de Schema deben admitir llamadas como función" translate="no">​</a></h3>
<p>Los <a class="" href="https://dataclient.io/es/rest/guides/network-transform#deserializing-fields">serializadores de Schema</a> ahora deben admitir
llamadas como función. <code>Date</code> ya no funciona directamente. <a href="https://github.com/reactive/data-client/pull/2795" target="_blank" rel="noopener noreferrer" class="">#2795</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyEntity </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  createdAt <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">Date</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">static</span> schema <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line theme-code-block-highlighted-line">    createdAt<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Date<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyEntity </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  createdAt <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">Date</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">static</span> schema <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line theme-code-block-highlighted-line">    <span class="token function-variable function" style="color:rgb(130, 170, 255)">createdAt</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>iso<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token keyword" style="font-style:italic">new </span><span class="token class-name" style="color:rgb(255, 203, 107)">Date</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>iso<span class="token punctuation" style="color:rgb(199, 146, 234)">),</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<p>Como alternativa, usa Temporal:</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> Temporal <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'temporal-polyfill'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">MyEntity </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">Entity </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  createdAt <span class="token operator" style="color:rgb(137, 221, 255)">=</span> Temporal<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>Instant<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fromEpochSeconds</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token number" style="color:rgb(247, 140, 108)">0</span><span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">static</span> schema <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    createdAt<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Temporal<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>Instant<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>from<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="action-types-prefix">Tipos de acción con el prefijo 'rdc'<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#action-types-prefix" class="hash-link" aria-label="Enlace directo al Tipos de acción con el prefijo 'rdc'" title="Enlace directo al Tipos de acción con el prefijo 'rdc'" translate="no">​</a></h3>
<p>Todos los tipos de acción ahora llevan el prefijo 'rdc' para un mejor espacio de nombres.
<a href="https://github.com/reactive/data-client/pull/2781" target="_blank" rel="noopener noreferrer" class="">#2781</a></p>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="receive---set-action-names">Nombres de acción receive -&gt; set<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#receive---set-action-names" class="hash-link" aria-label="Enlace directo al Nombres de acción receive -> set" title="Enlace directo al Nombres de acción receive -> set" translate="no">​</a></h3>
<p>Todos los nombres de acción 'receive' pasan a llamarse 'set'.
<a href="https://github.com/reactive/data-client/pull/2782" target="_blank" rel="noopener noreferrer" class="">#2782</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> ReceiveAction<span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token constant" style="color:rgb(130, 170, 255)">RECEIVE_TYPE </span><span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">controller<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">receive</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>endpoint<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> response<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> SetAction<span class="token punctuation" style="color:rgb(199, 146, 234)">, </span><span class="token constant" style="color:rgb(130, 170, 255)">SET_TYPE </span><span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">controller<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">set</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>endpoint<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> args<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> response<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="middleware-api-simplified">API de Middleware simplificada<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#middleware-api-simplified" class="hash-link" aria-label="Enlace directo al API de Middleware simplificada" title="Enlace directo al API de Middleware simplificada" translate="no">​</a></h3>
<p>El Middleware ya no recibe <code>controller</code> como una propiedad desestructurada: recibe
el controller directamente. <a href="https://github.com/reactive/data-client/pull/2786" target="_blank" rel="noopener noreferrer" class="">#2786</a></p>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">LoggingManager </span><span class="token keyword" style="font-style:italic">implements </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line theme-code-block-highlighted-line">  getMiddleware <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">()</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span> Middleware <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span> controller <span class="token punctuation" style="color:rgb(199, 146, 234)">}) </span><span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> next <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token keyword" style="font-style:italic">async</span> action <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token builtin" style="color:rgb(130, 170, 255)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">'before'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> action<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> controller<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getState</span><span class="token punctuation" style="color:rgb(199, 146, 234)">());</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">await </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token builtin" style="color:rgb(130, 170, 255)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">'after'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> action<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> controller<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getState</span><span class="token punctuation" style="color:rgb(199, 146, 234)">());</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">cleanup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">LoggingManager </span><span class="token keyword" style="font-style:italic">implements </span><span class="token class-name" style="color:rgb(255, 203, 107)">Manager </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line theme-code-block-highlighted-line">  getMiddleware <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token punctuation" style="color:rgb(199, 146, 234)">()</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span> Middleware <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> controller <span class="token operator" style="color:rgb(137, 221, 255)">=&gt;</span> next <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token keyword" style="font-style:italic">async</span> action <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token builtin" style="color:rgb(130, 170, 255)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">'before'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> action<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> controller<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getState</span><span class="token punctuation" style="color:rgb(199, 146, 234)">());</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">await </span><span class="token function" style="color:rgb(130, 170, 255)">next</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>action<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">    <span class="token builtin" style="color:rgb(130, 170, 255)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token string" style="color:rgb(195, 232, 141)">'after'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> action<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> controller<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getState</span><span class="token punctuation" style="color:rgb(199, 146, 234)">());</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">cleanup</span><span class="token punctuation" style="color:rgb(199, 146, 234)">() {}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="getdefaultmanagers">getDefaultManagers()<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#getdefaultmanagers" class="hash-link" aria-label="Enlace directo al getDefaultManagers()" title="Enlace directo al getDefaultManagers()" translate="no">​</a></h3>
<p>Los elementos CacheProvider ya no comparten los managers predeterminados. Usa <code>getDefaultManagers()</code> para un control explícito.
<a href="https://github.com/reactive/data-client/pull/2791" target="_blank" rel="noopener noreferrer" class="">#2791</a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> getDefaultManagers<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> CacheProvider <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">const</span> managers <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">getDefaultManagers</span><span class="token punctuation" style="color:rgb(199, 146, 234)">();</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token operator" style="color:rgb(137, 221, 255)">&lt;</span>CacheProvider managers<span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span>managers<span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token operator" style="color:rgb(137, 221, 255)">&gt;</span><br></div><div class="token-line">  <span class="token operator" style="color:rgb(137, 221, 255)">&lt;</span>App <span class="token operator" style="color:rgb(137, 221, 255)">/&gt;</span><br></div><div class="token-line"><span class="token operator" style="color:rgb(137, 221, 255)">&lt;/</span>CacheProvider<span class="token operator" style="color:rgb(137, 221, 255)">&gt;</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="upgrade-support">Soporte para la actualización<a href="https://dataclient.io/es/blog/2024/01/15/v0.9-release-announcement#upgrade-support" class="hash-link" aria-label="Enlace directo al Soporte para la actualización" title="Enlace directo al Soporte para la actualización" translate="no">​</a></h3>
<p>Como siempre, si tienes algún problema o pregunta, no dudes en unirte a nuestro <a href="https://discord.gg/wXGV27xm6t" target="_blank" rel="noopener noreferrer" class=""><img decoding="async" loading="lazy" src="https://img.shields.io/discord/768254430381735967.svg?style=flat-square&amp;colorB=758ED3" alt="Chat" class="img_SS3x"></a> o <a href="https://github.com/reactive/data-client/issues/new/choose" target="_blank" rel="noopener noreferrer" class="">reportar un error</a></p>]]></content>
        <author>
            <name>Nathaniel Tucker</name>
            <uri>https://github.com/ntucker</uri>
        </author>
        <category label="Versiones" term="Versiones"/>
        <category label="REST" term="REST"/>
        <category label="Resources" term="Resources"/>
        <category label="Endpoint" term="Endpoint"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[v0.2 Controller.fetch, getHeaders asíncrono, Collections]]></title>
        <id>https://dataclient.io/es/blog/2023/07/04/v0.2-release-announcement</id>
        <link href="https://dataclient.io/es/blog/2023/07/04/v0.2-release-announcement"/>
        <updated>2023-07-04T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[La versión 0.2 de Data Client hace mucho más fácil mutar listas, ya que los schemas Collection son ahora el valor predeterminado para los Resources]]></summary>
        <content type="html"><![CDATA[<p>Las <a class="" href="https://dataclient.io/es/rest/api/Collection">Collections</a> permiten extender fácilmente Arrays y Objects
agregando nuevos miembros con <a class="" href="https://dataclient.io/es/rest/api/Collection#push">push</a> o <a class="" href="https://dataclient.io/es/rest/api/Collection#unshift">unshift</a>.
El nombre proviene de las <a href="https://backbonejs.org/#Collection" target="_blank" rel="noopener noreferrer" class="">Collections de Backbone</a>.</p>
<p>Las <a class="" href="https://dataclient.io/es/rest/api/Collection">Collections</a> son ahora el schema predeterminado de <a class="" href="https://dataclient.io/es/rest/api/resource#getlist">Resource.getList</a>.</p>
<div data-playground="true" class="playgroundQueryContainer_vBqa"><div class="playgroundContainer_sLUA row_YGZs" data-store-host="true"><div class="playgroundTextEdit_rt2K"><div class="playgroundHeader_Zx4K noupper_WDCF tabControls_trxh"><div class="tabs_m54V" role="tablist" aria-orientation="horizontal" aria-label="Archivos"><div role="tab" aria-selected="false" tabindex="-1" class="tab_bTGw">TodoResource</div><div role="tab" aria-selected="false" tabindex="-1" class="tab_bTGw">TodoItem</div><div role="tab" aria-selected="true" tabindex="0" class="tab_bTGw selected_QXZk">CreateTodo</div><div role="tab" aria-selected="false" tabindex="-1" class="tab_bTGw">TodoList</div></div></div><div class="editorDocs_INVk"><div class="playgroundEditor_lYwu hidden_Hh8i"></div><div class="playgroundEditor_lYwu hidden_Hh8i"></div><div class="playgroundEditor_lYwu"><div><pre class="prism-code language-tsx" style="margin:0;outline:none;padding:10px;font-family:inherit;color:#bfc7d5;background-color:transparent" spellcheck="false"><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token punctuation" style="color:#c792ea">{ </span>useController <span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'@data-client/react'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">import </span><span class="token punctuation" style="color:#c792ea">{ </span><span class="token class-name" style="color:#ffcb6b">TodoResource </span><span class="token punctuation" style="color:#c792ea">} </span><span class="token keyword" style="color:#7da4f6;font-style:italic">from </span><span class="token string" style="color:#b6d986">'./TodoResource'</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">
</span><span class="token-line"><span class="token keyword" style="color:#7da4f6;font-style:italic">export default function </span><span class="token class-name" style="color:#ffcb6b">CreateTodo</span><span class="token punctuation" style="color:#c792ea">({ </span>userId <span class="token punctuation" style="color:#c792ea">}: { </span>userId<span class="token punctuation" style="color:#c792ea">: </span><span class="token keyword" style="color:#7da4f6;font-style:italic">number </span><span class="token punctuation" style="color:#c792ea">}) {
</span></span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">const </span>ctrl <span class="token punctuation" style="color:#c792ea">= </span>useController<span class="token punctuation" style="color:#c792ea">();
</span></span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">const </span>handleKeyDown <span class="token punctuation" style="color:#c792ea">= </span><span class="token keyword" style="color:#7da4f6;font-style:italic">async </span>e <span class="token punctuation" style="color:#c792ea">=&gt; {
</span></span><span class="token-line">    <span class="token keyword" style="color:#7da4f6;font-style:italic">if </span><span class="token punctuation" style="color:#c792ea">(</span>e<span class="token punctuation" style="color:#c792ea">.</span>key <span class="token punctuation" style="color:#c792ea">=== </span><span class="token string" style="color:#b6d986">'Enter'</span><span class="token punctuation" style="color:#c792ea">) {
</span></span><span class="token-line">      ctrl<span class="token punctuation" style="color:#c792ea">.</span>fetch<span class="token punctuation" style="color:#c792ea">(</span><span class="token class-name" style="color:#ffcb6b">TodoResource</span><span class="token punctuation" style="color:#c792ea">.</span>getList<span class="token punctuation" style="color:#c792ea">.</span>push<span class="token punctuation" style="color:#c792ea">, {
</span></span><span class="token-line">        userId<span class="token punctuation" style="color:#c792ea">,
</span></span><span class="token-line">        title<span class="token punctuation" style="color:#c792ea">: </span>e<span class="token punctuation" style="color:#c792ea">.</span>currentTarget<span class="token punctuation" style="color:#c792ea">.</span>value<span class="token punctuation" style="color:#c792ea">,
</span></span><span class="token-line">        id<span class="token punctuation" style="color:#c792ea">: </span><span class="token class-name" style="color:#ffcb6b">Math</span><span class="token punctuation" style="color:#c792ea">.</span>random<span class="token punctuation" style="color:#c792ea">(),
</span></span><span class="token-line">      <span class="token punctuation" style="color:#c792ea">});
</span></span><span class="token-line">      e<span class="token punctuation" style="color:#c792ea">.</span>currentTarget<span class="token punctuation" style="color:#c792ea">.</span>value <span class="token punctuation" style="color:#c792ea">= </span><span class="token string" style="color:#b6d986">''</span><span class="token punctuation" style="color:#c792ea">;
</span></span><span class="token-line">    <span class="token punctuation" style="color:#c792ea">}
</span></span><span class="token-line">  <span class="token punctuation" style="color:#c792ea">};
</span></span><span class="token-line">  <span class="token keyword" style="color:#7da4f6;font-style:italic">return </span><span class="token punctuation" style="color:#c792ea">(
</span></span><span class="token-line">    <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token tag" style="color:#ff5590">div </span><span class="token attr-name" style="color:#ffcb6b">className</span><span class="token punctuation" style="color:#c792ea">=</span><span class="token string" style="color:#b6d986">"listItem nogap"</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">      <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token tag" style="color:#ff5590">label</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">        <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token tag" style="color:#ff5590">input </span><span class="token attr-name" style="color:#ffcb6b">type</span><span class="token punctuation" style="color:#c792ea">=</span><span class="token string" style="color:#b6d986">"checkbox" </span><span class="token attr-name" style="color:#ffcb6b">name</span><span class="token punctuation" style="color:#c792ea">=</span><span class="token string" style="color:#b6d986">"new" </span><span class="token attr-name" style="color:#ffcb6b">checked</span><span class="token punctuation" style="color:#c792ea">={</span><span class="token keyword" style="color:#7da4f6;font-style:italic">false</span><span class="token punctuation" style="color:#c792ea">} </span><span class="token attr-name" style="color:#ffcb6b">disabled </span>/&gt;
</span><span class="token-line">        <span class="token punctuation" style="color:#c792ea">&lt;</span><span class="token tag" style="color:#ff5590">input </span><span class="token attr-name" style="color:#ffcb6b">type</span><span class="token punctuation" style="color:#c792ea">=</span><span class="token string" style="color:#b6d986">"text" </span><span class="token attr-name" style="color:#ffcb6b">onKeyDown</span><span class="token punctuation" style="color:#c792ea">={</span>handleKeyDown<span class="token punctuation" style="color:#c792ea">} </span>/&gt;
</span><span class="token-line">      <span class="token punctuation" style="color:#c792ea">&lt;/</span><span class="token tag" style="color:#ff5590">label</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">    <span class="token punctuation" style="color:#c792ea">&lt;/</span><span class="token tag" style="color:#ff5590">div</span><span class="token punctuation" style="color:#c792ea">&gt;
</span></span><span class="token-line">  <span class="token punctuation" style="color:#c792ea">);
</span></span><span class="token-line"><span class="token punctuation" style="color:#c792ea">}
</span></span></pre></div></div><div class="playgroundEditor_lYwu hidden_Hh8i"></div></div></div><div class="previewWrapper_edd2 wide-embed-part"><div class="playgroundHeader_Zx4K previewHeader_MW_M"><span class="liveLabel_MHnJ"><span class="liveLabelText_k6qc">Vista previa en vivo</span></span><span class="routerSlot_CTii"></span><span class="previewControls_oxCt"><button type="button" class="clean-btn headerButton_h2KM fixturesToggle_OTR0" title="Fixtures" aria-label="Fixtures" aria-expanded="false" aria-controls="_R_r2qllq9_"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 20V4"></path><path d="m3 8 4-4 4 4"></path><path d="M17 4v16"></path><path d="m21 16-4 4-4-4"></path></svg></button><button type="button" class="clean-btn headerButton_h2KM resetButton_knTA" title="Reiniciar la vista previa" aria-label="Reiniciar la vista previa" disabled=""><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 12a9 9 0 1 0 2.64-6.36L3 8.3"></path><path d="M3 3v5.3h5.3"></path></svg></button></span></div><div class="fixturesAnchor_fieO"><div id="_R_r2qllq9_" class="fixturesPopover_bQwj wide-embed-part"></div></div><div class="playgroundResult_tefG"><div class="playground-preview playgroundPreview_rk9R"><div class="sheet_FVCk sheet" aria-busy="true"><div class="skeletonPage" role="status" aria-label="Loading"><span class="skeleton"></span><span class="skeleton"></span><span class="skeleton"></span><span class="skeleton"></span></div></div></div><div class="quickLookHost_EhLO stageHues_MizR"></div></div></div><div id="_R_2qllq9_" class="storeHost_N0SU"><div class="storeDrawer_Jaf2"><div class="drawerTabs_MT7c" role="tablist" aria-orientation="vertical"><button type="button" role="tab" class="clean-btn storeTab_EY4O" title="Mostrar acciones" aria-label="Acciones" aria-selected="false" tabindex="-1" aria-controls="_R_2qllq9_" data-store-toggle="actions"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13 12h8M13 18h8M13 6h8M3 12h1M3 18h1M3 6h1M8 12h1M8 18h1M8 6h1"></path></svg></button><button type="button" role="tab" class="clean-btn storeTab_EY4O" title="Mostrar el store" aria-label="Store" aria-selected="false" tabindex="0" aria-controls="_R_2qllq9_" data-store-toggle="store"><svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><ellipse cx="12" cy="5" rx="8" ry="3"></ellipse><path d="M4 5v14c0 1.66 3.58 3 8 3s8-1.34 8-3V5"></path><path d="M4 12c0 1.66 3.58 3 8 3s8-1.34 8-3"></path></svg></button></div></div></div></div></div>
<p>Actualizar es bastante sencillo, ya que se introdujeron <code>@data-client/rest/next</code> y <code>@data-client/react/next</code>
para permitir la adopción incremental de las nuevas APIs que cambian en esta versión. Esto convierte la actualización en sí en un simple
cambio de nombre en los imports.</p>
<p>Otros aspectos destacados incluyen</p>
<ul>
<li class=""><code>@data-client/rest</code>
<ul>
<li class=""><a href="https://github.com/reactive/data-client/pull/2542" target="_blank" rel="noopener noreferrer" class="">RestEndpoint.getHeaders asíncrono</a></li>
</ul>
</li>
<li class=""><code>@data-client/react</code>
<ul>
<li class=""><a href="https://github.com/reactive/data-client/pull/2545" target="_blank" rel="noopener noreferrer" class="">El valor de retorno de Controller.fetch() se desnormaliza a partir del schema</a></li>
<li class=""><a href="https://github.com/reactive/data-client/pull/2690" target="_blank" rel="noopener noreferrer" class="">Actualizaciones de los tipos de acción de Manager</a></li>
</ul>
</li>
</ul>
<p>Para todos los detalles, <a href="https://0.18.dataclient.io/es/blog/2023/07/04/v0.2-release-announcement#data-clientreact-02" target="_self" class="">sigue leyendo</a>:</p>
<!-- -->
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="data-clientreact-02">@data-client/react 0.2<a href="https://dataclient.io/es/blog/2023/07/04/v0.2-release-announcement#data-clientreact-02" class="hash-link" aria-label="Enlace directo al @data-client/react 0.2" title="Enlace directo al @data-client/react 0.2" translate="no">​</a></h3>
<p><a href="https://github.com/reactive/data-client/releases/tag/%40data-client%2Freact%400.2.0" target="_blank" rel="noopener noreferrer" class="">https://github.com/reactive/data-client/releases/tag/%40data-client%2Freact%400.2.0</a></p>
<p>La actualización puede hacerse de forma gradual, ya que todos los cambios se publicaron inicialmente en <code>/next</code>.</p>
<ol>
<li class="">
<p>Migra de forma incremental a las nuevas versiones importando desde <code>/next</code></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> useController <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/react/next'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div></code></pre></div></div>
</li>
<li class="">
<p>Actualiza a v0.2 - v0.4 (todas compatibles).</p>
<div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc"><span class="token function" style="color:rgb(130, 170, 255)">npm install </span><span class="token parameter variable" style="color:rgb(191, 199, 213)">--save</span> @data-client/rest@0.4.3<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div>
</li>
<li class="">
<p>Los imports pueden actualizarse de forma incremental después de la actualización. <code>/next</code> exporta lo mismo que el nivel superior.</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> useController <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div></code></pre></div></div>
</li>
</ol>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="changes">Cambios<a href="https://dataclient.io/es/blog/2023/07/04/v0.2-release-announcement#changes" class="hash-link" aria-label="Enlace directo al Cambios" title="Enlace directo al Cambios" translate="no">​</a></h4>
<ul>
<li class="">
<p><strong>Controller.fetch()</strong>: <a href="https://github.com/reactive/data-client/pull/2545" target="_blank" rel="noopener noreferrer" class="">2545</a> Controller.fetch() devuelve la forma desnormalizada cuando el Endpoint tiene un Schema</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">const </span><span class="token function-variable function" style="color:rgb(130, 170, 255)">handleChange </span><span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">async</span> e <span class="token operator" style="color:rgb(137, 221, 255)">=&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">const</span> todo <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token keyword" style="font-style:italic">await</span> ctrl<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">fetch</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><br></div><div class="token-line">    TodoResource<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>partialUpdate<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> id<span class="token operator" style="color:rgb(137, 221, 255)">:</span> todo<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>id <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> completed<span class="token operator" style="color:rgb(137, 221, 255)">:</span> e<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>currentTarget<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>checked <span class="token punctuation" style="color:rgb(199, 146, 234)">},</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line">  <span class="token comment" style="color:rgb(105, 112, 152);font-style:italic">// todo is Todo, we can use all its members and be type-safe</span><br></div><div class="token-line">  <span class="token builtin" style="color:rgb(130, 170, 255)">console</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">log</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>todo<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">pk</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(),</span> todo<span class="token punctuation" style="color:rgb(199, 146, 234)">.</span>title<span class="token punctuation" style="color:rgb(199, 146, 234)">);</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div></code></pre></div></div>
</li>
<li class="">
<p><strong>NetworkManager</strong>: La interfaz de NetworkManager cambió para admitir solo las nuevas acciones <a href="https://github.com/reactive/data-client/pull/2690" target="_blank" rel="noopener noreferrer" class="">2690</a></p>
</li>
<li class="">
<p>Las interfaces de <strong>SubscriptionManager/PollingSubscription</strong> se simplificaron con base en las nuevas acciones <a href="https://github.com/reactive/data-client/pull/2690" target="_blank" rel="noopener noreferrer" class="">2690</a></p>
</li>
</ul>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="removals-of-deprecated-items">Eliminación de elementos obsoletos<a href="https://dataclient.io/es/blog/2023/07/04/v0.2-release-announcement#removals-of-deprecated-items" class="hash-link" aria-label="Enlace directo al Eliminación de elementos obsoletos" title="Enlace directo al Eliminación de elementos obsoletos" translate="no">​</a></h4>
<ul>
<li class=""><a href="https://github.com/reactive/data-client/pull/2691" target="_blank" rel="noopener noreferrer" class="">2691</a>: Se eliminan DispatchContext y DenormalizeCacheContext</li>
</ul>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="deprecations">Deprecaciones<a href="https://dataclient.io/es/blog/2023/07/04/v0.2-release-announcement#deprecations" class="hash-link" aria-label="Enlace directo al Deprecaciones" title="Enlace directo al Deprecaciones" translate="no">​</a></h4>
<ul>
<li class="">controller.receive, controller.receiveError <a href="https://github.com/reactive/data-client/pull/2690" target="_blank" rel="noopener noreferrer" class="">2690</a></li>
<li class="">RECEIVE_TYPE <a href="https://github.com/reactive/data-client/pull/2690" target="_blank" rel="noopener noreferrer" class="">2690</a></li>
<li class="">MiddlewareAPI.controller (MiddlewareAPI es simplemente el propio controller) <a href="https://github.com/reactive/data-client/pull/2690" target="_blank" rel="noopener noreferrer" class="">2690</a>
<ul>
<li class=""><code>({controller}) =&gt; {}</code> -&gt; <code>(controller) =&gt; {}</code></li>
</ul>
</li>
</ul>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="data-clientrest-02">@data-client/rest 0.2<a href="https://dataclient.io/es/blog/2023/07/04/v0.2-release-announcement#data-clientrest-02" class="hash-link" aria-label="Enlace directo al @data-client/rest 0.2" title="Enlace directo al @data-client/rest 0.2" translate="no">​</a></h3>
<p><a href="https://github.com/reactive/data-client/releases/tag/%40data-client%2Frest%400.2.0" target="_blank" rel="noopener noreferrer" class="">https://github.com/reactive/data-client/releases/tag/%40data-client%2Frest%400.2.0</a></p>
<p>La actualización puede hacerse de forma gradual, ya que todos los cambios se publicaron inicialmente en <code>/next</code>.</p>
<ol>
<li class="">
<p><a href="https://github.com/reactive/data-client/pull/2606/files" target="_blank" rel="noopener noreferrer" class="">Migra de forma incremental a las nuevas versiones</a> importando desde <code>/next</code></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  RestEndpoint<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  createResource<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  GetEndpoint<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  MutateEndpoint<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest/next'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div></code></pre></div></div>
<p>Consulta las <a href="https://github.com/reactive/data-client/pull/2606/files" target="_blank" rel="noopener noreferrer" class="">migraciones</a> del directorio /examples como ejemplo</p>
</li>
<li class="">
<p>Actualiza a v0.2-0.7 (todas compatibles).</p>
<div class="terminal_yWbS"><div class="language-bash codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-bash codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line command_MhHc"><span class="token function" style="color:rgb(130, 170, 255)">npm install </span><span class="token parameter variable" style="color:rgb(191, 199, 213)">--save</span> @data-client/rest@0.7.6<br></div></code></pre></div></div><span role="tooltip" class="tip_wqpZ tip_cCYE">Ejecútalo en tu terminal</span></div>
</li>
<li class="">
<p>Los imports pueden actualizarse de forma incremental después de la actualización. <code>/next</code> exporta lo mismo que el nivel superior.</p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> RestEndpoint<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span> createResource <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div></code></pre></div></div>
</li>
</ol>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="changes-1">Cambios<a href="https://dataclient.io/es/blog/2023/07/04/v0.2-release-announcement#changes-1" class="hash-link" aria-label="Enlace directo al Cambios" title="Enlace directo al Cambios" translate="no">​</a></h4>
<ul>
<li class="">
<p>getRequestInit y getHeaders de RestEndpoint pueden devolver opcionalmente una promesa <a href="https://github.com/reactive/data-client/pull/2542" target="_blank" rel="noopener noreferrer" class="">2542</a></p>
<div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">import </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span> RestEndpoint <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">from </span><span class="token string" style="color:rgb(195, 232, 141)">'@data-client/rest/next'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export default class </span><span class="token class-name" style="color:rgb(255, 203, 107)">AuthdEndpoint</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&lt;</span><br></div><div class="token-line">  <span class="token class-name constant" style="color:rgb(130, 170, 255)">O </span><span class="token class-name keyword" style="color:rgb(255, 203, 107);font-style:italic">extends</span><span class="token class-name" style="color:rgb(255, 203, 107)"> RestGenerics </span><span class="token class-name operator" style="color:rgb(137, 221, 255)">= </span><span class="token class-name builtin" style="color:rgb(130, 170, 255)">any</span><span class="token class-name punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token class-name operator" style="color:rgb(137, 221, 255)">&gt; </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token class-name constant" style="color:rgb(130, 170, 255)">O</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">declare static</span> accessToken<span class="token operator" style="color:rgb(137, 221, 255)">?: </span><span class="token builtin" style="color:rgb(130, 170, 255)">string</span><span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">async </span><span class="token function" style="color:rgb(130, 170, 255)">getHeaders</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>headers<span class="token operator" style="color:rgb(137, 221, 255)">:</span> HeadersInit<span class="token punctuation" style="color:rgb(199, 146, 234)">) {</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">      <span class="token operator" style="color:rgb(137, 221, 255)">...</span>headers<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">      'Access-Token'<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token keyword" style="font-style:italic">await </span><span class="token function" style="color:rgb(130, 170, 255)">getOrFetchToken</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(),</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">} </span><span class="token keyword" style="font-style:italic">as</span> HeadersInit<span class="token punctuation" style="color:rgb(199, 146, 234)">;</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line"><span class="token keyword" style="font-style:italic">export const</span> TodoResource <span class="token operator" style="color:rgb(137, 221, 255)">= </span><span class="token function" style="color:rgb(130, 170, 255)">createResource</span><span class="token punctuation" style="color:rgb(199, 146, 234)">({</span><br></div><div class="token-line">  urlPrefix<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'https://jsonplaceholder.typicode.com'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  path<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'/todos/:id'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  schema<span class="token operator" style="color:rgb(137, 221, 255)">:</span> Todo<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">  Endpoint<span class="token operator" style="color:rgb(137, 221, 255)">:</span> AuthdEndpoint<span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">});</span><br></div></code></pre></div></div>
<p>BREAKING: Llamar a super.getRequestInit() devolverá una promesa, así que debes resolverla:</p>
</li>
</ul>
<figure class="figure_HN5N"><div class="playgroundQueryContainer_vBqa frame_CKNA"><div class="playgroundContainer_sLUA standaloneEditor_OHub diffFrame_cPpK frame_CKNA staticDiff_f2UX"><div class="grid_iD3H wrap_ES0G"><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">Before</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">AuthdEndpoint</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&lt;</span><br></div><div class="token-line">  <span class="token class-name constant" style="color:rgb(130, 170, 255)">O </span><span class="token class-name keyword" style="color:rgb(255, 203, 107);font-style:italic">extends</span><span class="token class-name" style="color:rgb(255, 203, 107)"> RestGenerics </span><span class="token class-name operator" style="color:rgb(137, 221, 255)">= </span><span class="token class-name builtin" style="color:rgb(130, 170, 255)">any</span><span class="token class-name punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token class-name operator" style="color:rgb(137, 221, 255)">&gt; </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token class-name constant" style="color:rgb(130, 170, 255)">O</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token function" style="color:rgb(130, 170, 255)">getRequestInit</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>body<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span> RequestInit <span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">      <span class="token operator" style="color:rgb(137, 221, 255)">...</span><span class="token keyword" style="font-style:italic">super</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getRequestInit</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>body<span class="token punctuation" style="color:rgb(199, 146, 234)">),</span><br></div><div class="token-line">      credentials<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'same-origin'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div><div class="language-ts codeBlockContainer_mQmQ theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:transparent"><div class="codeBlockTitle_kY6l">After</div><div class="codeBlockContent_t_Hd"><pre tabindex="0" class="prism-code language-ts codeBlock_RMoD thin-scrollbar" style="color:#bfc7d5;background-color:transparent"><code class="codeBlockLines_AclH"><div class="token-line"><span class="token keyword" style="font-style:italic">class </span><span class="token class-name" style="color:rgb(255, 203, 107)">AuthdEndpoint</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&lt;</span><br></div><div class="token-line">  <span class="token class-name constant" style="color:rgb(130, 170, 255)">O </span><span class="token class-name keyword" style="color:rgb(255, 203, 107);font-style:italic">extends</span><span class="token class-name" style="color:rgb(255, 203, 107)"> RestGenerics </span><span class="token class-name operator" style="color:rgb(137, 221, 255)">= </span><span class="token class-name builtin" style="color:rgb(130, 170, 255)">any</span><span class="token class-name punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line"><span class="token class-name operator" style="color:rgb(137, 221, 255)">&gt; </span><span class="token keyword" style="font-style:italic">extends </span><span class="token class-name" style="color:rgb(255, 203, 107)">RestEndpoint</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&lt;</span><span class="token class-name constant" style="color:rgb(130, 170, 255)">O</span><span class="token class-name operator" style="color:rgb(137, 221, 255)">&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">  <span class="token keyword" style="font-style:italic">async </span><span class="token function" style="color:rgb(130, 170, 255)">getRequestInit</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>body<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">any</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token builtin" style="color:rgb(130, 170, 255)">Promise</span><span class="token operator" style="color:rgb(137, 221, 255)">&lt;</span>RequestInit<span class="token operator" style="color:rgb(137, 221, 255)">&gt; </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">    <span class="token keyword" style="font-style:italic">return </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><br></div><div class="token-line">      <span class="token operator" style="color:rgb(137, 221, 255)">...</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token keyword" style="font-style:italic">await super</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token function" style="color:rgb(130, 170, 255)">getRequestInit</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span>body<span class="token punctuation" style="color:rgb(199, 146, 234)">)),</span><br></div><div class="token-line">      credentials<span class="token operator" style="color:rgb(137, 221, 255)">: </span><span class="token string" style="color:rgb(195, 232, 141)">'same-origin'</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><br></div><div class="token-line">    <span class="token punctuation" style="color:rgb(199, 146, 234)">};</span><br></div><div class="token-line">  <span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div><div class="token-line"><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></div></code></pre></div></div></div></div></div></figure>
<ul>
<li class="">createResource().getList usa una Collection, a la que .create agrega elementos <a href="https://github.com/reactive/data-client/pull/2593" target="_blank" rel="noopener noreferrer" class="">2593</a>
<ul>
<li class=""><code>Resource.create</code> agregará automáticamente a la lista<!-- -->
<ul>
<li class=""><code>Resource.getList.push</code> es idéntico a <code>Resource.create</code></li>
</ul>
</li>
<li class=""><strong>Elimina</strong> cualquier <code>Endpoint.update</code>, ya que no es necesario y no funcionará</li>
</ul>
</li>
<li class="">Los parámetros de <code>GetEndpoint</code> y <code>MutateEndpoint</code> cambiaron a lo que eran <code>NewGetEndpoint</code> y <code>NewMutateEndpoint</code>.</li>
<li class="">Los genéricos de createResource() cambiaron a <code>O extends ResourceGenerics</code>. Esto permite personalizar el tipo del Resource con body y searchParams <a href="https://github.com/reactive/data-client/pull/2593" target="_blank" rel="noopener noreferrer" class="">2593</a>
<ul>
<li class=""><code>createGithubResource&lt;U extends string, S extends Schema&gt;</code> -&gt; <code>createGithubResource&lt;O extends ResourceGenerics&gt;</code></li>
</ul>
</li>
</ul>
<p><a href="https://github.com/reactive/data-client/pull/2692" target="_blank" rel="noopener noreferrer" class="">PR #2692 que incorpora /next al nivel superior</a></p>
<h4 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="removals-of-deprecated-items-1">Eliminación de elementos obsoletos<a href="https://dataclient.io/es/blog/2023/07/04/v0.2-release-announcement#removals-of-deprecated-items-1" class="hash-link" aria-label="Enlace directo al Eliminación de elementos obsoletos" title="Enlace directo al Eliminación de elementos obsoletos" translate="no">​</a></h4>
<ul>
<li class=""><a href="https://github.com/reactive/data-client/pull/2690" target="_blank" rel="noopener noreferrer" class="">2690</a>: Se elimina el obsoleto <code>Endpoint.optimisticUpdate</code> -&gt; usa <code>Endpoint.getOptimisticResponse</code></li>
<li class=""><a href="https://github.com/reactive/data-client/pull/2688" target="_blank" rel="noopener noreferrer" class="">2688</a> Se elimina la compatibilidad con <code>FetchShape</code>.</li>
</ul>
<h3 class="anchor anchorTargetHideOnScrollNavbar_Qii3" id="upgrade-support">Soporte para la actualización<a href="https://dataclient.io/es/blog/2023/07/04/v0.2-release-announcement#upgrade-support" class="hash-link" aria-label="Enlace directo al Soporte para la actualización" title="Enlace directo al Soporte para la actualización" translate="no">​</a></h3>
<p>Como siempre, si tienes algún problema o pregunta, no dudes en unirte a nuestro <a href="https://discord.gg/wXGV27xm6t" target="_blank" rel="noopener noreferrer" class=""><img decoding="async" loading="lazy" src="https://img.shields.io/discord/768254430381735967.svg?style=flat-square&amp;colorB=758ED3" alt="Chat" class="img_SS3x"></a> o <a href="https://github.com/reactive/data-client/issues/new/choose" target="_blank" rel="noopener noreferrer" class="">reportar un error</a></p>]]></content>
        <author>
            <name>Nathaniel Tucker</name>
            <uri>https://github.com/ntucker</uri>
        </author>
        <category label="Versiones" term="Versiones"/>
        <category label="REST" term="REST"/>
        <category label="Resources" term="Resources"/>
        <category label="Endpoint" term="Endpoint"/>
        <category label="Collections" term="Collections"/>
    </entry>
</feed>