Skip to content

Instantly share code, notes, and snippets.

TroopJS - A brief review

This is a brief list of love and hates of the TroopJS framework from a UI developer's perspective, sort of my reflections as a TroopJS developer for one year, willing to inspire those who have used it in the past, or is likely to embrace it in the near future.

The good parts

Component composition is sweet, signals are perfect for component lifecycle events, component is a nature isolated organization of UI feature.

@lupincn
lupincn / gist:8db4a24880ae3ee2ecf6
Last active August 29, 2015 14:08
TroopJS Comments

Good Parts

  1. Publish/Subscription patten make widget communication more easier and more accessible.
  2. Promise way make asynchronous more clear and could be controlled.
  3. Query cache is very useful and make performance really good.
  4. Use pure EMCAScript standard and new feature also let our code more easily to adapt modern browser.

Bad Parts

  1. Template Engine is too obsolete as current view, should change to more modern language.
  2. Each version upgrade is so painful for developer. Too much thing can't be compatible.
  3. Sometime, memory type subscription is used carefully to avoid UI mistakes.
@lupincn
lupincn / index_1.html
Last active December 10, 2015 22:18
Sample code about TroopJS memory leak in IE7
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
function add(){
for (var i = 0; i < 500; i++) {
$('<div style="background-color: #A68585;margin: 2px 0;width: 100px;height: 30px;">' + i + '</div>').appendTo('.box');
}
}