Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Sep 2011 at 14:21 UTC
Updated:
29 Jul 2014 at 19:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sunSomehow, I thought that
typewas already in use, but seems I'm misguided on that, since neither http://drupal.org/node/542202 (module .info), http://drupal.org/node/1022020 (profile .info), nor http://drupal.org/node/171205 (theme .info) documents atypeproperty.This will involve a performance decrease that's potentially measurable, as every single .info file needs to be parsed first in order to determine what it is.
However, it can definitely considered to be a first step towards a unified "extensions" system, in which we unconditionally collect and record everything we have, and only later on demangle the data into extension "concepts". Right now, we're wasting quite a couple of resources for repetitively scanning the file system for each different concept we have.
Comment #2
catchRight I'm hoping we could offset the performance impact of scanning the files against the cost of doing multiple scans of the filesystem, that'll likely need testing though.
Comment #6
chx commentedA typical site will have so so much many more modules that on a module scan adding a theme or four wont matter. OTOH switching themes is really a rare operation compared to switching modules so making that heavier wont be a big deal.
Not to mention that all this hits the stat() cache which is very likely to contain all your Drupal site anyways :)
Comment #7
chx commentedIf it wasnt clear: I am strongly in favor because I never liked that hook in the theme issue.
Comment #8
karschsp commentedAttached patch doesn't actually DO anything except add type=module, theme, etc to all core modules/themes/profiles. I'll attempt the hard part later!
Comment #9
tstoecklerIn contrib-land, a semi-pattern of $name.$type.info has evolved, e.g. foo.skinr.info or bar.libraries.info.
How about comment.module.info or stark.theme.info?
Comment #10
karschsp commentedHmmm...I prefer the
type=moduleapproach but I'll defer to chx, catch, sun, et al on how to proceed.Comment #11
webchickWhat are the tangible benefits of #340723: Make modules and installation profiles only require .info.yml files that warrant both a DX hit and a performance hit?
#953336: Contributed modules are not able to test theme-related functionality is one. Are there others? Because you're asking every module, theme, and profile developer to have to write an extra line of code in their .info file (presumably with incredibly frustrating "WTF? Where the hell did my module go?!" results if that extra step is missed) in order to facilitate something we haven't had the need for in 11 years as a project.
Comment #12
sunSee last para in #1. We're on the quest to a unified extensions system for a long time already, in which profiles and themes participate in the module hook system, modules may ship with themes, profiles ship with modules and themes, etc. This change is going to be a major milestone towards a generalization and simplification of the discovery and handling of extensions. Exact grants, responsibilities, and other business logic still can and has to be controlled by extension type, but the mere unification simplifies a lot and opens many doors.
Comment #13
catchfoo.bar.info has the advantage of not requiring that we parse the file to find out what type it is, that's potentially very useful and I'm neutral on the naming vs the info key.
@webchick I opened this as a followup to the theme testing issue which has been rtbc for almost exactly a year because the only way it could be fixed was adding a new hook - to work around the fact we can only tell what a module or a theme is by checking which directory they're in, not from any property of the things themselves.
On performance I don't think we'll see a hit - we should be able to exchange two passes of two directories for one pass of both. Most of the time those get scanned together. Right now we load info for the testing themes on every request in Drupal 7 because the other issue hasn't been fixed which is a small performance hit but one that is right in the critical path of serving pages. So if there turns out to be a performance trade off it won't be one way.
Comment #14
robloachWould like to go deeper than this and unify
install_profile_info(),_system_rebuild_theme_data()and_system_rebuild_module_data(). Maybe in a follow up?Comment #15
sunTotally. Already mentioned in #1. :)
Several other patches in the queue are heading for the same goal - but each touching separate parts of the spaghetti.
I'm not exactly sure how much we need to change in order to get this in?
Perhaps... it would be best to change "Add type key" into "Require type key", and replace the default type property value you added with an explicit condition?
Comment #16
sunComment #17
robloachLikely needs an update. Let's find out!... #14: 1292284.patch queued for re-testing.
Comment #19
ParisLiakos commentedWe have several modules in core right now that do not need a .module file..
eg hal..or serialization..not to mention the number of test modules..
I made the type required..and changed *i hope* all info.yml files
Comment #21
ParisLiakos commentedYeah obviously i forgot all test themes and the fact that profiles are considered modules
Comment #23
ParisLiakos commentedthis should be green...forgot a couple modules..it is weird how 3 missing modules can trigger so many fails:P
Comment #24
Crell commented#23: drupal_info-type-key-1292284-23.patch queued for re-testing.
Comment #25
Crell commentedParis tells me that this will help finally unblock #340723: Make modules and installation profiles only require .info.yml files. If he's right, then I'm +1 on it. :-)
Comment #27
ParisLiakos commentedlets see how many new modules/themes we have since then...i only spotted one.bot?
Comment #28
robloachIs the core/modules/update/tests/aaa_update_test.tar.gz touch suppose to be in here? Other than that, looks pretty good!
Comment #29
ParisLiakos commentedyes i had to extract it, put the type key in the info.yml end then recompress:)
Comment #30
robloachHere it is without that change.
[EDIT] Ah, IGNORE THIS!!!
Comment #31
robloach#27 is the RTBC patch.
Comment #32
robloachJust for simplicity.
Comment #33
alexpottCommitted 79ea2f3 and pushed to 8.x. Thanks!
Attached is a diff of the compressed file that's changing... so people can see what's actually changing...
Also core/modules/tracker/tests/modules/tracker_test_views/tracker_test_views.info.yml had been added in the meantime so added a
type: moduleto it.Re: performance concerns cited in #13, #11, #6 and #2 - I'm pretty sure that there won't be any impact as this patch does not result in any additional calls to
drupal_parse_info_file().Re: DX concerns cited in #11 adding an extra line into the info.yml is not really a burden considering module maintainers will already have to convert their .info into YAML anyway.
Comment #34
alexpottAttaching the promised diff of
core/modules/update/tests/aaa_update_test.tar.gzComment #35
ParisLiakos commentedchange notice: http://drupal.org/node/1990210
we can enhance it after #340723: Make modules and installation profiles only require .info.yml files
Comment #37
sunAwesome! Great work everyone!