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

PSR-7 v2 #108

Closed
kelunik opened this issue Apr 12, 2023 · 10 comments
Closed

PSR-7 v2 #108

kelunik opened this issue Apr 12, 2023 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@kelunik
Copy link
Contributor

kelunik commented Apr 12, 2023

Feature Request

Support for PSR-7 v2 in league/uri-components.

See https://www.php-fig.org/psr/psr-7/meta/#72-type-additions

@nyamsprod nyamsprod self-assigned this Apr 12, 2023
@nyamsprod nyamsprod added the enhancement New feature or request label Apr 12, 2023
@nyamsprod
Copy link
Member

@kelunik I indeed saw that PSR-7 v2 was out. The question that I have is does it warrant an new version for all packages to correctly implements the return type or not ?

If so I could take the opportunity to bump correctly all repo and to have a clean release with all repo moving to v7. it might take a bit more time but the result would be worthwhile I think

@kelunik
Copy link
Contributor Author

kelunik commented Apr 12, 2023

Adding parameter types requires a new major version for packages shipping implementations, yes.

So the plan is bumping everything to v7 so the next version for league/uri-components will be 7.0.0?

@nyamsprod
Copy link
Member

Yes that's the plan so that tags can be added on the monorepo directly. Makes management easier for me

@nyamsprod
Copy link
Member

nyamsprod commented Apr 16, 2023

@kelunik turns out that moving to PSR-7 version 2.0 is a lot easier than I thought since the package is already fully typed but I will have to wait for the https://github.com/php-http/psr7-integration-tests package to supports:

@nyamsprod
Copy link
Member

The master branch now supports PSR-7 version two.

  • Still need to make sure all the dependencies are respected.
  • Still need to update the documentation for v7

@nyamsprod
Copy link
Member

nyamsprod commented Jun 13, 2023

@kelunik most of the work to release version 7 is done

Updating the documentation is still a to do work but it will be an easy one as most of the public API is still the same.

I have a question for you as a user of the package though. I want to remove the create prefix from all the named constructor so:

- public static createFromString(Stringable|string $uri): self
+ public static fromString(Stringable|string $uri): self

It can be done in 2 ways:

  • either I do a hard BC break or
  • I keep the deprecated version at least in v7.

I presume the latter is better as it allows for a simpler migration path to v7 🤔 Another possibility is to think that renaming is not necessary.

I am just looking for feedback to see what's the best scenario (from the POV of maintenance burden). IMHO at some point the create prefix ought to be removed... the sooner the better, unless I am missing something

@nyamsprod
Copy link
Member

The createFrom* family of named constructor will be deprecatede in version 7 and remove in the next major version. So only thing missing now is documentation update

@kelunik
Copy link
Contributor Author

kelunik commented Jun 17, 2023

@nyamsprod Sorry, forgot to answer. It's best to deprecate and introduce aliases if you want to transition to the new naming.

@trowski
Copy link

trowski commented Jun 17, 2023

I updated a branch of http-server this morning, http-server@3.x-league-7.x, to give the 7.x-dev a try. Everything works without any code modifications. Retaining the old names as deprecated should allow us to support 6.x and 7.x.

@nyamsprod
Copy link
Member

league/uri:7.0.0-beta.2
league/uri-components:7.0.0-beta.2
league/uri-interfaces:7.0.0-beta.2

are tagged.

Unless some big bug are found if all goes well the new stable tag will be released next week 🤞🏾

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants