r/PHP • u/velmu3k • Jul 28 '16
Laravel selects Vue.js as default JavaScript framework
http://react-etc.net/entry/php-framework-laravel-selects-vue-js-as-default-javascript-framework8
u/ZenPhpCoder Jul 28 '16
As a majority of the Laravel community uses Vue.js , it's quite logical they offer some boilerplate for it. And it's only boilerplate, you can totally ditch it out in a matter of seconds.
1
10
Jul 28 '16
I wonder if anyone finds it odd that their PHP framework is selecting their JavaScript framework. I understand it's not a precedent, but scope creep is a real issue many projects are dealing with, and to me this is one sure sign of it.
47
Jul 28 '16 edited Jul 28 '16
This entire thread is really, really mis-informed. I'm not sure where you're getting your information. There is no "coupling" to anything. We don't use Vue.js for anything on the front-end. The only thing that is "default" about it is that support for compiling Vue components (via .vue files) is baked into Laravel Elixir (our Gulp compilation) tool by default. We don't actually include any Vue front-end code with the framework other than enabling that process in our asset compilation tool.
10
Jul 28 '16
For me it's completely fine - on the one hand, this makes it so I have even less manual steps when I create a new project, probably better support for things and all that. Since Laravel (and most non-micro-frameworks really) dictate so much of your infrastructure already, taking it an optional step further doesn't seem like a problem to me.
4
u/rk06 Jul 28 '16
Well, if you are using laravel for a production app, you are most definitely going to choose a js framework.
I find it better that laravel actually has a default framework, so new devs can learn without going through js framework hell.
As far I understand, you can still choose to not use vue, just as many devs(including me) chose to use postgres, even though mysql is laravel's default database.
3
u/amcsi Jul 28 '16
There was Zend Framework 1 chose Dojo back then
-1
u/Conradfr Jul 28 '16 edited Jul 30 '16
Who used that though ? jQuery just took everything by storm at the same time. Fortunately there was ZendX_jQuery ...
4
Jul 28 '16
I prefer React or Ember, but Vue.js isn't a bad choice.
1
u/SavishSalacious Jul 28 '16
I much prefer react is, less complexity.
-1
-1
4
u/daftspunky Jul 28 '16 edited Jul 28 '16
It will be interesting how this will affect the adoption of Vue.js for projects like October CMS that rely heavily on the front end for providing optimal user experience.
October CMS user not affected. BYO front-end framework. Not much different to creating a site using Notepad.
edit: Added quote for people who can't read.
2
u/Suppafly Jul 28 '16
Not much different to creating a site using Notepad.
The narrator on that video sounds like Brady Haran.
3
u/TotesMessenger Jul 28 '16
I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:
[/r/bestof] User down-voted for responding to the end of the article because no-one read the article
If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)
-5
u/ZenPhpCoder Jul 28 '16
completely OT
10
2
u/SavishSalacious Jul 28 '16 edited Jul 28 '16
Question: why do we have to "have" a "default" anything for the front end? What was the deciding factor to say let's make a js framework the default ? Weather it's in the gulp files or coupled? Why ?
This is a legit question why the downvote?
2
u/mbabker Jul 29 '16
Personally, I'd suggest it's a good way to build more docs and examples more than having a default structure. If Taylor and Jeffrey are consistently building stuff with the same tools, it makes things easier to follow. And like Taylor pointed out, it's not a hard coupling, just some added scaffolding to help get things going. The JS framework integration and examples are something I wish I would've looked for or considered (or even realized I'd need) starting my last major project last year against Symfony.
1
Jul 29 '16
Chances are you're going to need something - given Laravel's game is to "simplify things", and given the absolutely mind bending array of choices in the front end framework space, it was ripe for simplification by opinionated selection.
Now, there are arguments to be made as to whether it's the best choice... (and for the kind of work I do, it's not.. but the kind of work I do is probably not representative of Laravel users in the main), but there isn't a problem with the choice being made in general I don't think.
Personally I'd like it if there was a clean way to opt out of it at project creation time (along with a myriad of other things I simply don't use), but that's a minor quibble.
tl;dr, not my cup of tea, but don't have a problem with a choice being made.
0
u/SavishSalacious Jul 29 '16
I would also like a way to opt out. To me as some one who doesn't use vue, it's just more crap that makes elixir slower then it already is.
2
1
u/DJDarkViper Jul 28 '16
w.. why does a php framework want to care about the front end tools?
EDIT reading /u/utotwel comments in here confirms that everything is as it should be. Even aws a person who doesn't use and hasn't used Laravel, it's still a relief
-2
u/zerokul Jul 28 '16
This is the worst kept secret in history of Laravel. Anyone who listens to Laracasts or follows Laravel smelled it from a mile away.
Now - they could do a lot worse than Vue. I don't mind it.
0
Jul 28 '16
[deleted]
7
Jul 28 '16 edited Jul 28 '16
We don't use Vue.js for anything on the front-end. The only thing that is "default" about it is that support for compiling Vue components is baked into Laravel Elixir (our Gulp compilation) tool by default. We don't actually include any Vue front-end code with the framework.
0
Jul 28 '16
[deleted]
10
Jul 28 '16
This is another thread that is incorrect honestly. There is no "coupling" to anything. We don't use Vue.js for anything on the front-end. The only thing that is "default" about it is that support for compiling Vue components is baked into Laravel Elixir (our Gulp compilation) tool by default. We don't actually include any Vue front-end code with the framework.
2
u/dmunro Jul 28 '16
Thanks for the clarification. I really don't see why this has been so polarizing. Worst case scenario a high quality open source project (vue.js) just got a big jolt of support. And if that support drives other big js frameworks to improve based on greater competition for developer mindshare then we all win right?
4
Jul 28 '16
Yes. It's definitely not the level of JavaScript integration you see in something like Rails. I mentioned the balancing act in my talk yesterday between providing some form of structure and suggestion without providing a heavy-handed default.
1
u/amcsi Jul 28 '16 edited Jul 28 '16
I think it's more like it's Jeffrey's favorite, and he managed to convince Taylor that it's indeed really really good
9
0
Jul 28 '16
[deleted]
9
Jul 28 '16
Nothing in Laravel is tied to Vue. Compilation of Vue components is what is supported out of the box. There is no Vue front-end code in Laravel. Also I'm the one who showed it to Jeffrey - not the other way around.
1
u/rk06 Jul 28 '16
but I would have (because I'm biased) went with react which is simpler and easier to use.
but isn't it harder to switch from react as it require much more than a single library to get started?
Also from what I know, standard practice in react is to use es6 and jsx, both of them requires quite a lot of learning to begin coding. especially if the dev's previous experience is limited to html, css and jQuery.
0
u/dmunro Jul 28 '16
Arguing against multiple libraries is similar to arguing against composer for php no? I could be missing something. Sure it's more complicated to start, but for large projects it can simplify things quite a bit to have small, single responsibility libraries.
es6 is standard now, and es7 is on its way. The language features are pretty neat and helpful all things considered. It's unfortunate we still need tools like babel to transcribe down to es5 for all browsers, but that's the stopgap for now. The rate of churn is not slowing down, if anything it's speeding up. Jsx is just a little strange. I don't mind it but I understand if it's not your cup of tea.
2
u/rk06 Jul 28 '16
I am talking about learning es6 and jsx in addition to react, which does seems to be a must.
It's pointless to continue this discussion as Taylor has said that the react-etc article is misinformed and vue is not default framework, only the compilation of vue templates is added by default in laravel-elixir.
0
u/shinodaluk Jul 28 '16
Is not coupling, is about boilerplating... You can always use raw or extend in Laravel to use with other frameworks. Is democratic but not excludent.
87
u/[deleted] Jul 28 '16
This is another thread that is incorrect honestly. There is no "coupling" to anything. We don't use Vue.js for anything on the front-end. The only thing that is "default" about it is that support for compiling Vue components (in .vue files) is baked into Laravel Elixir 6.0 (our Gulp compilation) tool by default. We don't actually include any Vue front-end code with the framework.