Skip to content

Upgrade to league/uri 7.6 - #823

Merged
stof merged 3 commits into
scssphp:mainfrom
stof:league_uri_76
Nov 18, 2025
Merged

Upgrade to league/uri 7.6#823
stof merged 3 commits into
scssphp:mainfrom
stof:league_uri_76

Conversation

@stof

@stof stof commented Nov 6, 2025

Copy link
Copy Markdown
Member

league/uri performs 3 changes that are meaningful for us:

  • it implements strict validation for the RFC3986 rule requiring a scheme in the base url of the resolve algorithm. This makes it match the behavior of the resolve method in ext-uri in PHP 8.5. This means that the case 3 described in Ensure that the URI resolution semantic is consistent with Dart #819 is no longer provided for us by league/uri, which is what this PR needs to implement.
  • it deprecates BaseUri::resolve (alongside the whole BaseUri class) in favor of Uri::resolve (and a future UriInterface::resolve).
  • it exposes some public methods in UriString that were previously only private (or maybe protected) in BaseUri, which are part of the resolution algorithm. I currently rely on UriString::removeDotSegments to implement the new logic for some paths, which is what would make it hard to keep support for league/uri 7.5 as is.

TODO:

  • add more test cases for non-RFC3986 cases (and potentially submit them to the dart testsuite as well) to increase test coverage
  • figure out whether the cases calling UriString::removeDotSegments directly could be refactored to also be implemented in term of resolve with a modified base url followed by some URL manipulation. This would make it possible to keep support for league/uri 7.5 (and so to merge this change before the league/uri stable release), and would also make that code ready for a (far) future where a new major version of scssphp would use Uri\Rfc3986\Uri as its URI representation.

@stof stof added this to the 2.1 milestone Nov 6, 2025
@stof
stof marked this pull request as ready for review November 18, 2025 13:23
stof added 3 commits November 18, 2025 14:44
league/uri 7.6 is stricter in its validation logic for the URI
resolution algorithm to enforce behavior of the RFC3986.
This implements the other cases supported by Dart's URI resolution
algorithm in our own utility.
This bumps the min version of league/uri to version 7.6 as supporting
both versions 7.5 and 7.6 in this new logic is harder.
phpstan does not report those errors anymore.
@stof
stof merged commit 67540cd into scssphp:main Nov 18, 2025
9 checks passed
@stof
stof deleted the league_uri_76 branch November 18, 2025 13:52
@stof

stof commented Nov 19, 2025

Copy link
Copy Markdown
Member Author

The TODOs will be done separately as they are not blockers.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant