Show HN: Sapper.js – towards a better web app framework
I think this premise is wrong:<p>&gt; 2. As a corollary, your app&#x27;s codebase should be universal — write once for server and client<p>This is a mistake a lot of developers make. The server and client are not the same. As far as rendering HTML goes, the client does a superset of what the server does.<p>This means either the framework has to be without leaks; meaning you never need raw DOM access at all, OR it means once you do need lower-level access (for doing animations, for example) you are in trouble. You now have a problem where you have some code that needs to only run in the client. So you have to special case that code to check if running on the server. And you need a strategy for what to do in the server (do you just omit this part, or do you try to do something more basic or what?)<p>In my experience you run into more pain trying to plug the leaks in these &quot;universal&quot; apps than you would if you just had separate server and client templates. Remember that the rule of 3 is the rule of 3, not the rule of 2.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Rule_of_three_(computer_programming)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Rule_of_three_(computer_progra...</a>