Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Removing dependency on symfony/polyfill, is no longer required now th... #468

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

Merged
magento-devops-reposync-svc merged 1 commit into magento:develop from hostep:fixes-issue-467
Sep 20, 2023

Conversation

Copy link
Contributor

@hostep hostep commented Sep 14, 2023

...at we dropped support for PHP 7.4

Fixes #467

As explained in the issue, the symfony/polyfill dependency got added in 2ea3c39 for the use of the php function str_starts_with which was added in PHP 8.0, at that time, the coding-standards repository still supported PHP 7.4, so it made sense at the time to add a polyfill.
However, since 8d37ab7 support for PHP 7.4 was dropped. So this polyfill package is no longer needed.

I'd say, merge this and tag a new version 33 of coding-standards, so people using Magento aren't being forced to install the entire symfony/polyfill package which comes with a whole lot of extra code that's not needed, maybe it will even cause a slight performance impact if all that code gets potentially loaded inside a Magento application.

sidolov and fredden reacted with thumbs up emoji
Copy link
Member

@fredden fredden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this together @hostep. I agree this can be safely removed. The coding standard should be installed as a development dependency though, so shouldn't cause any performance impact on production.

Copy link
Contributor Author

hostep commented Sep 15, 2023
edited
Loading

@fredden: that's not exactly true, dependencies of dev-dependencies can influence production dependencies being installed.
See the output in composer/composer#11641, by upgrading to v32 of coding-standards, it replaces the individual polyfill packages with the full one, and that one gets stored in the composer.lock file, so it gets installed in production as well.

I'm not a super fan of how dev dependencies work in composer, I've been experimenting with https://github.com/bamarni/composer-bin-plugin for over a year in some modules I've built (example), for better seperation of dev & prod composer dependencies so they don't influence each other as much, and I quite like it. It doesn't work with everything, I believe phpunit and composer-normalize can't be used without problems this way, but most dev dependencies (phpcs, php-cs-fixer, phpstan, ...) can be used without issues like this.

fredden reacted with thumbs up emoji

Copy link
Collaborator

sidolov commented Sep 20, 2023

@magento import pr to magento-commerce/magento-coding-standard repository

Copy link
Contributor

@sidolov the Pull Request is successfully imported.

Copy link
Member

fredden commented Oct 17, 2023

@sidolov please can we get a new release which includes this change?

hostep reacted with thumbs up emoji

Copy link
Contributor Author

hostep commented Jan 22, 2024

Got released in v33 today 🎉

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

@fredden fredden fredden approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Individual polyfill packages should be used instead of symfony/polyfill

AltStyle によって変換されたページ (->オリジナル) /