Node.js framework v3.3.0 Release Notes
Release Date: 2019-09-30 // over 4 years ago-
๐ News
- โ added:
NEWTASK(name, declaration)
for creating preddefinedTaskBuilder
- โ added:
TASK(name, taskname, callback, [controller/SchemaOptions/OperationOptions/ErrorBuilder])
for executing preddefinedTaskBuilder
- โ added: a new config key
directory_tasks
forTaskBuilder
- โ added: a global alias
MODIFY()
forF.modify()
- โ added: a global alias
VIEWCOMPILE()
forF.view_compile()
- โ added:
mail.type = 'html'
can behtml
(default) orplain
- โ added:
$.headers
into theSchemaOptions
,OperationOptions
andTaskBuilder
- โ added:
String.parseCSV([delimiter])
returnsObject Array
- โ added:
String.parseUA([structured])
a simple user-agent parser - โ added:
req.useragent([structured])
returns parsed User-Agent - โ added: a new config key
default_crypto
it can rewrite Total.js crypto mechanism (default:undefined
) - added: a new config key
default_crypto_iv
it's an initialization vector (default: generated fromsecret
) or it can contain a customhex
value - ๐ท added: a new config key
allow_workers_silent
can enable/disable silent workers (default:false
) - โ added: a new config sub-type called
random
, example:secret_key (random) : 10
and10
means a length of value - โ added: a new command
clear_dnscache
for clearing DNS cache - โ added: commands
INSTALL('command', 'command_name', function)
for registering commands andCMD(name, [a], [b], [c], [d])
for executing commands - โ added:
ENCRYPTREQ(req, val, [key], [strict])
to encrypt value according to the request meta data - โ added:
DECRYPTREQ(req, val, [key])
to decrypt value according to the request meta data - โ added:
controller.nocache()
- โ added:
controller.nocontent()
- โ added:
REPO
as a global variable - โ added:
FUNC
as a global variable - โ added:
MAIN
as a global variable - โ added:
DEF
as a global variable for defining of behaviour for some operations (alternative toF
) - โ added:
PREF.set(name, [value])
(read+write) orPREF.propname
(only read) for reading/writing a persistent preferences - โ added:
F.onPrefSave = function(obj)
to write preferences - โ added:
F.onPrefLoad = function(next(obj))
to read preferences - โ added:
RESTBuilder.url(url)
which returns a new instance ofRESTBuilder
for chaining - โ added:
restbuilder.keepalive()
enables a keepalive forRESTBuilder
instance - โ added:
SESSION()
management, more in docs - โ added:
controller.sessionid
with ID ofSESSION()
- โ added:
AUTH()
supports a new auth declaration with$
asAuthOptions
likeSchemaOptions
orOperationOptions
- โ added:
AuthOptions
to prototypes - โ added:
ErrorBuilder.length
property (alias for `instance.items.length) - โ added: Schemas
prepare
supportsreq
argument - โ added:
DEF.currencies.eur = function(val) {}
registers a currency formatter - โ added:
DEF.helpers
registers a new view engine helper (F.helpers
is alias for for this object) - โ added:
DEF.validators
is alias for forF.validators
- โ added: usage of currency formatter
Number.currency(currency)
- โ added: new schema type
Number2
with default value isnull
, not zero0
- โ added:
@{json2(model, elementID, key1, key2, key3)}
can serialize data with keys defined into the<script type="application/json">
- โ added: schemas supports
PATCH
and.setPatch()
, only specified field are processed - โ added:
SchemaOptions
supports$.keys
forPATCH
method - โ added:
schema.cl(name)
("cl" means codelist) returns{Array}
a list of values from defined enum/keyvalue - โ added:
schema.props()
returns{Object}
meta info about all defined properties - โ added:
SchemaOptions
,OperationOptions
andTaskOptions
supports$.req
and$.res
properties - โ added:
AUDIT(name, $, [type], message)
a method for audit logs - added: obsolete message to older declaration of middleware, schemas and operations
- added:
U.diffarr(prop, arr_A, arr_B)
for comparing of two arrays - added:
DIFFARR(prop, arr_A, arr_B)
is a global alias forU.diffarr()
- โ added:
global.REQUIRE()
for local modules within app directory - โ added:
global.isWORKER
variable which containstrue
(when the process is executed as a worker) orfalse
- โ added:
ACTION(url, [data], callback)
can evaluate a route without request creation - โ added:
ROUTE('๐ METHOD URL')
, it means that ๐ addsauthorized
flag - โ added:
ROUTE('+METHOD URL')
, it means that++
or+
addsauthorized
flag - โ added:
ROUTE('-METHOD URL')
, it means that--
or-
addsauthorized
flag - โ added:
SchemaOptions
,OperationOptions
,TaskOptions
supports filtered query arguments via$.filter
- โ added:
controller.done([value])
- โ added:
SITEMAP()
as alias toF.sitemap()
- โ added: config key
allow_localize
enables a localization for allHTML
files - โ added:
controller.breadcrumb
returns all sitemap items - โ added:
PAUSESERVER(name, pause)
pauses web server (alias forF.wait()
) - added:
PROXY(endpoint, hostname, [copypath], [before_fn(uri,req,res)], [after_fn(res)])
makes a direct proxy from webserver - โ added:
schema.middleware(function($, next))
for creating simple middlewares for Schema operations - โ added:
FILE404(fn(req, res))
performs a simple fallback for non-existing files - โ added:
$PATCH(schema, model, [options], callback, [controller])
method - โ added:
.env
parser toprocess.env
- โ added:
String.parseENV()
for parsing.env
syntax - โ added:
$.noop()
for custom responses - โ added:
$ACTION(schemaroute, [model], callback, [controller])
evaluates schema - โ added:
process.send('total:restart')
performs a restart of app when the app is in debug mode - โ added:
NOSQLREADER(filename)
for reading different files of NoSQL embedded databases - โ added:
TABLEREADER(filename)
for reading different files of Table embedded databases - โ added:
Mail.use()
an alias forF.useSMTP()
- โ added:
F.onAudit(name, data)
delegate for handling audit logs - โ added: Components support a new features called
Parts
, more in docs
โก๏ธ Updates
- โก๏ธ updated:
$.invalid()
without arguments can return a functionfunction(err)
- โก๏ธ updated: Mail
unsubscribe
appends new header which enablesunsubscribe
in e.g. iOS - โก๏ธ updated:
MODIFY
, handler contains a new argumentcontroller
- โก๏ธ updated:
headers
argument incontroller.proxy
supportsflags: []
for REQEUST method - โก๏ธ updated:
.filefs()
and.filenosql()
supportsdownload
withtrue
or with(name, type) => 'new_name'
(filename
will be read from NoSQL binary file) - โก๏ธ updated:
$.done(arg)
argument@arg
can beboolean
(response will be as a value) or object/primitive value (arg
will be as a value) - โก๏ธ updated:
String.arg(obj, [encode], [def])
addedencode
(true
,json
,html
) anddef
arguments - โก๏ธ updated:
AUTH(req, res, flags, next)
andnext
function can handlecallback(err, user)
- โก๏ธ updated:
REQUEST()
supportskeepalive
flag - โก๏ธ updated:
bundles
mechanism supports merging files--filename
betweenbundles
files - โก๏ธ updated:
String.hash(true)
returns unsigned int - updated:
CONF:default_image_converter
supportsmagick
for new version of ImageMagick - updated:
CONF.default_image_consumption
can contain ZERO value which means disabled optimialization of CPU/memory consumption - updated:
CONF.default_image_consumption
has changed a default value to0
- โก๏ธ updated:
U.parseXML(str, [replace])
andString.parseXML([replace])
contains a new argument calledreplace
- โก๏ธ updated:
LOAD()
added a callback function - โก๏ธ updated: components support
encoding="utf8"
attribute for<file
tag (default:base64
) - โก๏ธ updated:
EventEmitter2
supports a new argumentobj
, example:U.EventEmitter2(obj)
or supports.extend
method:U.EventEmitter2.extend(proto)
- โก๏ธ updated:
UID()
generates new types ofUID
with 100% backward compatibility - โก๏ธ updated:
FILESTORAGE()
now it works in cluster mode
๐ Fixes
- ๐ fixed: schemas validation
- ๐ fixed: error handling in dynamic schemas
- ๐ fixed: CSS variables
- ๐ fixed: CSS variables with additional
!important
clause - ๐ fixed:
controller.proxy()
with Gzip/Deflate compression - ๐ fixed: HTTP status code with
204
inREQUEST()
- ๐ fixed:
cookies
inWEBSOCKETCLIENT
- ๐ fixed:
REQUEST()
withjson
flag and withnull
and''
value - ๐ fixed: rendering components in
layout
- ๐ fixed: resources, there was a bug with reading of value from
default.resource
- ๐ fixed: too many open files in
res.image()
- ๐ fixed: too many open files in
res.filefs()
- ๐ fixed: Schema
Boolean
parser - ๐ fixed: renamed
F.stats.request.path
toF.stats.request.patch
- ๐ fixed: SMTP sender (a problem with auth mechanism with some mail servers)
- ๐ fixed: filter in
F.backup()
- ๐ fixed: paths for stored directories in
F.backup()
- ๐ fixed: uploading files
- ๐ fixed:
U.getExtension()
by @molda
๐ Improvements
- ๐ improved Schemas and error handling
- ๐ improved
res.filefs()
method for nonexistent files
Others
- renamed:
*.routeScript
to*.public_js
- ๐
renamed:
*.routeStyle
to*.public_css
- renamed:
*.routeFont
to*.public_font
- renamed:
*.routeVideo
to*.public_video
- renamed:
*.routeImage
to*.public_image
- renamed:
*.routeDownload
to*.public_download
- โ
renamed:
*.routeStatic
to*.public
- ๐ renamed:
controller.viewCompile()
tocontroller.view_compile()
- ๐ renamed: event
cache-set
tocache_set
: - renamed: event
controller-render-meta
tocontroller_render_meta
- ๐ renamed: event
request-end
torequest_end
- ๐ renamed: event
websocket-begin
towebsocket_begin
- ๐ renamed: event
websocket-end
towebsocket_end
- ๐ renamed: event
request-begin
torequest_begin
- ๐ renamed: event
upload-begin
toupload_begin
- ๐ renamed: event
upload-end
toupload_end
- ๐ renamed: event
cache-expire
tocache_expired
- โ removed: backward compatibility with older version of Node.js < 10
- โ removed:
F.hash()
, alternativeString.prototype.hash()
- โ removed:
controller.hash()
, alternativeString.prototype.hash()
- โ added: