Depreciating self reference inside config files

AdonisJs allows you to define reference to an existing value inside the config files. For example

 config/app.js

module.exports = {
   appKey: Env.get('APP_KEY')
}

Now you can make use of the above value inside any other config file using the following syntax.

 config/auth.js

module.exports = {
   jwt: {
     secret: 'self::app.appKey'
   }
}

In order to resolve self references, each Config.get call has to recursively parse the return value and make sure all references to self are resolved.

This behavior causes an unnecessary performance overhead, without any major gains.

adonis-framework@4.0.30 has marked this behavior as depreciated and will be removed in another minor release of the framework ( 4.1.0 ).

 
50
Kudos
 
50
Kudos

Now read this

Adonis 4.0 Dev Release

Adonis4.0 has been much-awaited release for AdonisJs so far. The framework is full of new and fresh ideas to make you even more productive. The documentation for dev release is available at dev.adonisjs.com. The API is 100% final, so... Continue →