New version v1.2.0

140 views
Skip to first unread message

Peter Širka

unread,
Feb 17, 2014, 11:51:03 AM2/17/14
to
I published a new version v1.2.0.

New demo example (total.js + mongoose = Blog):

New features:

I rewrote a parser of Views and Templates, now is really good and fast.

Changes:

- new: NEW TEMPLATE ENGINE 2.0

- added: route to website, route to file and route to websocket is possible everywhere
- added: node harmony functions (see example)
- added: gc() into framework.on('service')
- added: config['allow-performance'] true/false (default, false)
- added: config['default-image-converter'] (default "gm" - GraphicsMagick, another possibility: "im" - ImageMagick)
- added: new views/templates/contents cache
- added: framework.problem(message, [name], [uri], [ip]);
- added: framework.on('problem', message, [name], [uri], [ip])
- added: framework.problems;
- added: req.language;
- added: controller.title()
- added: controller.description()
- added: controller.keywords()
- added: controller.problem(message)
- added: controller.memorize(key, expire, fnTo, [fnFrom]) - cache for controller.view(), controller.json(), controller.plain()
- added: Array.prototype.trim()
- added: Array.prototype.wait()
- added: Array.prototype.async()
- added: String.prototype.hash([type])
- added: Pagination.next([format]), Pagination.prev([format])
- added: utils.isRegExp(obj)

- updated: license
- updated: parsing of configuration: # and // is a comment
- updated: auto-vendor-prefixes (updated linear-gradient prioraty according to w3schools.com)
- updated: websocket.send(message, [id], [blacklist]), id and blacklist can be a function
- updated: controller.view400([problem])
- updated: controller.view403([problem])
- updated: controller.view404([problem])
- updated: controller.view501([problem])
- updated: controller.plain(contentBody, [headers]) - added JSON serialized for objects
- updated: controller.json(obj, [header], [beaufity]);
- updated: framework.usage([detailed]) - returns OBJECT
- updated: FrameworkCache.removeAll(search or regexp-pattern)
- updated: @{sitemap} is currently: @{sitemap()}
- updated: PageBuilder
- updated: @{template()} and controller.template() - default repository is controller repository

- removed: border-radius and box-shadow from auto-vendor-prefixes

- obsolete: Array.prototype.waiting()

- fixed: controller.view500()
- fixed: controller.proxy(), utils.request(), utils.download() - problem with NGINX, missing Content-Length header
- fixed: WebSocket skips throwing error (socket close, EPIPE)
- fixed: mail (SPAM fixes)
- fixed: buffer.write (new node => 0.11.11)
- fixed: IP and heroku deploy

- rewrited: view engine
- rewrited: template engine (according to view engine)

- improvements: views
- improvements: templates
- improvements: partial routing

IMPORTANT: framework.usage() returns OBJECT
IMPORTANT: markup of template is OBSOLETE. Templates support only view markup.

felipo....@gmail.com

unread,
Feb 17, 2014, 9:05:53 AM2/17/14
to tot...@googlegroups.com
Excelente Peter, estou gostando muito do Total.js sou um novo usuário dele e pretendo criar um micro blog usando ele. Sou do Brasil e acompanha sua dedicação a alguns dias, acho muito bom sua documentação, tutorial e exemplos do que é possível fazer com o total.js .

Seria também legal um exemplo completo, como se fez com o Blog, a minha maior dificuldade fica na parte de autorização, mas com seus exemplos creio que irei aprender bem, continue assim :) .

Translation:
Excellent Peter, I'm really enjoying the Total.js I am a new user of it and intend to create a micro blog using it. I'm from Brazil and accompanies his dedication to a few days, I find very good documentation, tutorial and examples of what you can do with the total.js.

It would also be cool a full example, as was done with the Blog, my biggest difficulty is in part of consent, but with your examples I believe I will learn well, keep at it:).

Ω Alisson

unread,
Feb 17, 2014, 12:12:58 PM2/17/14
to felipo....@gmail.com, tot...@googlegroups.com
Hi Felipo, I'm Brazilian too and been doing some nice stuff with Total.js, if you have any problems and need to speak in Portuguese, feel free to email me



--
You received this message because you are subscribed to the Google Groups "total.js - web framework for node.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to totaljs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Felipo Antonoff

unread,
Feb 17, 2014, 3:49:45 PM2/17/14
to tot...@googlegroups.com, felipo....@gmail.com
Obrigado pelo apoio Alisson, precisando vou chamar sim, se teria algum exemplo completo do uso do authorization . Também queria saber se você tem ideia de como é feito para usar módulos extras, o Peter sempre coloca uns exemplos, mas queria saber se tem algum geral. Por exemplo usar módulo de validação externo, linguagem e etc.

Qualquer coisa pode contar comigo também, sou Desenvolvedor Web vindo do PHP, meu site http://www.codemarket.com.br/ .

Thanks for the support I need Alisson, Yes, if you have a complete example of the use of the authorization. Also wanted to know if you have any idea how it is done to use extra modules, Peter always put some examples, but I was wondering if you had any. For example use external validation, module and language etc.

Anything you can count on me too, I'm Web Developer coming from PHP, my site http://www.codemarket.com.br/.

Al

unread,
Feb 17, 2014, 7:36:22 PM2/17/14
to tot...@googlegroups.com
Excellent work peter, will give it a test run...

chico...@gmail.com

unread,
Feb 17, 2014, 7:52:09 PM2/17/14
to tot...@googlegroups.com
as of few hours ago i am getting this error

npm http GET https://registry.npmjs.org/total.js
npm http 304 https://registry.npmjs.org/total.js
npm http GET https://registry.npmjs.org/total.js/-/total.js-1.2.0.tgz
npm http 200 https://registry.npmjs.org/total.js/-/total.js-1.2.0.tgz
npm ERR! Error: shasum check failed for /var/folders/72/wc6hkftd69bcnpbbb2nl51080000gn/T/npm-4040-U9NZa3dP/1392684455443-0.6840161082800478/tmp.tgz
npm ERR! Expected: 95cc9fcd595f35075f68545a29c4b027f92dd091
npm ERR! Actual: 8bbc7668623c0d59a20a3dd92f4cf7987944a9c8
npm ERR! at /usr/local/Cellar/node/0.10.22/lib/node_modules/npm/node_modules/sha/index.js:38:8
npm ERR! at ReadStream.<anonymous> (/usr/local/Cellar/node/0.10.22/lib/node_modules/npm/node_modules/sha/index.js:85:7)
npm ERR! at ReadStream.EventEmitter.emit (events.js:117:20)
npm ERR! at _stream_readable.js:920:16
npm ERR! at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <np...@googlegroups.com>

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.22/bin/node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Applications/work/total/demo
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Applications/work/total/demo/npm-debug.log
npm ERR! not ok code 0

toni campins

unread,
Feb 23, 2014, 5:41:03 AM2/23/14
to tot...@googlegroups.com
With the last new version i have problems with undefinded or null values on views.

"Cannot call method 'toString' of undefined"

Peter Širka

unread,
Feb 23, 2014, 6:27:59 AM2/23/14
to tot...@googlegroups.com
Hi,
it's possible because the old view-engine repairs undefined values ... But it was a bug ... so if you had number with "0" then view-engine renders empty string because had this condition: 0 || ''.
New render-engine renders raw values and then converts this value into the string and encodes it. So you must check all values in view and you must to undefined value define value.

Solution:
you must declare all values in controller or create a condition in the view.

repository.myUndefined = '';
model
.myUndefined = '';

or

@{if repository.myUndefined}
is defined
@{else}
is undefined
@{endif}

Thanks :)

toni campins

unread,
Feb 23, 2014, 6:39:13 AM2/23/14
to tot...@googlegroups.com
Thanks a lot Peter.
Reply all
Reply to author
Forward
0 new messages