tighten / collect

A Collections-only split from Laravel's Illuminate Support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dependency of sf var_dumper

mathieutu opened this issue · comments

Hi,

Are we really obliged to have the var_dumper in dependency?
In fact, the dump/dd functions are almost not used comparing to other, and in my opinion we shouldn't force people to have this dependency which have no link with collections.

In fact I want to use a package which needs tightenco/collect on a symfony 3.3 projet, and I can't install it because of the var_dumper version 4 required (conflict with sf 3.3).

@damiani made the change here 18d0338 and here 094fd59

I really think that we should let the var_dumper as a suggestion for this package as it was initially.

https://github.com/tightenco/collect/blob/eb2af608395aaacc09dc7ed5eff24546daad88ec/composer.json#L14

Thank you for your help,
Matt'.

Removing VarDumper will throw an exception if dd() is used:

image

It would be nice if we could fall back to var_dump(), but that's how Illuminate's Collection works now.

@mathieutu, I'm not sure if you want it gone or just install Collect in your project, because we could just:

"symfony/var-dumper": ">=3.1.10"

And it should be installable on 3.* and 4.*.

image

I just sent a PR to make it >=3.1, but I know that "the less dependencies the better", so @mattstauffer, feel free to close it and just remove the dependency ;)

@antonioribeiro thanks for the PR, this is the minimum to do indeed. But as I said, theses 2 functions are only used for testing, so we shouldn't include the dependency by default. A suggestion as it was previously is the best choice for me: if you want to dump, you can install the package (on your dev dependencies ideally).

@mathieutu I almost agree with you ;)

But, somehow I don't like very much to see things breaking like this, and expect that the user (yeah, a developer) will realize it's something they should install, which was shown to them (as suggestion) only once, when they first installed the package. I'll say it again: I'm not against it, I just don't like it very much.

Well... I also think this communication problem may be fixable for us all, by someone above us, omniscient, so I just opened an issue in Composer: composer/composer#7123.

Nice work @antonioribeiro!

In general, I agree with Antonio. People very seldom read the suggestions; and when something breaks, their first thought will not be "Oh maybe there's a suggested package I didn't install here."

If that Composer tickets fails, we could possibly see if there's any way we could bind a var_dump style alternative ourselves if the package does not exist? Haven't looked closely at how it's bound/called, so I don't know.

Yeah I understand that, and I know you're right. I love the @antonioribeiro issue on Composer and we'll see what will be next.

Thanks for help anyway with the var_dumper version!

Closing as it's resolved as far as we can get it; let's re-open if we hear from Composer. :) <3