Migrating from pre-2.8
In a file /routes/examples.js
(relative to the root folder of the service):
require('./my-module')
will be attempted to be resolved in the following order:/routes/my-module
(relative to service root)/routes/my-module.json
(relative to service root)/routes/my-module/index.js
(relative to service root)/routes/my-module/index.json
(relative to service root)
require('lodash')
will be attempted to be resolved in the following order:/routes/node_modules/lodash
(relative to service root)/node_modules/lodash
(relative to service root)- Node compatibility module
- Bundled NPM module
lodash
-
/abs/path
(relative to file system root)/abs/path.js
(relative to file system root)/abs/path.json
(relative to file system root)/abs/path/index.json
(relative to file system root)
This behavior is incompatible with the source code generated by the Foxx generator in the web interface before ArangoDB 2.8.
Note: The org/arangodb
module is aliased to the new name @arangodb
in ArangoDB 3.0.0 and the @arangodb
module was aliased to the old name org/arangodb
in ArangoDB 2.8.0. Either one will work in 2.8 and 3.0 but outside of legacy services you should use going forward.
In ArangoDB 2.6 Foxx introduced a new way to define queued jobs using Foxx scripts to replace the function-based job type definitions which were causing problems when restarting the server. The function-based jobs have been removed in 2.7 and are no longer supported at all.
The @arangodb/request
module when used with the json
option previously overwrote the string in the body
property of the response object of the response with the parsed JSON body. In 2.8 this was changed so the parsed JSON body is added as the json
property of the response object in addition to overwriting the body
property. In 3.0 and later (including legacy compatibility mode) the body
property is no longer overwritten and must use the json
property instead. Note that this only affects code using the json
option when making the request.
The bundled NPM modules have been upgraded and may include backwards-incompatible changes, especially the API of joi
has changed several times. If in doubt you should bundle your own versions of these modules to ensure specific versions will be used.
The utility module lodash
is now available and should be used instead of underscore
, but both modules will continue to be provided.