laravel / ideas

Issues board used for Laravel internals discussions.
938 stars 28 forks source link

Yeoman, why not? #227

Closed giovannipds closed 6 years ago

giovannipds commented 8 years ago

Hello. I wonder, why does Laravel Framework has its own CLI to create new projects, instead of using Yeoman for that? That's something that beats me. Yeoman is such an excellent tool, why not?

mattstauffer commented 8 years ago

I'd bet one reason is that PHP is a dependency for Laravel to run, whereas NPM isn't, so it makes more sense to use PHP to run its installer.

giovannipds commented 8 years ago

That's a very good point, and you may be right. But, Yeoman is a system to generate any kind of project, not just for Node and JavaScript, but for PHP, web, Java, Python, C#, etc., whatever!! Wouldn't it be better to start using this project as well, migrating the installing way to Yeoman?

I mean, we would be able to set many kinds of options through there, namespace, starter configuration, like, with SASS or with Stylus, with Grunt or with Gulp, etc... plus the point of using another very good project with a specific objective, like we're already using many others, like dotenv, editorconfig, etc.

I'd love to hear more community's concerns. I really think Laravel Framework will be enhanced in Yeoman's atmosphere.

giovannipds commented 8 years ago

What's your opinion @mattstauffer?

michaeldyrynda commented 8 years ago

I think the point Matt was getting at initially is that you don't want to have to depend on an NPM package to install a PHP framework. I'd much rather use PHP and Composer to install Laravel than bringing in something out of the Node abyss, personally.

crynobone commented 8 years ago

typically how would you install yeoman on a new machine, either it be Windows, Mac or Linux?

giovannipds commented 8 years ago

@michaeldyrynda I understand that, Mike. But we will have NPM later as well, because we will need Gulp/Elixir for front-end. If we have a "package.json", we will need Node/NPM, we'll use that. So, I don't agree that'd be a good point. I think using Composer to install limits us, 'cause it's just a natural fork, we don't have the power to actually change the file tree itself as needed. Yeoman's give us the power to ask the user what he wants, what he needs, and provide the project exactly like he have answered.

michaeldyrynda commented 8 years ago

You can opt to not use gulp/elixir for your frontend concerns, so they're optional. If you force users to use some NPM module to install the PHP framework, you're going to get in their way more than not. How often are users wanting to fill out a questionnaire just to get up and running?

I'd suggest more often than not, laravel new or composer create-project is more than enough and any further customisation is done after install. What kind of things are you thinking would be needed as part of the installation step?

giovannipds commented 8 years ago

@crynobone Easy!

  1. The user will install Node.js/NPM, which most of them will already have nowadays. If don't, Node.js's website has the installation instructions.
  2. He'll just run npm install -g yo generator-laravel-etc to install Yeoman and Laravel's generator globally.
  3. He'll create the project, running something like yo laravel, and will be able to answer some interactive questions, like:
    1. What's your project's name? (we would be able to set the namespace here)
    2. Do you want to use Gulp or Grunt as your task runner?
    3. Do you want to use SASS, LESS, Stylus or native CSS for styling?
    4. Do you want to use Homestead?
    5. etc. (we can ask whatever we want there)

Doesn't it sound great?!?

giovannipds commented 8 years ago

@michaeldyrynda Yes, you can, but won't be that good. I think we can still have the installation through Composer as well, but we should really encourage the developers to use Yeoman.

Well, I think, if the questionnaire will be something important to them, I mean, why not? In that case, you can ask a first question to filter that, like "Do want to customize the tools used to your project? (y/n)" - if the answer is no, we just do the fresh normal installation.

Check my comment above.

michaeldyrynda commented 8 years ago

I dunno; a lot of work has been done to get out of developers' way so that they can just start building. A lot of the previously manual steps have been rolled into the Laravel installer to make the process as simple as possible.

You could always build this as a separate package / tool, I don't see much value in it being added to the framework itself as it feels like it flies in the face of the philosophy. I'm not convinced otherwise at this stage.

giovannipds commented 8 years ago

@michaeldyrynda We can change the first question that I've suggested above, considering that the user usually rushes to answer yes as soon as possible. It can be something else like:

Standard installation? (y/n - answer "n" for customization)

Or:

Standard or custom install? (answer "s" or "c")

I don't know...

giovannipds commented 8 years ago

@michaeldyrynda Have you ever started a project using Yeoman? If you don't, please just do it, just once. I feel in love at first time. It gives us too much power. Please just do the Getting Started.

giovannipds commented 8 years ago

Anyway, I thank you all for the interaction and discussion.

giovannipds commented 8 years ago

Another question that would be probably possible, is Do want to use Homestead? (y/n) - I hate to install Homestead later...

michaeldyrynda commented 8 years ago

I think the number of existing Laravel generators and their age shows that it's probably not something that'll get much traction if I'm honest.

You're using Homestead per-project, yeah? Might be worth creating a base repository for your Laravel apps.

giovannipds commented 8 years ago

@michaeldyrynda And I think we're driving in a parallel not-needed way, on this aspect, at least. Don't worry, we're just sharing knowledge and arguments - that's not personal.

Yeah. Exactly what I wouldn't like to need, because that's the purpose of Yeoman.

franzliedke commented 8 years ago

@giovannipds I think @mattstauffer already made the most important argument in the first comment. Node/NPM is not just any dependency, and I very much don't agree that "most people" (whoever that is) will have it installed.

You already wrote:

I think we can still have the installation through Composer as well

Then why not keep the framework as it is and leave the Yeoman generators up to the community - they're very much a separate project anyway. And if they're that much better as you say, surely they will see some uptake in the community.

giovannipds commented 8 years ago

@franzliedke I think we ARE the community, and I think we must encourage the use of great projects. Yeoman, is (for me), one of them. If we'd leave it up to the others, we would also have left Gulp, Grunt, DotEnv, etc. in the past, many developers wouldn't have done anything.

But yeah, some developers have already tried to provide a Yeoman's generator for Laravel, there're some packages there, although nothing official. I was just considering in having something official, of the Laravel community, something we can really believe on. We have some many things in the framework, that it would be great, it would be a good plus.

If guys don't think the same, I can't say a word. But the opinion of yours, seems to be just an opinion, not a technical reason, seems to be just an opinion of someone who has never tried Yeoman. If it was an opinion like this, you'd have been much better. Sorry, I hope that doesn't sound like I'm offending you, 'cause I'm not, that's not the objective here. Just bringing the topic up.

franzliedke commented 8 years ago

Oh, I don't mind. It's good to see people enjoying an open-source project so much.

"Yeoman is JavaScript, Laravel is a PHP project" is a pretty technical argument, though, if you ask me. ;)

jlaswell commented 8 years ago

I feel there is a lot of solid reasoning here as to why Yeoman isn't supported. I think you may be a little over impassioned on the benefits of Yeoman in comparison to all of the tools already provided. It's great that you see so much potential for a tech that you love, but I agree with the majority here. Laravel is a PHP project, and I think @franzliedke's reasoning is spot on.

giovannipds commented 8 years ago

@franzliedke From Yeoman's about page: "... Yeoman is language agnostic. It can generate projects in any language (Web, Java, Python, C#, etc.)...'

giovannipds commented 8 years ago

@jlaswell @franzliedke I do agree with you in this point though, but have you ever tried Yeoman? I'd love to hear your perspectives after doing the Getting Started.

mattstauffer commented 8 years ago

I'm not in charge. But my opinion, as someone who has used Yeoman and has NPM installed on my machine: Yeoman provides no benefit in this context, but it does add dependencies and increase the onboarding cost for new developers.

It's cool that @giovannipds is excited about Yeoman. This to me looks like a perfect opportunity for him to go create the ultimate laravel-yeoman-generator and go make it awesome and show how great it is. Who knows; maybe it becomes so popular that demand for it overtakes demand for the Laravel installer. Great!

Hoewver, I cannot see a single compelling reason to transition the Laravel project to formally using Yeoman. IMHO, there's no reason for this.

I'm now going to leave this here and unsubscribe from this thread. :wave:

giovannipds commented 8 years ago

@mattstauffer Great to hear you have used it, at least. Yes, Yeoman adds some dependencies, just like the other tools we're already using in the project. I don't see that like a barrier to the new developers.

Perhaps, we'll see...

The reasons I was bringing the topic, was:

  1. We would be encouraging the use of a tool that is great to create any kind of a project, in any kind of language, not only PHP. We would be opening some people's minds;
  2. We would have the ability to increase the agility of projects creation (use of the framework, the main purpose) that differs a little of the standard patterns imposed by the framework, at least talking about front-end - Gulp or Grunt; CSS, LESS, SASS, Stylus - etc;
  3. We would support and use a tool that's the main purpose is projects creation and customization - which the tool does that well.

It's kind of weird getting so much developers here against me, laughing at some points, but I think the discussion was beneficial. At least, if any other developer searches about "yeoman" in the repo, he'll find our arguments.

Thanks again you all.

I'll let the topic open to someone else here with more power read, argue, close etc.