Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think there might be some confusion in your question about the way the DOM works.</p> <p>Whilst it is possible to render an app that has a DOM on the node.js server using a library like <a href="https://github.com/tmpvar/jsdom" rel="nofollow">jsDom</a>, when that same page is served to the client, it has a completely different DOM instance, and there isn't any way to communicate between the two of them. So any changes that your app made to the DOM on the server can't easily be propagated to the DOM on the client.</p> <p>If your component seems to be running slowly in the browser, then you're much more likely to get a good result out of working on the component to make it more efficient than you are by trying to offload the DOM manipulation to the server.</p> <p>If you look at the two different scenarios and break them down into what the browser actually does, you'll see why it's a bad idea.</p> <p>Scenario (1) - Render Dom changes on the server</p> <ol> <li>Step 1 - Client Loads initial html page from server (slow)</li> <li>Step 2 - User interacts with page on client(fast)</li> <li>Step 3 - Client sends the user interaction back to server (vslow)</li> <li>Step 4 - Server loads a Dom(slow)</li> <li>Step 5 - Server runs Dom changes (fast)</li> <li>Step 6 - Server sends re-rendered HTML back to client (slow)</li> <li>Step 7 - Client renders new HTML from Server (slow)</li> </ol> <p>Scenario (2) - Render Dom changes on client</p> <ol> <li>Step 1 - Client Loads initial html page from server (slow)</li> <li>Step 2 - User interacts with page on client(fast)</li> <li>Step 3 - Client runs Dom changes (fast)</li> <li>Step 4 - Client renders changed DOM (Slow)</li> </ol> <p>You will be much better off just working on your component to make it faster than to try offloading the DOM rendering to the server. <a href="http://net.tutsplus.com/tutorials/javascript-ajax/10-ways-to-instantly-increase-your-jquery-performance/" rel="nofollow">Here's a good blog post on how to speed up jquery code</a>.</p> <p>If you really do want to go ahead with the workflow you suggested in the question, I'd recommend looking into the <a href="https://github.com/tmpvar/jsdom" rel="nofollow">jsDom</a> library, but I really wouldn't recommend it.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload