Marko:
<greeting
name=fullName
message-count=30Below are the sizes of various UI libraries. The JavaScript bundles for each library includes the minimal code to render a very basic UI component in the browser. That is, the bundle includes the UI library and the code for a single UI component. The JavaScript bundle is generated using Rollup with NODE_ENV=production and all helpful optimizations are used to reduce the code size (envify, uglifyjs, minprops, etc.).
[marko]
gzip: 11,802 bytes
min: 32,289 bytes
[preact]
gzip: 4,401 bytes
min: 10,272 bytes
| module.exports=function anonymous(it | |
| /**/) { | |
| var encodeHTML = typeof _encodeHTML !== 'undefined' ? _encodeHTML : (function (doNotSkipEncoded) { | |
| var encodeHTMLRules = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "/": "/" }, | |
| matchHTML = doNotSkipEncoded ? /[&<>"'\/]/g : /&(?!#?\w+;)|<|>|"|'|\//g; | |
| return function(code) { | |
| return code ? code.toString().replace(matchHTML, function(m) {return encodeHTMLRules[m] || m;}) : ""; | |
| }; | |
| }());var out='Hello '+encodeHTML(it.name)+'! ';if(it.colors && it.colors.length){out+=' <ul> ';var arr1=it.colors;if(arr1){var color,i1=-1,l1=arr1.length-1;while(i1<l1){color=arr1[i1+=1];out+=' <li class="color">'+encodeHTML(color)+'</li> ';} } out+='</ul>';}else{out+='<div> No colors!</div>';}return out; | |
| } |
| { | |
| "raptor": { | |
| "dependencies": [ | |
| { | |
| "include-pattern": "\\.*", | |
| "extension-pattern": "_([A-Za-z0-9]+)\\." | |
| } | |
| ] | |
| } | |
| } |
| { | |
| "settings" : { | |
| "foo" : "low", | |
| "bar" : "high", | |
| "baz" : "low" | |
| } | |
| } |
| raptor.define( | |
| 'my.module', | |
| { | |
| hello: "World" | |
| }); | |
| raptor.define( | |
| 'my.module', | |
| function() { | |
| return { |
| <!-- "LOGIC-LESS": --> | |
| {{#cartEmpty}} | |
| <div> | |
| Your shopping cart is empty! | |
| </div> | |
| {{/cartEmpty}} | |
| {{#cartNotEmpty}} | |
| <ul> | |
| {{cartItems}} |
| ----------------- | |
| Option A: | |
| Hello {{name}}! | |
| {{#hasItems}} | |
| <ul> | |
| {{#items}} | |
| <li>{{.}}</li> | |
| {{/items}} | |
| </ul> |