Total.js Platform
Total.js Platform

Total.js Platform news and tutorials

Total.js v3.4.0

Total.js v3.4.0

Finally, the new version of Total.js framework is here! This new version brings great new features, updates and some bugfixes. We recommend to update your older version of Total.js framework!

News

Auto-merging static files in View Engine

This is really a great new feature, because you can merge files directly in the view engine via @{import()} method like this:

Configuration

We have added a new sub-type into the configuration called generate. This sub-type generates a random value and stores it for future restarts. For example: the code below will generate 10 characters string with chars/numbers:

Improved cluster

Total.js Cluster got really good and very helpful improvements.

Auto-scalability:

Main thread watches all threads in 5 seconds interval and if child processes respond in more than 70 ms then the main thread will open a new child process. If child processes aren't fully utilized then child processes will be killed automatically.

Debug Mode in Cluster:

Finally, you can use debug mode in cluster mode too. The framework restarts threads automatically if some server-side script is changed.

Server-less architecture:

(currently beta) We have prepared our architecture of server-less in Total.js framework and currently we prepare a cloud environment for it. We called it: THREADS. Our architecture offers total brutal performance with help of auto-scalability cluster for each thread.

Total.js Server-Less architecture

  • each thread is independent application
  • each thread inherits all functionality from root of the application (e.g. DB instance)
  • each thread is provided in cluster
  • each thread optimizes performance automatically
  • each thread can have own schemas and routes with own endpoints
  • adding of new thread is very easy
  • threads are targeted for high-performance REST services

It's not easy to provide THREADS, but you can learn from example: Threads example.

Schema extensions

We have added a simple extandable machanism for extending operations in the schemas. Extensions are available in all schema operations.

Example:

Updates

This version supports a new method called UPDATE(). This method will run scripts from /updates/ directory according to the version. It's much simple alternative to startup scripts, because update scripts are evaluated in the main thread and after all dependencies are loaded.

  • tries to load all versions in the form e.g. /updates/1.0.0.js
  • then it evaluates each file in order in the main thread (all dependencies are loaded)
  • then it renames evaluated files in the form e.g. /updates/1.0.0.js_bk
  • and then the application will continue
  • evaluated scripts aren't evaluated again after restart

Other new features

  • added Ipv4 address in the console output
  • added a new schema type called base64
  • HttpFile contains finally .extension property
  • added auto-session cleaner for unused items
  • NOSQL Counter supports .reset() method
  • added a support for .mjs extensions
  • updated .env parser, now it can parse .env-debug or .env-release according to the mode
  • added a simple DDOS IP protection, can be enabled via config: allow_reqlimit : Number
  • improved serialization with controller.success()
  • unit-testing supports colored outputs, added by dacrhu

Good to know: GZIP compression is enabled only for plain-text (HTML, JSON, etc.) bodies which have more than 4096 bytes.

Fixes

This version fixes some bugs. Again we have had a problem with traversal vulnerability - fixed.

Fixed UID generator

We have found a big problem with UID generator in Total.js v3, validations won't work in 2021. Yeah, this is big problem and this new version solves it. Don't worry about old UIDs, they are valid. But a big problem will be with a new UIDs in 2021. Just update your older version and everything will be fine.