We work on Total.js v5, and this blog post contains important differences between Total.js v5 and Total.js v4.
Differences between Total.js v5 and Total.js v4
This blog post describes the main differences between Total.js v4 and Total.js v5. Total.js v5 contains almost new and nicely written code. This blog post will be gradually updated.
- Repository: https://github.com/totaljs/framework5
- Minimal Node.js version:
+v19
$ npm install total5@beta
Projects
Introduction
What is new in Total.js v5?
Only shorter, cleaner and improved code. Finally, the repository contains much nicer code. It’s fully optimised for Node >18
.
Should I update the Total.js v4 apps?
No. We started testing Total.js v5. You can develop upcoming projects with Total.js v5. For stability reasons, wait before converting older apps to Total.js v5.
Is the Total.js v5 stable?
Almost yes. We use Total.js v5 in several projects, and they work without critical issues. We are working on unit-tests, documentation, etc..
How can I determine Total.js v5 in the code?
New start script
We updated the start script for Total.js v5. Don't forget to use it if you want to use Total.js v5.
Schemas
Linking schemas:
Partial data:
CALL/EXEC/ACTION:
Routing
Total.js v5 doesn’t use request
and response
instances. It works only with a controller
- alias $
. So every request to an action, file or WebSocket is represented as a controller.
Flags:
API routing
New feature
Routes support the ?
character which is replaced with CONF.$api
value (default: /admin/
).
WebSocket routing
Localization
Determine the language of incoming requests:
Common changes
Configuration
Total.js v5 supports only the one configuration file called /config
. All system keys (90%) were updated to a shorter version:
Keys: https://github.com/totaljs/framework5/blob/main/index.js#L326
Config:
NoSQL
All NoSQL commands are performed via the Total.js QueryBuilder used in PostgreSQL/MySQL.
PREF
PREF
is removed from Total.js v5. You can use MEMORIZE(name)
method that contains the same functionality.
Internal session mechanism
The SESSION()
method is removed in Total.js v5. The workaround is to use the AUTH()
method with predefined session functionality. More information at the link below:
Other posts from Total.js Platform
- 2024-05-02NEWApril report 2024
- 2024-04-19Installing Total.js v5: A Comprehensive Guide
- 2024-04-08How to create REST API using Total.js LessCode
- 2024-04-04Create UI parts visually with the power of Total.js UI Builder
- 2024-04-03Enhance your applications with Total.js v5 proxy functionality
- 2024-04-01March report 2024
- 2024-03-22How to scale your Total.js application with clusterization?
- 2024-03-01February report 2024
- 2024-02-19Building a CRUD API with Total.js: A Step-by-Step Guide
- 2024-02-01January report 2024