Some modules might require backbone.js without all the handy "superstructure" that backbone.module is offering (am starting on https://github.com/wimleers/edit-createjs). I saw you split of backbone_library but would it maybe make sense to have a completely separate module?
Comments
Comment #1
ethanw commentedThat case is the one the backbone_library module aims to address. Since backbone.js by itself would be nothing but a library hook, it feels like it would be a pretty puny module, and having it part of a more robust module which can optionally be very minimally enabled addresses the issue. At least that's my initial thought.
Are there other examples of such "library-only" modules?
Comment #2
frega commentedOk, I understand what you mean - micro-modules can be finicky to deal with.
In that case i would suggest to declare the lib in backbone.module itself, though. dependencies could be resolved by other modules more easily requiring only one dependency-statement (dependencies[] = backbone instead of dependencies[] = backbone *and* dependencies[] = backbone_library, when only backbone_library is actually "wanted").
EDIT: libraries is already being used, sorry.
And we should consider/discuss using libraries.module, it comes w/ a handy drush-script that takes care of downloading the library etc.Comment #3
atlea commented@frega: Dependencies are nested. backbone requires backbone_libraries.
If a module requires the full backbone "superstructure" it would depend on backbone (and then indirectly backbone_library). If a module require just the library, it would depend on backbone_library.
Atle
Comment #4
frega commentedHi atlea,
you're right the dependencies can and will be resolved.
My concern is one of more "general DX": if you have a samplemodule.module that merely requires "backbone_library" and you put that in the samplemodule.info file (e.g. dependencies[] = backbone_library) and you try to enable the module (drush en -y samplemodule) without having backbone.module installed, this will fail ("Module samplemodule cannot be enabled because it depends on the following modules which could not be found: backbone_library"). Installation profiles can handle this, but afaik there's no way to hint to drupal "depends on backbone_library and it is a submodule of backbone.module" (so we would to add that to the README, explain etc.).
Best, Fredrik
Comment #5
atlea commentedAh, I see your point. I have run into this a couple of times, where the dependent module is not the main module and you have to do some detective work to figure out where to find it. Good point indeed.