Open
Conversation
Member
|
Thanks for reaching out to us, I think it would be nice to have this optimization in the composer.json files of the projects. A PR for those changes would be very nice. Regarding the folder structure, I think we prefer the flattest structure, we must have missed that when we were splitting the project into separate packages. However changing this could have the downside of a harder to track history. I'm not sure if we should do that? @linawolf what do you think? |
Contributor
|
I think if we are moving the files in their own commit without changing them further in that commit git should be able to realize they were moved and not deleted and then created a new |
Member
|
Ok, let's go for it @stof |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As
phpdocumentor/guides-markdownprovides only classes for theMarkdownsubnamespace, using a more precise autoload prefix for the PSR-4 configuration will allow the ClassLoader to avoid checking that package for other guides classes.This won't make much difference when using an optimized autoloader with level 2 optimizations as the classmap will be used instead of checking the filesystem. But it will help a bit when using a non-optimized autoloader (which is common in dev environments as that provide a better DX when your codebase gets edited).
If this is considered good by maintainers, I will update the PR to apply that to other packages rather than just
guides-markdownas others could also benefit from it.Also, maintainers should decide whether they prefer using
src/Markdown/as path in the config or flattening thesrcfolder by removing theMarkdownfolder entirely (similar to what is done forguides-cli). Both options are valid and I'll happily apply the preferred one when updating this PR to cover all packages.