Skip to content

Declare a requirement on ext-mbstring instead of requiring the polyfill - #833

Merged
stof merged 1 commit into
scssphp:mainfrom
stof:require_mbstring
Nov 21, 2025
Merged

Declare a requirement on ext-mbstring instead of requiring the polyfill#833
stof merged 1 commit into
scssphp:mainfrom
stof:require_mbstring

Conversation

@stof

@stof stof commented Nov 21, 2025

Copy link
Copy Markdown
Member

Thanks to the provide rule in the symfony/polyfill-mbstring package, it is still possible for projects to install that polyfill to satisfy the ext-mbstring requirement.
Our code uses the mbstring API but never checks whether the extension is loaded, so that the polyfill can be used to provide that API.

This optimizes the experience for setups that have mbstring available rather than for setups that want to rely on the (slow) polyfill.

This allows me to remove the CI job actually using the polyfill to run, requiring hacks due to PHPUnit not supporting the polyfill in newer versions.

Thanks to the `provide` rule in the `symfony/polyfill-mbstring` package,
it is still possible for projects to install that polyfill to satisfy
the `ext-mbstring` requirement.
Our code uses the mbstring API but never checks whether the extension is
loaded, so that the polyfill can be used to provide that API.
@stof stof added this to the 2.1.0 milestone Nov 21, 2025
@stof

stof commented Nov 21, 2025

Copy link
Copy Markdown
Member Author

@Cerdic when updating the vendored dependencies in your SPIP plugin to use scssphp 2.1+, you should decide whether you vendor the polyfill or require the extension (vendoring the polyfill will be a matter of adding it in your composer.json in the vendoring setup)

@stof
stof merged commit cdb2334 into scssphp:main Nov 21, 2025
9 checks passed
@stof
stof deleted the require_mbstring branch November 21, 2025 17:12
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