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

Add Api-Platform's version in debug bar #3235

Merged
merged 3 commits into from Sep 10, 2020

Conversation

dFayet
Copy link
Contributor

@dFayet dFayet commented Nov 3, 2019

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tickets fixes #...
License MIT
Doc PR api-platform/docs#...

After a small discussion with @dunglas it appears it could be nice to display the Api-Platform's version in the Symfony's debug-bar.

Two solutions were talked about, adding a constant (:-1: because it needs to be maintained), or using ocramius/package-versions (this package is required-dev by symfony/orm).

This feature was proposed to Symfony but it was refused.

So here we are :-)

Output:
Capture d’écran de 2019-11-03 18-35-05
Capture d’écran de 2019-11-03 18-34-55

Note:
I was not sure about adding tests or not, as the outpu depends of a final class, that might exists or not

Copy link
Member

@dunglas dunglas left a comment

Choose a reason for hiding this comment

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

Could you also add a test please?

composer.json Outdated Show resolved Hide resolved
@antograssiot
Copy link
Contributor

It migh be enough to add it in the small tooltip opened on mouseover to save space in the toolbar ?

@dFayet
Copy link
Contributor Author

dFayet commented Nov 4, 2019

Could you also add a test please?

@dunglas I've added a basic test, but as the data class is final + with a private construct I cannot mock it :(

@antograssiot I've moved it in the toolbar:
Capture d’écran de 2019-11-04 12-45-05

Personally I prefer it 10 times in the debug bar, you see it directly. (like Symfony does)

@dFayet dFayet requested a review from dunglas February 19, 2020 10:58
@alanpoulain alanpoulain force-pushed the feat/debug_bar_version branch 4 times, most recently from 83c796e to e6abe46 Compare September 10, 2020 18:46
@alanpoulain
Copy link
Member

Thank you @dFayet!

@alanpoulain alanpoulain merged commit 52206c3 into api-platform:master Sep 10, 2020
@@ -96,6 +96,7 @@
"doctrine/mongodb-odm-bundle": "To support MongoDB. Only versions 4.0 and later are supported.",
"elasticsearch/elasticsearch": "To support Elasticsearch.",
"guzzlehttp/guzzle": "To use the HTTP cache invalidation system.",
"ocramius/package-versions": "To display the API Platform's version in the debug bar.",
Copy link
Contributor

Choose a reason for hiding this comment

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

@alanpoulain wouldn't it be more interesting to suggest https://github.com/composer/package-versions-deprecated for composer 1 & 2 compatibility?

Copy link
Member

Choose a reason for hiding this comment

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

Not sure about this. If the user doesn't use PHP 7.4 or Composer 2, it will find this package anyway, don't you think?
And ocramius/package-versions is the original package, it makes sense to me to add it to the suggest list.

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed 👍

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.

None yet

5 participants