Skip to content

[RFC] Deprecate and remove support for semantic XML configuration #60200

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

Open
lyrixx opened this issue Apr 11, 2025 · 12 comments · May be fixed by #60568
Open

[RFC] Deprecate and remove support for semantic XML configuration #60200

lyrixx opened this issue Apr 11, 2025 · 12 comments · May be fixed by #60568
Labels
RFC RFC = Request For Comments (proposals about features that you want to be discussed)

Comments

@lyrixx
Copy link
Member

lyrixx commented Apr 11, 2025

Description

Maintaining https://github.com/symfony/symfony/blob/7.3/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd is not easy.
And I never saw a project using XML to configure the framework.

So I propose to remove this support. I know it's always heartbreaking to remove a feature, but I really think it's much better for Symfony maintainers.

More over, we now have much better format to configure the framework...

Example

No response

@carsonbot carsonbot added the RFC RFC = Request For Comments (proposals about features that you want to be discussed) label Apr 11, 2025
@lyrixx
Copy link
Member Author

lyrixx commented Apr 11, 2025

maybe it can be generated from the Configuration definition?

What do you mean by "it"?

deprecating format X can be really painful for (some) users, im not sure it's generally worth it, since it's just format X

I agree but I really didn't see any project using it. More over, this configuration formation is painful to use (event for end user)

And Doctrine has already removed a configuration format. So there is a precedent 😃

@GromNaN
Copy link
Member

GromNaN commented Apr 11, 2025

maybe it can be generated from the Configuration definition?

This is not trivial as there is some transformations of the input before validating the configuration (example in DoctrineBundle) that requires a specific schema file. We hit this issue while trying to generate the JSON schema configuration in #59620

And I never saw a project using XML to configure the framework.

We can decide to deprecate this format and possibly reconsider this decision before deleting it, if people contest with specific use cases. Let's try to gather feedback before committing the deprecation.

@lyrixx
Copy link
Member Author

lyrixx commented Apr 18, 2025

maybe do some public polls first?

I'd like to, but I don't know where we could put it to reach the maximum number of people.

@wkania
Copy link
Contributor

wkania commented May 3, 2025

I'd like to, but I don't know where we could put it to reach the maximum number of people.

During https://live.symfony.com/

@stof
Copy link
Member

stof commented May 28, 2025

I think there is 2 different cases here:

  • XML support for the semantic configuration of bundles (which can be quite complex to handle as it is dynamic, and most non-core bundles don't care about providing an XSD)
  • XML support for Symfony configuration files (service definitions, routes, etc...), for which the XSD is quite straightforward

I know that some projects use XML files for the second case (the XSD provides better IDE support that for Yaml files for instance).
I'm not sure it is worth deprecating those.

@stof
Copy link
Member

stof commented May 28, 2025

Reading the issue again, I see that it proposes only the deprecation of the first case. I got confused by #60568 that deprecates everything about XML when claiming to fix this issue.

@nicolas-grekas
Copy link
Member

I'm in favor of dropping everything XML-related. Json-schema & array-shapes to the rescue instead of XSD if we want to provide an alternative IMHO.

@GromNaN
Copy link
Member

GromNaN commented May 28, 2025

Using XML for services and routes definition has been the dominant practice in popular bundles.

Let's focus on semantic configuration first, which is much more rarely (if ever) used.

@nicolas-grekas
Copy link
Member

Sure, that's why we need to deprecate first, then remove as usual. Keeping part of the xml stuff wouldn't allow us to remove any code, making the effort worthless. On the contrary, sending a message to bundles that they should move to php config is desirable - the format exists long enough.

@lyrixx
Copy link
Member Author

lyrixx commented May 28, 2025

Let's focus on semantic configuration first, which is much more rarely (if ever) used.

I would start with this first 👍🏼

Keeping part of the xml stuff wouldn't allow us to remove any code

No, we well be able to drop some code!

@nicolas-grekas
Copy link
Member

Not sure what y'all mean by "first": maintaining XML loaders for 5 more years in 8.x cycle? Better not!

@lyrixx
Copy link
Member Author

lyrixx commented May 28, 2025

héhé, just to clarify : I don't like to maintain XML support in semantic configuration. I don't really maintain routing & service configuration. That's why I wanted to remove only semantic configuration.

But if we all agree to drop all XML configuration, I'm obviously okay with that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC RFC = Request For Comments (proposals about features that you want to be discussed)
Projects
None yet
6 participants