total.js 1.9.0 发布,Node.js 的 MVC 框架

oschina
 oschina
发布于 2015年07月30日
收藏 30

total.js 1.9.0 发布,此版本现已提供下载:

更新内容:

  • added: (IMPORTANT) ISOMORPHIC using

  • added: (IMPORTANT) new flag mobile (mobile routing), you can create a route to mobile device

  • added: (IMPORTANT) new flag delay for long time operations (it removes timeout)

  • added: readonly req.mobile -> returns boolean

  • added: new view tag: @{mobile} –> returns boolean

  • added: new view tag: @{isomorphic} –> returns Object with isomorphic objects

  • added: config['disable-clear-temporary-directory'] = false (after start)

  • added: config['allow-compatibility'] = false - a backward compatibility mode

  • added: config['default-timezone']

  • added: config['directory-isomorphic']

  • added: config['directory-private']

  • added: F.path.private([filename])

  • added: F.path.isomorphic([filename])

  • added: Controller.ping() for WebSocket

  • added: global.DB() --> same as global.DATABASE()

  • added: global.isomorphic --> returns framework.isomorphic --> returns isomorphic objects

  • added: global.is_client and global.is_server for isomorphic

  • added: cache for HTTP routing

  • added: RegExp routing F.route('/{/^\\d+$/}', ...)

  • added: F.responseBinary(req, res, contentType, buffer, [type], [download], [headers])

  • added: SchemaBuilderEntity.filter(custom, [model], [reverse])

  • added: SchemaBuilderEntity.trim = true(enable/disable trim strings (default: true))

  • added: Number.prototype.add(value, [decimals]) -> supports percentage

  • added: Date.prototype.toUTC([ticksOnly])

  • added: Date.prototype.extend() -> extend current datetime about new date or time (more in documentation)

  • added: F.stats.request.mobile, F.stats.request.desktop

  • added: res.setHeader('Vary', 'Accept-Encoding, User-Agent') for same url addresses and different devices (desktop vs mobile)

  • added: binary - total --translatecsv

  • added: controller.jsonp(method_name, obj, [headers], [beautify], [replacer]);

  • added: CSS variables likes sass, example: $color: red;

  • added: CSS nesting

  • added: modificators for dynamic modification before compilation: views, styles and scripts

  • added: TransformBuilder

  • added: F.load(debug, load_types, [path]);

  • added: F.isWorker (is true when is called F.load())

  • added: F.isCluster (is true when the framework is running in the cluster)

  • added: F.logmail(address, [subject], body, [callback]) --> send e-mail message as plain text

  • added: Array.unique([property]) by Andrea Sessa

  • added: Array.pair(array, property, fn(itemA, itemB), [remove]) - pair arrays

  • added: String.base64ToBuffer();

  • added: terminal -> tpm unpack [package_name] [optional: target_directory]

  • added: versions is applied to raw HTML

  • added: versions supports auto-mapping

  • added: sync2(), e.g. sync2(fn), diff with v1: sync(fn)() and v2: sync2(fn)

  • added: "dependencies" file for installing dependencies (modules, packages, etc.)

  • added: @{nocompress html}, @{nocompress js}, @{nocompress css}, @{nocompress all}

  • added: req.authorize(callback(err, userprofile, isAuthorized))

  • added: res.content(code, body, type, [compress]) -> alias for F.responseContent()

  • added: F.localize(name, path, [middleware], [options]) - auto translating static files

  • added: F.listener(req, res) -> for multiple server listeners

  • added: F.restful(url, flags, onQuery, onGet, onSave, onDelete) -> creates routing

  • added: F.onSchema(req, group, name, callback(err, body)) -> for custom schemas

  • added: @{import(filename1, filename2, filenameN)}

  • added: SchemaBuilderEntity.setError(function(error, model, type, name));

  • added: F.snapshot(url, filename, [callback]);

  • added: CLEANUP(stream, [callback]) - clean up readable streams

  • added: configs directory

  • added: F.behaviour(url, flags);

  • added: behaviour: disable-measuring (default: false)

  • added: behaviour: disable-middleware (default: false)

更新

  • updated: (IMPORTANT) routing: json flag is not required for receiving incomming data as JSON

  • updated: F.mail(address, subject, view, [model], [callback], [language]) added language

  • updated: F.view(name, model, [layout], [repository], [language]) added language

  • updated: F.route(url, ...), F.websocket(url, ...) --> URL can be function(url, req, [flags])

  • updated: versions affects F.map() and F.merge()

  • updated: controller.mail(address, subject, view, [model], [callback], [language]) added language

  • updated: config['allow-performance'] is set to true

  • updated: (IMPORTANT) F.map(url, filename/directory, [filter]) supports mapping directories

  • updated: (IMPORTANT) arguments order SchemaBuilderEntity.setValidate(function(name, value, path, model, schema){})

  • updated: (IMPORTANT) U.extend(target, source, [rewrite]); --> rewrite is by default: true

  • updated: SchemaBuilderEntity.setPrepare(function(name, value, index, model){}) --> model is new

  • updated: SchemaBuilderEntity.define(name, value, required, [custom]) --> custom is new

  • updated: HTML compressor

  • updated: favicon (removed rel="icon")

  • updated: binary tpm create [package] [directory] (added argument [package], [directory])

  • updated: better handling middleware errors and added prevention of "memory leak"

  • updated: (IMPORTANT): Websocket ping is set to 3 minutes

  • updated: framework responds for bad requests with HTTP 403

  • updated: Mail (added support for Office365)

  • updated: Date.prototype.add() supports e.g. Date.prototype.add('25 days')

  • updated: String.prototype.params() -> supports double "{{"

  • updated: F.schedule(date, [repeat], fn) --> added [repeat]

  • updated: F.responseStream() and controller.stream() added [nocompress] argument

  • updated: binary tpm supports install package from different URL

  • removed: XSS check

修复

  • fixed: controller.binary(buffer, contentType, [download], [headers])

  • fixed: routing DELETE

  • fixed: binary (creating empty-project, bad record with smtp options)

  • fixed: calling generator action

  • fixed: binary --translate (filenames)

  • fixed: SchemaBuilderEntity prepare (problem with nullable Boolean)

  • fixed: (IMPORTANT) 431 system route

  • fixed: F.log(), F.logger() –> problem with objects, reported by Nikita Shmidt

  • fixed: Number formatting (problem with negative numbers)

改进

  • improved: performance +15%

  • improved: code optimalization

  • improved: Date.prototype.format()

  • improved: String.prototype.format()

  • improved: Number.prototype.pluralize()

  • improved: view debugging

向后兼容

重要:
exports.install = function(framework) {} framework variable is removed but with backward compatibility (config['allow-compatibility']).

total.js 是个 web 应用框架,使用 JavaScript,HTML,CSS 和 Node.js(MVC) web 应用框架来构建 web 网站和 web 应用。

Node.js web framework - totaljs

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处,尊重他人劳动共创开源社区。
转载请注明:文章转载自 OSCHINA 社区 [http://www.oschina.net]
本文标题:total.js 1.9.0 发布,Node.js 的 MVC 框架
加载中

最新评论(6

水煮你
水煮你

引用来自“你是晴天”的评论

这样都敢写1.0B.我直接登陆返回登陆页面。
打得一手好五笔
chworld
chworld
比express,强?
Tian_Ya
Tian_Ya
好东西,但是我多半收藏,然后搁置,等用到node的时候或许会翻出来。这么做的人有多少呢
yak
yak
全部写到一个文件里吗? 怎么分模块呢?
双城记
双城记

引用来自“开源中国首席一失足成千古风流人物以稀为贵”的评论

我讨厌框架.
23333那你自己造轮子去把
返回顶部
顶部