Skip to content
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

[DX] Services autoconfiguration with PHP8 Attributes and Interfaces #14154

Conversation

ffouillet
Copy link
Contributor

@ffouillet ffouillet commented Jul 15, 2022

Q A
Branch? 1.12
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets -
License MIT

This feature aims to improve developer experience by allowing to autoconfigure custom services on every bundle where possible thanks to interfaces and PHP8 Attributes.
Custom services reference services that can be created on top of Sylius extension points.
For example: A custom service implementing ChannelContextInterface should now not need anymore to be declared in services.yaml thanks to autoconfiguration.

During bundle loading :

  • Services (e.g. implementing ChannelContext) that do not require arguments could be autoconfigured directly by implementing the right interface.
  • Services (e.g. implementing TaxCalculatorInterface) that do require arguments should be tagged with PHP8 Attributes so that Attributes parameters can be used as service tag attributes.

Concerned bundles :

  • ChannelBundle
  • CoreBundle
  • CurrencyBundle
  • LocaleBundle
  • OrderBundle
  • PaymentBundle
  • PayumBundle
  • PromotionBundle
  • ShippingBundle
  • TaxationBundle

Some documentation have also been added, not on every bundle.
Feel free to let me know where I can write more doc about the concerned services if necessary ;) !

Many thanks in advance for your reviews 🙂.

A huge thank you to @HeahDude who has motivated me to contribute and took of his time to help and support me through the whole process of the creation of this feature. Thank you 🙏 !!

@ffouillet ffouillet requested a review from a team as a code owner July 15, 2022 08:31
@probot-autolabeler probot-autolabeler bot added API APIs related issues and PRs. Documentation Documentation related issues and PRs - requests, fixes, proposals. labels Jul 15, 2022
…on for future services using it + added tests.
…ion for future services using it + added tests.
…n for future services using it + added tests.
… for future services using it + added tests.
…on for future services using it + added tests.
… for future services using it + added tests.
…tion for future services using it + added tests.
…ion for future services using it + added tests.
… autoconfiguration for future services using it + added tests.
@ffouillet ffouillet force-pushed the feat/services-autoconfiguration-and-php8-attributes branch from 136c3c3 to 2793f1f Compare August 14, 2022 20:13
@coldic3 coldic3 assigned coldic3 and jakubtobiasz and unassigned coldic3 Mar 9, 2023
@jakubtobiasz jakubtobiasz added the Feature New feature proposals. label Jun 22, 2023
@jakubtobiasz
Copy link
Contributor

Hello @ffouillet 👋🏼!
I see nobody responded yet, so I'll take over this pleasure. I'd like to thank you for your work, and inform you we have a task in the backlog for this.

If you would like, you can rebase this PR and target it against 1.13 branch. Otherwise, we'll take it over. If we decide to open a new PR, you'll be added as a co-author, naturally.

I just wanted to let you know your work won't be gone, and I believe we'll see this feature in the Sylius soon :D.

@jakubtobiasz
Copy link
Contributor

Hello @ffouillet 👋🏼
This PR has been replaced by #15269. To give a tribute to your work, I've added you to all my commits as a co-author :).

Thanks for starting this initiative!

@ffouillet
Copy link
Contributor Author

Hi @jakubtobiasz, I'm glad the work I initiated will be used in Sylius :). Thanks for having set me as a co-author in the new PR!

TheMilek added a commit that referenced this pull request Sep 13, 2023
…e (jakubtobiasz)

This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | continuation of #14154
| License         | MIT

Thanks @ffouillet for starting this initiative 🥳!

Commits
-------

8d18081 Provide autoconfiguration with attributes for ApiBundle
TheMilek added a commit that referenced this pull request Sep 13, 2023
…undle (jakubtobiasz)

This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | continuation of #14154
| License         | MIT

Thanks @ffouillet for starting this initiative 🥳!


Commits
-------

a8e817d Provide autoconfiguration with attributes for PaymentBundle
TheMilek added a commit that referenced this pull request Sep 13, 2023
…dle (jakubtobiasz)

This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | continuation of #14154
| License         | MIT

Thanks @ffouillet for starting this initiative 🥳!


Commits
-------

8bb6655 Provide autoconfiguration with attributes for PayumBundle
TheMilek added a commit that referenced this pull request Sep 13, 2023
…le (jakubtobiasz)

This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | continuation of #14154
| License         | MIT

Thanks @ffouillet for starting this initiative 🥳!


Commits
-------

3e025ca Provide autoconfiguration with attributes for CoreBundle
TheMilek added a commit that referenced this pull request Sep 13, 2023
…ndle (jakubtobiasz)

This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | continuation of #14154
| License         | MIT

Thanks @ffouillet for starting this initiative 🥳!


Commits
-------

2e04d4c Provide autoconfiguration with attributes for LocaleBundle
TheMilek added a commit that referenced this pull request Sep 13, 2023
…Bundle (jakubtobiasz)

This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | continuation of #14154
| License         | MIT

Thanks @ffouillet for starting this initiative 🥳!


Commits
-------

2830ff8 Provide autoconfiguration with attributes for CurrencyBundle
TheMilek added a commit that referenced this pull request Sep 13, 2023
…dle (jakubtobiasz)

This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | continuation of #14154
| License         | MIT

Thanks @ffouillet for starting this initiative 🥳!


Commits
-------

0a26e7a Improve autoconfiguration with attributes for OrderBundle
TheMilek added a commit that referenced this pull request Sep 13, 2023
…undle (jakubtobiasz)

This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | continuation of #14154
| License         | MIT

Thanks @ffouillet for starting this initiative 🥳!


Commits
-------

2d2247a Improve autoconfiguration with attributes for ProductBundle
TheMilek added a commit that referenced this pull request Sep 13, 2023
…Bundle (jakubtobiasz)

This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | continuation of #14154
| License         | MIT

Thanks @ffouillet for starting this initiative 🥳!


Commits
-------

c9ce032 Provide autoconfiguration with attributes for TaxationBundle
TheMilek added a commit that referenced this pull request Sep 13, 2023
…Bundle (jakubtobiasz)

This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | continuation of #14154
| License         | MIT

Thanks @ffouillet for starting this initiative 🥳!


Commits
-------

b41b4bc Provide autoconfiguration with attributes for ShippingBundle
TheMilek added a commit that referenced this pull request Sep 13, 2023
…nBundle (jakubtobiasz)

This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | continuation of #14154
| License         | MIT

Thanks @ffouillet for starting this initiative 🥳!


Commits
-------

56901d3 Provide autoconfiguration with attributes for PromotionBundle
TheMilek added a commit that referenced this pull request Sep 13, 2023
…eBundle (jakubtobiasz)

This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | continuation of #14154
| License         | MIT

Thanks @ffouillet for starting this initiative 🥳!


Commits
-------

223cada Provide autoconfiguration with attributes for AttributeBundle
TheMilek added a commit that referenced this pull request Sep 13, 2023
…undle (jakubtobiasz)

This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | continuation of #14154
| License         | MIT

Thanks @ffouillet for starting this initiative 🥳!


Commits
-------

3c2f26a Provide autoconfiguration with attributes for ChannelBundle
0342759 Rename AsChannelContextRequestResolver.php to AsRequestBasedChannelResolver.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API APIs related issues and PRs. Documentation Documentation related issues and PRs - requests, fixes, proposals. Feature New feature proposals.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants