Allow multiple instances of keystone
See original GitHub issueContinuation of #1775. Let’s track our progress here, @snowkeeper @JedWatson
So for the time being all that needs to happen is for instance in
List
, instead ofvar keystone=require('../');
we want to make it like this (as you already suggested @jed):
module.exports = function(keystone){
//do something with keystone
}
My suggestion for now is that we _do_ leave the circular dependencies. We rewrite all the
keystone
dependents to use a closure as above.
I think these are the files that need to be updated and obviously also wherever they are require
d, not including tests:
- admin/server/api/cloudinary.js
- admin/server/api/counts.js
-
admin/server/api/download.js??? - admin/server/api/item/delete.js
- admin/server/api/item/get.js
- admin/server/api/list/delete.js
- admin/server/api/list/download.js
- admin/server/api/s3.js
- admin/server/api/session/signin.js
- admin/server/api/session/signout.js
- admin/server/routes/home.js
- admin/server/routes/item.js
- admin/server/routes/list.js
- admin/server/routes/signout.js
- fields/types/cloudinaryimage/CloudinaryImageType.js
- fields/types/cloudinaryimages/CloudinaryImagesType.js
- fields/types/location/LocationType.js
- lib/content/index.js
- lib/content/page.js
- lib/email.js
- lib/list.js
- lib/list/register.js
- lib/list/relationship.js
- lib/schemaPlugins/history.js
- lib/schemaPlugins/methods/getRelated.js
- lib/schemaPlugins/track.js
- lib/session.js
- lib/updateHandler.js
- lib/updates.js
- lib/view.js
All changes should be pushed to the prototype
branch. Also, don’t forget to rebase on top of master!
IMPORTANT: wherever a file only uses a dependency of keystone, please inject the dependency directly, if possible. E.g. admin/server/api/counts.js
only uses keystone.lists
, i.e. I’ll be injecting lists
instead of keystone
.
Issue Analytics
- State:
- Created 8 years ago
- Comments:12 (10 by maintainers)
Top GitHub Comments
Unfortunately this got really out of date… I’ve picked it up in much smaller pieces and am working through the remaining bits. Will tag this issue in my commits, but basically going to do this bit by bit (and ensure everything works with individual commits going forward in master) rather than try and branch then merge a big PR.
Keystone 4 is going in maintenance mode. Expect no major change. see #4913 for details. Keystone v5 is modular and flexible, see if it helps, if not open issue there.