1.15.0 Breaking Changes
-
utils.slugify
deprecated in 1.15.0, will be removed in 1.16.0. Use theslugify
module that will be available in 1.15.0.Client side
require(['slugify'], function (slugify) { console.log(slugify('string to slugify')); });
Server side
const slugify = require.main.require('./src/slugify'); console.log(slugify('string to slugify'));
-
The Write API plugin has been merged into core NodeBB and given the prefix
/v3
. The pre-existing write-api plugin should still work with NodeBB v1.15.x (and/v2
will be entering maintenance), but development will continue on/v3
Breaking and Non-Breaking changes
- Not Breaking
POST /api/v1/users | admin.user.createUser
- The POST route will now return a complete user object (a call to User.getUserData is made with the new uid)
- Not Breaking
PUT /api/v1/users/:uid | SocketUser.changeUsernameEmail | SocketUser.updateProfile
- The PUT route will now return a complete user object (like above)
- Breaking
DELETE /api/v1/users | DELETE /api/v1/users/:uid | admin.user.deleteUserAndContent
- The new
DELETE
route will now not return anything in response
- The new
- Breaking
PUT /api/v1/categories/:cid | admin.categories.update
- The new
PUT
route will return the updated category object, instead of simply the cid that was updated
- The new
- Breaking
POST /api/v1/groups | admin.groups.create
- The
POST
route will now return a complete group object (a call to Groups.getGroupData is made with the new group name) ownerUid
, previously returned, will now no longer be present in the response
- The
- Breaking
PUT/DELETE /api/v1/groups/:slug/membership
- Updated to be
PUT/DELETE /api/v1/groups/:slug/membership/:uid
, to better conform with RESTful API design (it takesuid
as a route param now) - Admin-only Write API routes for group addition/removal have been merged into this one route
- Updated to be
- Not Breaking
POST /api/v1/topics/:tid | posts.reply
- The
POST
route will now return a complete post summary object instead of a smaller subset as before
- The
- Not Breaking
PUT /api/v1/posts/:pid
- The
PUT
route will now return a complete post summary object instead of a smaller subset as before
- The
- Breaking
api/v1/categories/:cid/privileges
route has been removed in favour ofapi/v3/users/:uid/privileges
andapi/v3/groups/:name/privileges
- Breaking
api/v1/categories/:cid/state
removed as category disabled state is slated for removal in a future version of NodeBB - Breaking
api/v2/util/maintenance
is renamedapi/v3/admin/settings
and now allows modification of all ACP settings - Breaking
api/v2/util/upload
is renamedapi/v3/files/upload
- Not Breaking
-
@baris said in 1.15.0 Breaking Changes:
utils.slugify
deprecated in 1.15.0, will be removed in 1.16.0. Use theslugify
module that will be available in 1.15.0.Client side
require(['slugify'], function (slugify) { console.log(slugify('string to slugify')); });
Server side
const slugify = require('slugify'); console.log(slugify('string to slugify'));
Hello @baris !
I began to upgrade nodebb from 1.14 to 1.15 and, when I use these changes for slugify in my plugins, I get this error :
2020-12-11T14:23:34.787Z [5678/37554] - error: Error: Cannot find module 'slugify'
These changes for slugify are for nodebb 1.15 or nodebb 1.16 ? Or is it something else that I must do to make it works right ?
-
@baris said in 1.15.0 Breaking Changes:
Slugify module was added in 1.15.0, utils.slugify is being removed in 1.16.0. Check if you have slugify.js in
public/src/modules
and post how you are requiring the module.Hello @baris,
I have slugify.js in public/src/modules .
I require module in my library.js of my plugin like you said :
const slugify = require('slugify'); console.log(slugify('string to slugify'));
and it gives :
2020-12-12T11:40:23.482Z [5678/68409] - error: Error: Cannot find module 'slugify' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18)
...