Node.js framework v3.3.0 Release Notes

Release Date: 2019-09-30 // over 4 years ago
  • ๐Ÿ†• News

    • โž• added: NEWTASK(name, declaration) for creating preddefined TaskBuilder
    • โž• added: TASK(name, taskname, callback, [controller/SchemaOptions/OperationOptions/ErrorBuilder]) for executing preddefined TaskBuilder
    • โž• added: a new config key directory_tasks for TaskBuilder
    • โž• added: a global alias MODIFY() for F.modify()
    • โž• added: a global alias VIEWCOMPILE() for F.view_compile()
    • โž• added: mail.type = 'html' can be html (default) or plain
    • โž• added: $.headers into the SchemaOptions, OperationOptions and TaskBuilder
    • โž• added: String.parseCSV([delimiter]) returns Object 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 from secret) or it can contain a custom hex 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 and 10 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 and CMD(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 to F)
    • โž• added: PREF.set(name, [value]) (read+write) or PREF.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 of RESTBuilder for chaining
    • โž• added: restbuilder.keepalive() enables a keepalive for RESTBuilder instance
    • โž• added: SESSION() management, more in docs
    • โž• added: controller.sessionid with ID of SESSION()
    • โž• added: AUTH() supports a new auth declaration with $ as AuthOptions like SchemaOptions or OperationOptions
    • โž• added: AuthOptions to prototypes
    • โž• added: ErrorBuilder.length property (alias for `instance.items.length)
    • โž• added: Schemas prepare supports req 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 for F.validators
    • โž• added: usage of currency formatter Number.currency(currency)
    • โž• added: new schema type Number2 with default value is null, not zero 0
    • โž• 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 for PATCH 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 and TaskOptions 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 for U.diffarr()
    • โž• added: global.REQUIRE() for local modules within app directory
    • โž• added: global.isWORKER variable which contains true (when the process is executed as a worker) or false
    • โž• added: ACTION(url, [data], callback) can evaluate a route without request creation
    • โž• added: ROUTE('๐Ÿ”’ METHOD URL'), it means that ๐Ÿ”’ adds authorized flag
    • โž• added: ROUTE('+METHOD URL'), it means that ++ or + adds authorized flag
    • โž• added: ROUTE('-METHOD URL'), it means that -- or - adds authorized flag
    • โž• added: SchemaOptions, OperationOptions, TaskOptions supports filtered query arguments via $.filter
    • โž• added: controller.done([value])
    • โž• added: SITEMAP() as alias to F.sitemap()
    • โž• added: config key allow_localize enables a localization for all HTML files
    • โž• added: controller.breadcrumb returns all sitemap items
    • โž• added: PAUSESERVER(name, pause) pauses web server (alias for F.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 to process.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 for F.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 function function(err)
    • โšก๏ธ updated: Mail unsubscribe appends new header which enables unsubscribe in e.g. iOS
    • โšก๏ธ updated: MODIFY, handler contains a new argument controller
    • โšก๏ธ updated: headers argument in controller.proxy supports flags: [] for REQEUST method
    • โšก๏ธ updated: .filefs() and .filenosql() supports download with true or with (name, type) => 'new_name' (filename will be read from NoSQL binary file)
    • โšก๏ธ updated: $.done(arg) argument @arg can be boolean (response will be as a value) or object/primitive value (arg will be as a value)
    • โšก๏ธ updated: String.arg(obj, [encode], [def]) added encode (true, json, html) and def arguments
    • โšก๏ธ updated: AUTH(req, res, flags, next) and next function can handle callback(err, user)
    • โšก๏ธ updated: REQUEST() supports keepalive flag
    • โšก๏ธ updated: bundles mechanism supports merging files --filename between bundles files
    • โšก๏ธ updated: String.hash(true) returns unsigned int
    • updated: CONF:default_image_converter supports magick 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 to 0
    • โšก๏ธ updated: U.parseXML(str, [replace]) and String.parseXML([replace]) contains a new argument called replace
    • โšก๏ธ updated: LOAD() added a callback function
    • โšก๏ธ updated: components support encoding="utf8" attribute for <file tag (default: base64)
    • โšก๏ธ updated: EventEmitter2 supports a new argument obj, example: U.EventEmitter2(obj) or supports .extend method: U.EventEmitter2.extend(proto)
    • โšก๏ธ updated: UID() generates new types of UID 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 in REQUEST()
    • ๐Ÿ›  fixed: cookies in WEBSOCKETCLIENT
    • ๐Ÿ›  fixed: REQUEST() with json flag and with null 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 to F.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() to controller.view_compile()
    • ๐Ÿ“‡ renamed: event cache-set to cache_set:
    • renamed: event controller-render-meta to controller_render_meta
    • ๐Ÿ“‡ renamed: event request-end to request_end
    • ๐Ÿ“‡ renamed: event websocket-begin to websocket_begin
    • ๐Ÿ“‡ renamed: event websocket-end to websocket_end
    • ๐Ÿ“‡ renamed: event request-begin to request_begin
    • ๐Ÿ“‡ renamed: event upload-begin to upload_begin
    • ๐Ÿ“‡ renamed: event upload-end to upload_end
    • ๐Ÿ“‡ renamed: event cache-expire to cache_expired
    • โœ‚ removed: backward compatibility with older version of Node.js < 10
    • โœ‚ removed: F.hash(), alternative String.prototype.hash()
    • โœ‚ removed: controller.hash(), alternative String.prototype.hash()