Node.js 的 MVC 框架,total.js 1.9.3 發布

jopen 10年前發布 | 5K 次閱讀 total.js

total.js 是個 web 應用框架,使用 JavaScript,HTML,CSS 和 Node.js(MVC) web 應用框架來構建 web 網站和 web 應用。

Node.js 的 MVC 框架,total.js 1.9.3 發布

total.js 1.9.3 發布,此版本更新內容:

新特性

  • added: (IMPORTANT) merging supports BLOCKS (.js,.css), e.g. F.merge('merge.js', 'fileA.js#management,common', 'fileB.js#management')

    </li>

  • added: (IMPORTANT) a route with schema binding can contain filter e.g. *Schema#update or *Group\Schema#create --> the framework validates only fields by filter

    </li>

  • added: TRANSFORM([transform], obj)

    </li>

  • added: NEWTRANSFORM(name, fn, [isDefault]) --> alias for TransformBuilder.addTransform()

    </li>

  • added: packages can be stored as directories (recommended for debug mode only)

    </li>

  • added: F.localize(name, url, [middleware], [options], [minify]) --> minify argument

    </li>

  • added: email supports calendar (.ics) request sending

    </li>

  • added: SchemaBuilderEntity.make(function(schema))

    </li>

  • added: F.install() supports packages mapping

    </li>

  • added: Support for unicode routing

    </li>

  • added: Packages can be loaded in framework structure (/controllers/, /modules/) exports.booting = true

    </li>

  • added: route flags can contains object --> the object is an additional options for middleware

    </li>

  • added: Utils.btoa(str) --> returns base64

    </li>

  • added: Utils.atob(str) --> returns binary

    </li>

  • added: global.TRY(fnScope, [fnError]) --> creates safe scope (more in documentation)

    </li>

  • added: Utils.getExtension(filename)

    </li>

  • added: @{head} can be imported as @{import('head')}

    </li>

  • added: @{meta} can be imported as @{import('meta')}

    </li>

  • added: controller.cookie('KEY') --> for reading

    </li>

  • added: controller.cookie('KEY', 'VALUE', expire, [options]) --> for writting

    </li>

  • added: framework.onParseQuery(function(value)) --> for parsing values from the requests

    </li>

  • added: framework.onParseXML(function(value)) --> for parsing values from the requests

    </li>

  • added: framework.onParseJSON(function(value)) --> for parsing values from the requests

    </li> </ul>

    更新

    • updated: (IMPORTANT) F.onValidation() was renamed to F.onValidate()

      </li>

    • updated: (IMPORTANT) SchemaBuilderEntity.onValidation() was renamed to SchemaBuilderEntity.onValidate()

      </li>

    • updated: (IMPORTANT) SchemaBuilderEntity.setValidation() was renamed to SchemaBuilderEntity.setValidate()

      </li>

    • updated: CSS compressor removes comments

      </li>

    • updated: F.restrictions.allow('IP') --> does not have to be full IP

      </li>

    • updated: F.restrictions.disallow('IP') --> does not have to be full IP

      </li>

    • updated: String.startsWith() and String.endsWith() according to ES6 but with the backward compatibility

      </li>

    • updated: String.parseDate() supports JSON format and classic date serialization

      </li>

    • updated: U.request() --> response always returns string

      </li>

    • updated: debug.js --> now watchs packages

      </li> </ul>

      Bug 修復

      • fixed: framework starting path (fixed problem with PM2 module)

        </li>

      • fixed: controller.memorize() - prevention for multiple requests

        </li>

      • fixed: routing (POST request without content-type is considered as application/x-www-form-urlencoded)

        </li>

      • fixed: sync2()

        </li>

      • fixed: U.minifyHTML() - now compresses JS and CSS in HTML.

        </li>

      • fixed: Async.cancel()

        </li>

      • fixed: email attachments

        </li>

      • fixed: throwing error in global middleware

        </li>

      • fixed: Pagination.last()

        </li>

      • fixed: CSS auto-vendor-prefixes

        </li>

      • fixed: tpm binary (bug in creating packages on Windows)

        </li>

      • fixed: controller generators

        </li>

      • fixed: F.install() --> problem with names via URL import

        </li>

      • fixed: F.map() on Windows (problem with paths)

        </li>

      • fixed: HTML compression in views

        </li>

      • fixed: U.Async() object (problem with waitingFor)

        </li>

      • fixed: F.map(), problem in Windows

        </li>

      • fixed: CLEANUP(stream, [callback]);

        </li>

      • fixed: HTTP CACHE

        </li> </ul>

        ### 示例