Skip to content

[DependencyInjection] Fluent PHP DI Documentation #10824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 28, 2019

Conversation

ragboyjr
Copy link
Contributor

@ragboyjr ragboyjr commented Jan 1, 2019

  • Updated service_container.rst to include php-fluent-di
  • Updated _build/conf.py to include codeblock for php-fluent-di
  • Updated existing di resource loading to refer to latest sf 4.2
    excludes

Remaining: need to update the rest of the service_container files

Signed-off-by: RJ Garcia rj@bighead.net

@ragboyjr
Copy link
Contributor Author

ragboyjr commented Jan 2, 2019

Before I start moving on to the rest of the files, would be nice if I could get some feedback to make sure this approach is fine and will work across all of our documentation.

@ragboyjr
Copy link
Contributor Author

Any word on this? Willing to make adjustments, just want to make sure i'm not wasting anyones efforts.

@ragboyjr
Copy link
Contributor Author

@nicolas-grekas any thoughts?

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the ping and the PR.

@ragboyjr ragboyjr changed the title WIP: [DependencyInjection] Fluent PHP DI Documentation [DependencyInjection] Fluent PHP DI Documentation Jan 18, 2019
@ragboyjr ragboyjr force-pushed the fluent-php-di branch 2 times, most recently from 6547842 to cc01ad8 Compare January 26, 2019 19:29
@ragboyjr
Copy link
Contributor Author

K, 4 files left now:

service_container/
  service_decoration.rst
  service_subscribers_locators.rst
  shared.rst
  tags.rst

Might be able to finish the rest tomorrow.

@ragboyjr
Copy link
Contributor Author

@nicolas-grekas OK, all of the files have been updated, and I was able to build the site locally, and it all checked out. This is ready to go live IMHO.

@ragboyjr
Copy link
Contributor Author

@nicolas-grekas is there anything else i need to do to get this merged? Would love to start seeing the fluent php configuration show up on the site so I can link to it for the devs i work with.

@nicolas-grekas
Copy link
Member

It's up to doc mergers now (I'm not :) )

@ragboyjr
Copy link
Contributor Author

oh, ha, no worries! Thank you very much.

@ragboyjr
Copy link
Contributor Author

@javiereguiluz is there anything else I need to do here?

@javiereguiluz
Copy link
Member

javiereguiluz commented Jan 29, 2019

@ragboyjr you did everything great and I thank you for that! However, merging this is a bit complicated. Why? Because we already have PHP config in all examples and here we are adding ... another PHP config.

Showing two similar, but slightly different, configs is always confusing to users. Why two? Which one is the right one? What if I choose one and the right one is the other one? etc. Instead of showing both, I think we should replace the existing PHP config by the new PHP config. However, is this fluent config polished enough? Is it used enough? I don't hear people asking questions about this or saying that they use it.

I'm going to ask about this to the Docs Team and we'll be back with a reply. Thanks!

@ragboyjr
Copy link
Contributor Author

@javiereguiluz I appreciate the feedback!

My only two cents is that the PHP Fluent config won't ever get "used" or "polished" enough unless it's documented properly. A lot of that information in the docs I just got from using it, IDE auto-complete, and checking source code, and I've found that it's hard to sell a team on trying to use this format when there isn't any documentation on it except for a blog post by the symfony team for the 3.4 release.

All that to say, I think before it could ever replace the other PHP format, it would need to at least be documented so that people could use it, and we can work out the kinks.

I totally understand your concern regarding showing both php types would be confusing; however, I'm not sure dropping the default php version would be good since it does provide valuable information on how to interact with the DI container. It's especially helpful when using Compiler Passes.

The only solutions I could come up with would be to change the name of it to not be PHP (Fluent), but give it a name like Configurator or Fluent maybe. The idea being that it lets people know it's a totally different configuration file.

The other would be that we put this PR on the back burner, and we create a dedicated page show casing each of the individual parts of DI configuration using the PHP fluent format, and it could be apart of the learn more.

Then after some time, if we feel like PHP fluent is taking off etc etc, then we can add it into the main docs or something.

@nicolas-grekas
Copy link
Member

I'd be 👍 to fade out the old PHP format - it doesn't provide anything over the fluent one, except maybe low level access to primitive data structures.

@javiereguiluz
Copy link
Member

I did a quick survey on Symfony's Slack. The number of answers is small ... but the results were:

  1. Almost nobody uses PHP for config and lots never heard of this fluent format.
  2. Of those using PHP, most are using (and loving) this fluent format.

@ragboyjr
Copy link
Contributor Author

@javiereguiluz That actually fits with my experience as well.

@ragboyjr
Copy link
Contributor Author

@javiereguiluz Let me know what you want to do, willing to update this however you want. The hard part was just creating the mapped config. If I have to shuffle stuff around or remove some stuff, it'll be quick.

@ragboyjr
Copy link
Contributor Author

ragboyjr commented Feb 6, 2019

@javiereguiluz ping, here to help and contribute any you need/like. Would love to see the comprehensive fluent php docs show up on the SF docs site in any shape or form.

@javiereguiluz
Copy link
Member

@ragboyjr sorry for the lack of response. We haven't forgotten about this, but we're still debating about this internally in the Symfony Docs team. Thanks.

@ragboyjr
Copy link
Contributor Author

ragboyjr commented Feb 6, 2019

Understood, just checking in, thanks.

@javiereguiluz
Copy link
Member

@xabbuh @OskarStark @wouterj after reviewing this ... I'm afraid I cannot merge it. I never use this PHP format, so I can't fix any of the multiple conflicts that will happen when upmerging this to 4.3, 4.4 and master.

Would any of you available for this? Keep in mind that the merging will be very complex and time-consuming. Thanks!

@ragboyjr
Copy link
Contributor Author

@javiereguiluz @xabbuh @wouterj Let me see if I can resolve the merge conflicts.

@javiereguiluz
Copy link
Member

@ragboyjr thanks a lot for all your work in this pull request. I hope it can be merged sooner than later.

@ragboyjr ragboyjr force-pushed the fluent-php-di branch 2 times, most recently from 9620337 to 884e5d3 Compare September 26, 2019 13:11
@ragboyjr
Copy link
Contributor Author

@javiereguiluz OK, check now please sir. I rebased off of master.

@HeahDude I updated several of the references to use the ; on a new line, but i'm not sure all our switched over. I'm not sure it's worth holding up the PR at this point, we could probably have someone comb through and adjust the CS in a separate PR.

@ragboyjr
Copy link
Contributor Author

gah, @javiereguiluz I rebased off of master and not 3.4 :(. When rebasing off of 3.4 i get another set of conflicts :'(. Are we sure we want to target this documentation for 3.4? Or maybe a later branch?

@ragboyjr ragboyjr changed the base branch from 3.4 to master September 27, 2019 02:21
@javiereguiluz
Copy link
Member

@ragboyjr you've spent so much time here that I feel bad if I keep asking things .... but yes, adding this only to 4.3 and higher branches would help a lot when merging it.

@ragboyjr
Copy link
Contributor Author

OK, I rebased off of master, and there aren't any conflicts. Would you prefer I rebase this off of 4.3 instead?

@javiereguiluz
Copy link
Member

Yes, please. This should go either to 3.4 or 4.3 .. so let's try if 4.3 is easier for all. Thanks!

@ragboyjr ragboyjr changed the base branch from master to 4.3 September 27, 2019 09:58
- Updated DI configuration references to include php-fluent-di
- Updated _build/conf.py to include codeblock for php-fluent-di
- Updated existing di resource loading to refer to latest sf 4.2
  excludes

Signed-off-by: RJ Garcia <rj@bighead.net>
@ragboyjr
Copy link
Contributor Author

Rebased off of 4.3 and branch target is updated.

wouterj added a commit that referenced this pull request Sep 28, 2019
…boyjr)

This PR was merged into the 4.3 branch.

Discussion
----------

[DependencyInjection] Fluent PHP DI Documentation

- Updated service_container.rst to include php-fluent-di
- Updated _build/conf.py to include codeblock for php-fluent-di
- Updated existing di resource loading to refer to latest sf 4.2
  excludes

Remaining: need to update the rest of the service_container files

Signed-off-by: RJ Garcia <rj@bighead.net>

Commits
-------

e27d27b [DependencyInjection] Fluent PHP DI Documentation
wouterj added a commit that referenced this pull request Sep 28, 2019
wouterj added a commit that referenced this pull request Sep 28, 2019
* 4.3:
  [#10824] Applied some of @HeahDudes comments and added missing comments
  [#10824] Fixed issues found by DOCtor
  [DependencyInjection] Fluent PHP DI Documentation
wouterj added a commit that referenced this pull request Sep 28, 2019
* 4.4:
  [#10824] Applied some of @HeahDudes comments and added missing comments
  [#10824] Fixed issues found by DOCtor
  [DependencyInjection] Fluent PHP DI Documentation
@wouterj wouterj merged commit e27d27b into symfony:4.3 Sep 28, 2019
@wouterj
Copy link
Member

wouterj commented Sep 28, 2019

Hi @ragboyjr! What an incredible job did you do with this PR. I cannot imagine the effort you put into this.

That's makes it even worse that we ignored it for so long. Fortunately, it's now merged into 4.3/4.4/5.0. While merging, I fixed some issues found by our review tool in 3ccce23 and I checked all comments by @HeahDude and applied some of them - as well as some things I discovered - in 2a5b114.

Thanks a lot for your quick responses and actions this week!

@ragboyjr ragboyjr deleted the fluent-php-di branch September 29, 2019 01:25
@ragboyjr
Copy link
Contributor Author

@wouterj @javiereguiluz woot woot!!!! So excited to see this in action now!

Glad to be able to help out with this :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants