title: How to force Meteor's Blaze to batch changes applied to #each block
body: <p>I have a template which is mostly equivalent to:</p>
  
  <pre><code>&lt;div class="line"&gt;
  {{#each part in line}}
    &lt;span class="part"&gt;{part}&lt;/span&gt;
  {{/each}}
  &lt;/div&gt;
  </code></pre>
  
  <p>where the <code>line: string[]</code> is a partition of a single line into one or more parts. The problem is that when the content of <code>line</code> changes, the template tries to match old elements with new elements (which is fine) and applies changes one by one (which is not fine) to the DOM. In particular if the old value of <code>line</code> was <code>["Hello","world"]</code> and the new one is <code>["Hello world"]</code>, then there is a short period of time when the user is presented new value of <code>line[0]</code> combined with old value of <code>line[1]</code>, which is <code>["Hello world","world"]</code>. Most of the time this gets unnoticed, but in case when the parts are long enough compared to the screen width, it might happen that <code>&lt;span class="part"&gt;Hello world&lt;/span&gt;&lt;span class="part"&gt;world&lt;/span&gt;</code> does not fit into a single line, which in turn causes the whole further content to be moved one line lower, only to be later moved again one line higher when <code>line[1]</code> gets finally removed.</p>
  
  <p>One solution which I currently use is to replace the whole <code>#each</code> loop with custom helper <code>{{{ helpMeRenderThisLine line }}}</code> which builds the HTML string manually, but obviously this violates separation of concerns and my code style.</p>
  
  <p>I'm new to Meteor, but these are the directions I would like to investigate:</p>
  
  <ul>
  <li>Is there a way to render a loop non-reactively? I've heard there was
  something like <code>#constant</code> block, but it is no longer supported. </li>
  <li>Is there a way to "batch" the whole updating process into a single DOM
  reflow? </li>
  <li>Is there a way to use the momentum package to remove the
  flicker? </li>
  <li>Is there a way to use a smaller Blaze template to render the
  single line in non-reactive fashion?</li>
  </ul>