Problem/Motivation

Current settings included in module, theme and profile .info.yml files should be separated into more appropriate config files, like .settings.yml, .libraries.yml, .regions.yml.

examples with more details:
https://www.drupal.org/project/ideas/issues/1398772#comment-10533558

Proposed resolution

Minimize the configuration included in .info files, as a preparation to use composer for dependency management.

Remaining tasks

Create subtasks to clean up the .info files.

Docs:
Module .info: https://www.drupal.org/docs/creating-custom-modules/let-drupal-know-abou...
Theme .info: https://www.drupal.org/docs/theming-drupal/defining-a-theme-with-an-info...
Profile .info: https://www.drupal.org/docs/distributions/creating-distributions/how-to-...

Comments

Pasqualle created an issue. See original summary.

pasqualle’s picture

Issue summary: View changes
pasqualle’s picture

Issue summary: View changes
jwilson3’s picture

Re @dww on #1398772-118: Replace .info.yml with composer.json for extensions:

There’s also talk of a dedicated regions.yml file for defining theme regions.

Where is this discussion happening? Without knowing more, moving regions from info.yml to regions.yml feels like a poorman's refactor, in light of what I had in mind with making theme settings first-class Config Management citizens. Eg, themes would provide default regions prop in config/install/[themename].settings.yml, where they could then be managed (CRUD + reordered + grouped + attributes) via the UI, and synced with config management via Drush like the rest of Drupal. This is kind of an interesting first step to having a hybrid control of theme region layout exposed to a decoupled frontend via a structured data object.

jwilson3’s picture

Remaining Tasks: Create subtasks to clean up the .info files.

Seems like there is a lot of definition work and brainstorming to be done. (each property in the info file may need to be moved in a different way). Was the intention to have a different meta per type (module/theme/profile) to further break down the work, or to shop around ideas for all three types here and try to coalesce around common properties that would be cleaned up in similar ways, then come up with actual process steps required for getting it all done, into subtasks?

dww’s picture

Re: #4: See, e.g. #1398772-79: Replace .info.yml with composer.json for extensions from @catch in 2015, and some subsequent comments. I don't know of a dedicated core issue to discuss it in full. What you're talking about sounds interesting, but perhaps over-complicated. I'm not as much of a front-ender, but in my experience, theme regions seem pretty hard-coded and baked into the theme. The ability to dynamically add/remove/reorder them via the UI seems fraught with peril. 😉 So what if I click/drag a new region into existence? Don't I have to manually update various Twig templates to support it? Seems like the hard-coded metadata list more accurately reflects reality than exposing this to CRUD via the UI.

jwilson3’s picture

You're right that moving existing functionality to a new file, a la regions.yml, as hardcoded metadata would accurately reflect reality.

I guess what I'm getting at is that using config mgmt instead of regions.yml would set the stage for more improvements in the future. Those improvements I mentioned are all out of scope of this refactor. Let's say we don't expose a UI for the regions. Must everything in a config yml file be exposed in the UI? (I feel like I've worked with cases where certain module configs use CMI but don't explicitly expose all their settings).

Even if we had to make a UI for it, I feel like themers are intimately familiar with the concept of clicking something into existence in the UI, and then manually CRUDing templates in the theme to match that reality, so this doesn't feel like so much of a leap of faith. And, bonus, if the project is using drush cex/cim to sync code with database, then there is nothing really new here to learn.

Version: 10.0.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

andypost’s picture

Issue tags: +blocker

per #6

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.