Fusio 2.0 first release candidate available

posted by chriskapp on

We are really happy to announce the first release candidate of Fusio 2.0. It is not the final 2.0 release but a first pre release which gives users the chance to test the new version. Since it is a new major release candidate it contains many great changes. The following list will cover the most important changes:

  • Backend based on actions

    In previous versions of Fusio the internal backend and consumer API where based on custom controllers which handled the request and response. We have now converted all controllers to Fusio actions, and added the fitting schemas and routes to the database, this means basically that now the complete backend API runs also on Fusio. We have added a new category to most resources so that you dont see all internal actions and schemas at the backend but in the future it might be possible to select such a category. This means also you can easily reuse any internal Fusio action in your API.

  • Reorganized endpoints

    The /doc and /export endpoints are now moved under the /system endpoint. This means you can now use the /doc and /export path at your API. The /system endpoint is now reserved for Fusio. The following mapping shows all endpoint changes:

    Old Endpoint New Endpoint
    /doc /system/doc
    /doc/:version/*path /system/doc/:version/*path
    /export/debug /system/debug
    /export/health /system/health
    /export/jsonrpc /system/jsonrpc
    /export/routes /system/routes
    /export/schema/:name /system/schema/:name

  • Improved RPC support

    RPC is now a first class citizen style to invoke an action. This means you can call every route action also via JsonRPC. It supports also batch calls to improve performance. An action receives now a RequestInterface instance which has two implementations: HttpRequest and RpcRequest. If you invoke an action via a route your action receives a HttpRequest, if you call it via JsonRPC your action receives a RpcRequest. To build actions which work in both ways you can simply use the get and getPayload method which are defined at the RequestInterface. All internal backend actions can be called via HTTP or RPC.

  • Async action

    It is now possible configure an action as async action. This means Fusio will directly return a 202 Accepted response and puts the request into a queue to execute it at the background. This can be useful for expensive actions. There is a new console command action:queue which executes all queued actions.

  • TypeSchema

    Fusio uses now TypeSchema instead of JsonSchema. TypeSchema is designed to describe data models in a language neutral format. Through this we can now better describe our data and generate much better SDK code.

  • Schema based on PHP class

    Because of TypeSchema it is now possible to create a PHP class which represents a request schema. Fusio will create an instance of such a class containing the JSON data and pass it to your action. Through this you can work with fully typed code. You can also generate such a class automatically based on a TypeSchema specification. Fusio uses this also internally, please take a look at the repository for an example.

  • Improved backend app

    At the backend app we have improved the schema and action view and we have added new features like async configuration etc.

  • Redesigned adapter actions

    In previous version Fusio provided i.e. the "Sql-Table" action which allowed to create an API based on a database table. This action could be used on every request method i.e. GET, POST, PUT, DELETE and internally it executed the correct CRUD operation. With the new release we have split up this action into separate actions: Sql-Select-All, Sql-Select-Row, Sql-Insert, Sql-Update, Sql-Delete.

    Through this redesign every action can now be also called via RPC, since in an RPC context we dont have a HTTP request method. Also it creates better actions where every action executes only a specific task. You can think of an action like a serverless lambda function, which can be also executed via HTTP or direct invocation.

  • Removed migrations and moved all tables to InnoDB

    We have reduced all migrations so that a new installation is now much faster. Previously we had some log tables based on MyISAM, in the new release we use InnoDB for all tables.

  • Set PHP 7.3 as minimum requirement and 8.0 support

    Since PHP 7.2 has now reached end of life s. supported versions Fusio 2.0 will have PHP 7.3 as minimum requirement, also this release will support version 8.0.

With this new release we have setup Fusio for a great future. Our next big topic is the automatic deployment of a Fusio instance to a serverless provider i.e. AWS Lambda. This would allow to develop an API on a simple bare-metal server and in case you need the scaling capabilities you would be able to move the entire Fusio app to a serverless provider. This means all actions would be converted to a dedicated serverless function which gets invoked on a specific route. If you like to use or test this feature please let us know.

Due to so many fundamental changes we have currently no upgrade path from Fusio 1.x to 2.0, so you can only start with a fresh installation. If you use the deploy mechanismus you probably dont need an upgrade path since you can simply run the deploy command on a new 2.0 installation. If there is a huge demand from the community we may start to build such an upgrade path. So feel free to test this new version of Fusio and please report any issue to our repository.