Standard for vendors in large projects

Hi, guys,

My name is Marcos, I am an entrepreneur from São Paulo, Brazil, and I owe a startup that is focused on educational high impact solutions using technology. Recently we joined a project with World Bank, which aims in the students from Latin America and, after a lot of research, we found Elgg and chose it as our platform. We love Elgg, its philosophy and the simplicity behind the Entity model!

It is a really lage project, so we are using lots of thirdy-party libraries -- especially JS ones, once the UX is an important goal to WB. In Elgg documentation, it is said that we should keep vendors inside plugins, even though it is not important for Elgg core that it relies in this directory at all. But some of this libraries are shared between plugins and, for prototyping, we ended messing up a bit and registering JS in a plugin, but using in others too. It works, but it is not clear and it isn't a beautiful solution.

So I'd like to ask you if you could share some ideas about what is the better approach for multiple vendors shared between several plugins?


  • I'm not sure what's exactly your problem? Using vendors directory is not that important of course, but having some standard is better than nothing.

    Have look at

    Using elgg_register_js and elgg_load_js works really great on big projects as it abstracts over the physical location of the file, allows to load only on demand and still you can optimize it to limit the resources count.

  • A possibility is to put all frequently required vendors in separate plugins, and then make plugins depend on them.

    For example, openid_client and openid_server depends on openid_api.

  • Thank you, guys. @Pawel I was worried about the exact problem @sem addressed: recurrent plugins. We are using elgg_register_js and elgg_load_js, but it becomes messy when we try to use vendors that are "cross-plugin".

    @sem that's a great idea! That is the approach to CKEditor and it works really well. We will try that.