Node.js framework v3.0.0 Release Notes
Release Date: 2018-08-01 // almost 6 years ago-
News :
- ➕ added: (IMPORTANT) bundles
- ➕ added: (IMPORTANT) Total.js components can have async delegate
- ➕ added: (IMPORTANT) Total.js components support nested public files encoded in base64
- ➕ added: (IMPORTANT) NoSQL worker
- ➕ added: (IMPORTANT) NoSQL embedded storage for smaller big data / IoT
- ➕ added:
debugging
supports live reloading - ➕ added: new schema operations:
schema.setInsert()
andschema.setUpdate()
- ➕ added:
RESTBuilder.patch([data])
- ➕ added:
RESTBuilder.type(new-content-type)
- ➕ added:
CONVERT(obj, schema)
for quick converting values like Schema (more in docs.) - ➕ added:
Capitalize2
schema type which converts only the first char - ➕ added:
MailMessage.high()
setshigh
priority of the email messsage - ➕ added:
MailMessage.low()
setslow
priority of the email messsage - ➕ added:
MailMessage.confidential()
setsSensitivity
header withconfidential
value - ➕ added:
MailMessage.attachmentnosql(db, id, [name])
sends a file from NoSQL embedded database - ➕ added:
MailMessage.attachmentfs(storage_name, id, [name])
sends a file from FileStorage - ➕ added:
SchemaBuilderEntity.$stop()
stops the async list - ➕ added:
SchemaOptions.stop()
alias to$.model.$stop()
- ➕ added:
SchemaOptions.next()
alias to$.model.$next()
- ➕ added:
SchemaOptions.output()
alias to$.model.$output()
- ➕ added:
SchemaOptions.clean()
alias to$.model.$clean()
- ➕ added:
SchemaOptions.response()
alias to$.model.$response([index])
- ➕ added:
SchemaOptions.$async(callback, [index])
alias to$.model.$async()
- ➕ added:
SchemaOptions.$get([options], [callback])
alias to$.model.$get()
- ➕ added:
SchemaOptions.$insert([options], [callback])
alias to$.model.$insert()
- ➕ added:
SchemaOptions.$query([options], [callback])
alias to$.model.$query()
- ➕ added:
SchemaOptions.$remove([options], [callback])
alias to$.model.$remove()
- ➕ added:
SchemaOptions.$save([options], [callback])
alias to$.model.$save()
- ➕ added:
SchemaOptions.$update([options], [callback])
alias to$.model.$update()
- ➕ added:
SchemaOptions.$workflow(name, [options], [callback])
alias to$.model.$workflow()
- ➕ added:
SchemaOptions.$transform(name, [options], [callback])
alias to$.model.$transform()
- ➕ added:
SchemaOptions.$operation(name, [options], [callback])
alias to$.model.$operation()
- ➕ added:
SchemaOptions.$hook(name, [options], [callback])
alias to$.model.$hook()
- ➕ added:
SchemaOptions.stop()
alias to$.model.$stop()
- ➕ added: a new route flag type
&group
something likeroles
but groups aren't evaluated - ➕ added:
route.groups
with defined groups - ➕ added: NoSQL
database.listing([view])
which generates a listing response - ➕ added:
DatabaseBuilder.insert(fn(doc))
can modify a document afterupdate
ormodify
hasinsert
mode - ➕ added:
DatabaseBuilder.query(code)
can contain a raw JS condition in the form e.g.doc.age > 18 && doc.age < 33
- ➕ added:
DatabaseBuilder.regexp(name, regexp)
RegExp search in strings - ➕ added:
DatabaseBuilder.fulltext(name, regexp, [weight])
full text search in strings, more info in docs. - ➕ added:
DatabaseBuilder.hour(name, [compare], value)
creates a condition for hours - ➕ added:
DatabaseBuilder.minute(name, [compare], value)
creates a condition for minutes - ➕ added:
Database.find2()
performs faster and reverse reading of documents (from end to begin of the file) - ➕ added:
Database.stream(fn, [repository], [callback(err, repository, count)])
for streaming documents - ➕ added:
Database.lock(callback(next))
locks all internal DB operations - ➕ added:
Database.ready(callback)
executes a callback when DB is ready to use (only for special cases if you use indexes) - ➕ added: new directory
schemas
with a new configuration item `directory-schemas' - ➕ added: new directory
operations
with a new configuration item `directory-operations' - ➕ added:
String.crc32([unsigned])
- ➕ added:
U.hash('crc32')
andU.hash('crc32unsigned')
- ➕ added: config
nosql-worker' for enabling worker for NoSQL embedded database (default:
false`) - ➕ added: config
nosql-inmemory' can contain name of databases e.g. (
users, products`) or String Array - ➕ added: config
nosql-cleaner
for cleaning databases from removed documents (default:1440
=== 24 hours) - ➕ added: config
nosql-logger
(defaulttrue
) enables simple logs when re-indexing and cleaning - ➕ added: config
security.txt
for auto-generating security.txt content (more in docs) - ➕ added: config
default-proxy
for default web proxy server - ➕ added: config
allow-cache-cluster
(defaulttrue
) allow/disallow cache synchronization - ➕ added:
GUID()
a global alias forU.GUID()
- ➕ added:
VIEW()
a global alias forF.view()
- ➕ added:
SchemaBuilderEntity.$response([index])
returns a specific response from an operation inasync
queue - ➕ added:
$SAVE(schema, model, [options], [callback], [controller])
performsschema.save()
- ➕ added:
$INSERT(schema, model, [options], [callback], [controller])
performsschema.insert()
- ➕ added:
$UPDATE(schema, model, [options], [callback], [controller])
performsschema.update()
- ➕ added:
$REMOVE(schema, [options], [callback], [controller])
performsschema.remove()
- ➕ added:
U.streamer2()
same functionality asU.streamer()
but it returnsBuffer
instead ofString
- ➕ added:
Number.round([precision])
- ➕ added:
UID([type])
supports custom types, e.g.UID('users')
orUID('orders')
- ➕ added:
REQUEST()
global method, it's alias toU.request()
- ➕ added:
NOW
global property, it's alias toF.datetime
- ➕ added:
DatabaseBuilder.promise()
- ➕ added:
RESTBuilder.promise()
- ➕ added:
RESTBuilder.plain()
it returns a raw string from the response body - ➕ added:
versions
file supportsauto
value for generating auto-checksum of files - ➕ added:
F.load()
supportstest
- ➕ added: NoSQL binary supports
custom
small data attributes - ➕ added: CSS and JS supports a simple View Engine markup (config + resources + F.global)
- ➕ added:
controller.split
alias tocontroller.req.split
- ➕ added: nicer error response messages
- ➕ added:
RESTBuilder.proxy(proxy)
for HTTP proxy - ➕ added:
U.request()
supports a new flagproxy
, for exampleproxy 127.0.0.1:8080
- ➕ added: NoSQL database a new event
change
, more in docs - 0️⃣ added:
schema.define()(DEFAULT_VALUE)
addedDEFAULT_VALUE
- ➕ added:
TESTUSER([user])
for faking ofF.onAuthorize
delegate, targeted for unit-testing only - ➕ added:
G
as a global alias forF.global
- ➕ added:
ERROR([name])
is an improvedF.error()
without arguments - ➕ added: a simple support for
.heic
and.heif
image format - ➕ added:
controller.sitemap_url2()
- ➕ added:
controller.sitemap_name2()
- ➕ added:
@{sitemap_url2()}
- ➕ added:
@{sitemap_name2()}
- ➕ added:
F.syshash
contains a simple MD5 hash with OS info - ➕ added:
SchemaEntity.clear()
for removing all current definition - ➕ added: new view engine markup
@{#}
for simulating of root URL - ➕ added: new view engine command
@{root}
for getting sub-root path - ➕ added:
String.ROOT()
for replacing@{#}
markup in strings - ➕ added:
U.decryptUID(value, key)
for encrypting number/string values - ➕ added:
U.encryptUID(value, key)
for decrypting of number/string values - ➕ added:
F.config['secret-uid']
as a hidden secret for encrypting/decrypting values - ➕ added:
F.dir(path)
for changing of root directory - ➕ added:
NOSQL()/TABLE().memory(count, [size])
for memory consumption, more in docs - ➕ added:
HttpFile.fs(storage_name, [custom], [callback])
saves a file into the FileStorage - ➕ added:
HttpFile.nosql(db_name, [custom], [callback])
saves a file into the FileStorage - ➕ added:
res.filefs(storage_name, id, [download], [headers], [callback])
returns file from FileStorage - ➕ added:
res.filenosql(db_name, id, [download], [headers], [callback])
returns file from NoSQL binary - added:
res.imagefs(storage_name, id, image_make_fn, [headers], [callback])
returns file from FileStorage - added:
res.imagenosql(db_name, id, image_make_fn, [headers], [callback])
returns file from NoSQL binary - ➕ added: new stats
F.stats.performance
contains count ofrequest
andfile
per minute - ➕ added: new method
controller.operation(name, value, [callback], [options])
for evaluating of operation
⚡️ Updates :
- ⚡️ updated: (IMPORTANT) NoSQL binary divides files to independent directories for 1000 files per directory
- ⚡️ updated:
GROUP()
by adding a new argumenturl_prefix
- ⚡️ updated:
NEWSCHEMA()
supportsNEWSCHEMA('group/name')
- ⚡️ updated:
ROUTE()
, extended syntax for schemas, for example:Schema --> @name
(more in docs.) - ⚡️ updated:
ROUTE()
supports a new HTTP method definitionROUTE('GET /api/users/')
,ROUTE('POST /api/users/')
, etc. - ⚡️ updated:
ROUTE()
supports a schema definition directly in the URLROUTE('GET /api/users/ *User --> @save')
, etc. - ⚡️ updated:
tpm
supports a new command calledbundle
, for example:tpm bundle cms
- ⚡️ updated:
F.restore()
filter can return a new filename (for files only) - ⚡️ updated:
@{import('livereload')}
or@{import('livereload wss://mywebsite.com')}
supportslivereload
value and it's rendered indebug
mode only - ⚡️ updated: information after the framework is started
- ⚡️ updated:
schema.define('name', null)
removes a schema field - ⚡️ updated: Chunker supports
compression
, defaulttrue
- ⚡️ updated: Chunker supports
autoremove
processed files ineach()
orread()
method, defaulttrue
- ⚡️ updated:
String.parseConfig(def, [onError])
can handle errors better - ⚡️ updated:
middleware
, now Total.js supports new declarationF.middleware(function($) {})
- ⚡️ updated:
F.wait()
HTML template - ⚡️ updated: JavaScript compressor, now optimizes multiple
var
declarations - ⚡️ updated:
CORS()
without arguments for all routes, methods and origins - ⚡️ updated:
CORS()
tries to join multiple same preferences to one - ⚡️ updated:
CORS(path)
without additional arguments allows all HTTP methods - ⚡️ updated:
U.keywords()
for Chinese/Japan characters - ⚡️ updated:
@{import()}
by addingmanifest
value linked to/manifest.json
- ⚡️ updated:
F.use()
supportsfunction
instead ofmiddleware
name - ⚡️ updated: improved crypto algorithm
- ⚡️ updated: decreased a maximum count of keys to
33
from69
when the query string is parsing - ⚡️ updated: extended
schema.required(name, (model, workflow) => workflow.update)
, more in docs. - ⚡️ updated:
$MAKE(schema, model, [filter/workflows], ...)
supportsworkflows
(array or object) instead of filter forschema.required()
- ⚡️ updated:
OPERATION()
by addingcontroller
🛠 Fixes :
- 🛠 fixed: mail attachments
- 🛠 fixed: mail
message.manually()
- 🛠 fixed: WebSocket comparing of
origin
header - 🛠 fixed: uninstalling CORS routes
- 🛠 fixed: cache for
favicon
- 🛠 fixed:
Date.extend()
- 🛠 fixed:
String.isJSON()
validator - 🛠 fixed:
String.parseDate()
now it parses date to UTC correctly - 🛠 fixed:
Date.format()
now it formats a date as UTC correctly - 🛠 fixed: HTML compressor with
\r\n
(Windows line endings) - 🛠 fixed: schema validation
- 🛠 fixed:
U.atob()
- 🛠 fixed:
U.btoa()
- 🛠 fixed: schema field can be changed dynamically
- 🛠 fixed:
String.arg()
- 🛠 fixed:
controller.href()
with Array values - 🛠 fixed:
U.get()
a problem with path with-
- 🛠 fixed:
U.set()
a problem with path with-
- 🛠 fixed:
F.path.mkdir()
in Windows and Linux
🔄 Changes :
- replaced: config
disable-clear-temporary-directory
toallow-clear-temp : true|false
- replaced: config
disable-strict-server-certificate-validation
toallow-ssc-validation : true|false
- 0️⃣ replaced: config
default-websocket-request-length
todefault-websocket-maxlength
- 0️⃣ replaced: config
default-request-length
todefault-request-maxlength
- 0️⃣ replaced: config
default-maximum-file-descriptors
todefault-maxopenfiles
- replaced:
controller.proxy()
functionality (the name remains) viacontroller.proxy2()
functionality
✂ Removed :
- ✂ removed:
F.responseFile()
- ✂ removed:
F.responsePipe()
- ✂ removed:
F.responseImage()
- ✂ removed:
F.responseImageWithoutCache()
- ✂ removed:
F.responseStream()
- ✂ removed:
F.responseBinary()
- ✂ removed:
F.responseContent()
- ✂ removed:
F.responseRedirect()
- ✂ removed:
F.response400()
- ✂ removed:
F.response401()
- ✂ removed:
F.response404()
- ✂ removed:
F.response408()
- ✂ removed:
F.response431()
- ✂ removed:
F.response500()
- ✂ removed:
F.response501()
- ✂ removed:
F.responseStatic()
- ✂ removed:
F.setModified()
- ✂ removed:
F.notModified()
- ✂ removed:
F.responseCode()
- ✂ removed:
F.noCache()
- ✂ removed:
controller.$modified()
- ✂ removed:
controller.$etag()
👌 Improvements :
- 👌 improved:
debug
mode timing with improved consumption - 👌 improved: performance (+20%) NoSQL embedded database
- 👌 improved: reading performance (+5%) in
U.streamer()
- 👌 improved: CSS compressor
- 👌 improved: CORS processing
- 👌 improved: internal encryption/decryption mechanism