As a first step I would like to remove the distinction between core/lib/Drupal/Component and core/lib/Drupal/Core because as far as I understand this requires you to be intimately familiar with the implementation of the class to figure out why something is not in Core -- because the implementation happens to be Drupal independent. (As a second step, I would like core/lib/Drupal to bubble up to the same level where 'core' is and rename the two dirs to Framework and something else but that's a followup.)

Comments

neclimdul’s picture

I think the correct follow up is actually just to move lib/Drupal to vendor/Drupal. The distinction isn't really important and until we have no procedural code it makes sense to have a separate PSR-0 directory.

I don't personally have a problem with the components folder. I actually use it in my Plugins sandbox to separate generic code for supporting plugins from implementations using Drupal constructs. Its actually clearer IMHO.

Crell’s picture

Priority: Major » Normal

No and no.

We already spent 500+ comments to get to the directory struture we have now. For the love of Druplicon do not open that discussion up again unless there is an extremely concrete reason to do so. One has not been presented here.

As for Core vs. Component, that was a very conscious and deliberate decision. It serves to encourage ourselves to more loosely couple our code, which is something we have to do. It provides a structure for us to leverage to improve our code base. Libraries that can be run independently of Drupal are, by definition, cleanly separated and unit testable. (OK, not entirely by definition, but much more likely to be.)

This is a won't fix IMO.

chx’s picture

One reason?? I can't find anything in the current Drupal 8 checkout, how's that for a reason? How will any other core contributor find them?

The current directory structure does look something only a 500+ comment thread could produce, I admit that.

Crell’s picture

The current directory structure does look something only a 500+ comment thread could produce, I admit that.

That line is completely unhelpful and ignores all of the discussion to get to this point, including discussion of how PSR-0 works. (I suspect that is the majority of the difficulty, and for technical reasons is not negotiable.)

chx’s picture

Everything is negotiable in code thaw. If PSR-0 makes us do stupid things then...

webchick’s picture

The decision to go with PSR-0 has already been made, months ago. An initiative to convert all of the core classes to use it is well underway. The actual mechanics of the directory structure were signed off on by Dries.

I'd therefore prefer won't fix as well. I'd begrudingly settle for "postponed" + "revisit after code freeze" if won't fix is going to cause a conniption. But it makes absolutely no sense to me to re-open this festering wound now. Changing this around again right now would be incredibly disruptive to the work that's going on to incorporate the autoloader, not to mention distracting from other Drupal 8 work in our rapidly shrinking window to get big, important changes made. Directory re-shuffling is something that can happen post-code freeze, if it's deemed absolutely necessary, and by then we'd be looking at 100% of the big picture instead of 40%.

webchick’s picture

Sorry. Feature freeze, not code freeze.

Crell’s picture

Status: Active » Closed (won't fix)

Won't fix it is.

sun’s picture

I'm equally annoyed by the amount of sub-directories, and yes, we had that discussion already.

That said, I can see where @chx is coming from - the difference between /core/lib/Drupal/Component and /core/vendor, as well as /core/lib/Drupal/Core is not obvious and requires to understand the contained code.

I do think it is appropriate and acceptable to revisit decisions after gaining experience with them.

However, I also agree with @webchick to at least defer that to after feature freeze. Until then, we should be able to work with the current layout, gain more experience, and lastly be in a better position to re-evaluate the layout for its sanity.