leafsphp / leaf

🍁 The easiest way to create clean, simple but powerful web apps and APIs quickly
https://leafphp.dev
MIT License
1.1k stars 68 forks source link

Add dev symfony/var-dumper for development and debug #103

Closed Awilum closed 2 years ago

mychidarko commented 2 years ago

Hi @Awilum, can you please explain why this is necessary?

Awilum commented 2 years ago

I propose to add this lib as a dev dependence only and its adds ability to debug your app by using dump and dd https://packagist.org/packages/symfony/var-dumper this package usually included by default in the most popular frameworks like Laravel and etc... https://github.com/laravel/framework/blob/8.x/composer.json#L44

mychidarko commented 2 years ago

Looks great, but I'm trying to keep the dependencies to only what people need in everyday development.

People can always add this to their apps when the need arises.

Besides, if it's a dev dependency only, won't users not even have access to it?

Awilum commented 2 years ago

Besides, if it's a dev dependency only, won't users not even have access to it?

Dev dependency installing when you are running composer install and if you do not want dev dependency you should run composer install --no-dev

https://getcomposer.org/doc/03-cli.md

--no-dev: Skip installing packages listed in require-dev. The autoloader generation skips the autoload-dev rules.

Awilum commented 2 years ago

Using symfony var dumper for development is same as using pest for unit tests

mychidarko commented 2 years ago

Looks great, but I'm trying to keep the dependencies to only what people need in everyday development. People can always add this to their apps when the need arises.

Awesome, but this still stands. Your thoughts?

Awilum commented 2 years ago

Looks great, but I'm trying to keep the dependencies to only what people need in everyday development. People can always add this to their apps when the need arises.

Awesome, but this still stands. Your thoughts?

As I say before: using symfony var dumper for development is the same as using pest for unit tests.

I would say more, you should add phpstan too. Its fine practice to have such dependencies and work with them in any php project: https://github.com/thermage/thermage/blob/dev/composer.json#L38-L43

mychidarko commented 2 years ago

I would say more, you should add phpstan too. Its fine practice to have such dependencies and work with them in any php project

😂😂 I get that they will help with development especially with the phpstan recommendation. But with the dump method for example, what's a practical use case for it in leaf?

Just clarifying, this would be used by leaf users right?