I have released a new version of Total.js with bug fixes and with small improvements.
New release: Total.js v3.1
This version brings bug fixes and some improvements. You can upgrade your current version of Total.js framework from NPM via
$ npm install total.js. I recommend to update Total.js now!
Updated default config keys
This is very important change in this version. I have replaced all keys with
- chars to keys with
_ chars. This change saves a lot of code and personally I think that the performance is may be better. For example:
Big differences in the code:
I don't know what the compiler really makes, but in the most cases (in different JS engines) can the compiler evaluates
['mail-smtp'] as a string which can affect CPU and memory consumption (maybe). Don't worry about backward compatibility because Total.js solves older keys without any problem and you will be notified about all older keys in app log. Backward compatibility will be removed in Total.js v4.
Config supports a simple encryption of values
New version of Total.js supports a very simple encryption of config values. You can encrypt/encode values via
hex. So now you can encode credentials, secrets or SMTP credentials.
This version can extend
.html files. If you don't want to rewrite the entire content of some file and you want to extend a file for example
script then you can use
- a content of
--ui.jswill be added into the
/themes/admin/ui.jsat the end of file
- the file won't be overwritten
This version of Total.js supports external bundles which can be downloaded from URL address. Implementation is very easy, just create plain-text file
/bundles/cms.url with this content:
Total.js v3.1 supports
.bundlesignore file with a similiar syntax as
Code less, do more. The framework automatically pair a dynamic value as Total.js Schema and it's case insensitive. So you can merge multiple routes into the one. If the schema doesn't exist then the framework responds with
CSS variables support a default value
This was a missing feature. It's very helpful for e.g. Total.js CMS. Declaration is similar like
Extended NoSQL storage
NoSQL storage is a good choice for storing data from IoT sensors. NoSQL storage creates a new NoSQL database every day. And this version of Total.js extends NoSQL storage by adding three new methods:
.find(beg, end, [threads])
.count(beg, end, [threads])
.scalar(beg, end, type, field, [threads])
This methods return NoSQL
DatabaseBuilder. The big benefit is that Total.js can read NoSQL storage with multiple threads, so you can traverse all data / million documents very effective outside of main thread:
New method: U.reader()
Is a special feature for streaming and filtering data. It uses NoSQL reader filter engine which is optimized for the best performance.
U.reader() can be combined with e.g.
U.streamer(). It can be used in Total.js Flow.
Cookies support SameSite attribute
TaskBuilder can create simple async tasks.
- supports great features
- supports error handling
- supports similar features like Schemas or Operations
Usage in Schemas/Operations/Controllers:
This version brings better features for Total.js
OPERATIONS. Operations are something like Schema methods - operation/workflow/transform but they aren't have any declared schema, they are schemaless.
This is a new powerful feature which can run multiple operations in a row:
Now are operations part of routing, example:
Logger for Schemas and Operations
I have added a
logger for measuring time of
Operations. It can be used only for better debugging of Total.js applications.
Example of output:
Multiple HTTP methods in the routing
Tip from Tema Smirnov. Now you can defined a multiple HTTP methods directly in URL argument. IMPORATNT: between methods can't be any empty space.
I have improved
String.slug() for UTF characters for Chinese/Japan/Arabic/etc. languages. It creates a
hash from String. For example:
I have improved NOSQL/TABLE reader. I separated filtering engine to independent class and now the class is used for
NOSQL STORAGE. Of course, engine can be used for streaming data with new utils called
This version brings a more secured
UID() results, Total.js changes ending hash each minute. Now you can use
UID results in URL address directly as an argument.
I have implemented a new config key
default-cors which can contain hostnames as
origin. It's very helpful for the last restricting of
CORS() method. And from now the
CORS supports internal caching, so evaluating is a bit faster.
Many thanks to M.Sc. Jens Mueller / Security Researcher for the alert.
Now the framework uses scripts/styles according the group of components, so scripts/styles won't be rendered into the common file. I have enabled caching for components in
debug mode (previous versions use caching in
release mode only).
New global aliases
New global aliases can improve readability of the code in your Total.js application. Here is a simple comparison:
Good to know
Total.js framework doesn't processed Total.js files (controllers, definitions, schemas, etc) if the file ends with
-bk.js or starts with
- a critical bug with storing uploaded files via
- a critical bug with rendering of multiple async components
- a critical bug with NoSQL counter and freezing app
- a critical bug with GZIP compression (sometimes appeared in Safari)
nosql.modify()methods if the first argument is a function
F.wait()in the test mode
LOCALIZE()didn't work for nested directories
- error handling when
WebSocketClientis connecting (for example, if the request is
autovalue and with enabled
LOAD('release')a release mode
SchemaInstance.$clean()for nested schemas
- subdomain routing for
- a service for cleaning NoSQL embedded databases
- async rendering of components in Total.js View Engine
RESTBuildercache works only if the response status is
- compressing CSS with
Road to v4
v4 will remove all older declaration from Schemas, Operations and some internal funcionallity. I have created a lot of projects and I learned a lot, so the core won't be changed.
Other posts from Total.js platform
- 2019-03-07Flow v6 is here!
- 2019-02-13A critical security fix
- 2019-02-13New release: Total.js v3.2
- 2018-11-04New CDN for Flow + Dashboard + Flowboard
- 2018-10-15OpenPlatform v3
- 2018-10-12New Single Page Application template
- 2018-09-03Flow: How to find a specific component?
- 2018-09-03Total.js CMS v12
- 2018-08-01Total.js v3.0.0
- 2018-06-28Flow v5.1