r/webdev • u/velmu3k • Jul 27 '16
PHP framework Laravel selects Vue.js as default JavaScript framework
http://react-etc.net/entry/php-framework-laravel-selects-vue-js-as-default-javascript-framework21
u/picklemanjaro Jul 28 '16 edited Jul 28 '16
To save the thread from any misinformation, from /r/PHP.
https://www.reddit.com/r/PHP/comments/4uz1po/laravel_selects_vuejs_as_default_javascript/d5ufqt3
From the word of God:
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.
Also here on /r/laravel https://www.reddit.com/r/laravel/comments/4uxcpz/php_framework_laravel_selects_vuejs_as_default/d5ug5af
This is a really really bad representation of what was announced yesterday. The only thing that really changed is compilation of ".vue" files is enabled and easier out of the box. We do not ship any JS code so we dont have any "default" JS framework :)
49
Jul 28 '16
I like Laravel, and I like Vue. But I would prefer Laravel not have any opinion about things like this.
16
u/Turtlecupcakes Jul 28 '16
If you want no opinions use Symfony. If you want opinionated but reasonably well integrated, Laravel is the tool for you.
I work mostly in Symfony and tend to find it frustrating that there's no documented or "standard" way to do things like JS, so you end up hacking together your own solution.
There are upsides to both methodologies but more features existing in the community can only be good. Maybe we'll see some JS framework integration make its way into SF, then we can have the best of both worlds.
8
u/anlutro Jul 28 '16
In what situation do you feel the need for a "standard" way to interact with a PHP framework using JS?
1
u/ceejayoz Jul 28 '16
Well, as an example, standardizing on Vue means Laravel can provide front-end pagination components that work with Laravel's pagination JSON generated for API responses.
2
u/thelonepuffin Jul 28 '16
I think when people choose an "opinionated" php framework they are not expecting a front end JS framework to be one of the "opinions". Thats going from 50 to 100 real fast.
Laravel isn't actually that opinionated compared to the pre-composer frameworks like cakephp and codeigniter. Its actually quite flexible and leaves a lot of room for personalised architecture decisions.
1
Jul 28 '16
"standard" way to do things like JS
cough cough flux...
4
u/phpdevster full-stack Jul 28 '16
Redux-flavored Flux is more powerful than pure Flux, and even Facebook now recommends Redux over basic Flux (they hired the Redux dev).
However, the Redux architecture is NOT necessary unless you're building out a proper client-side application. If all you're doing is things like form validation or Ajax tables or what not, Redux (or even Flux) is beyond overkill. It's like buying a tractor to mow a 10x10 foot patch of lawn.
1
Jul 28 '16
Yup. Love Redux! But before that Flux was just a lovely shit storm of ambiguity regarding implementation.
1
Jul 28 '16
I work mostly in Symfony and tend to find it frustrating that there's no documented or "standard" way to do things like JS, so you end up hacking together your own solution.
Symfony is very much modeled after Spring, so it's going to be very Javaesque in nature and form. It's not going to tell you how to wipe your ass but it will provide the toilet paper and means to mount the roll over or under depending on your preferences.
0
u/violarium Jul 28 '16
And why not to add option for users to choose if they want vue.js or not? Why not add tool to select js framework? Also, I guess, if person want to use vue, he/she is responsible to integrate it with laravel.
1
u/ceejayoz Jul 29 '16
Why not add tool to select js framework?
Because then Laravel would need to script the initial bootstrapping of each of those frameworks, and maintain them.
Also, I guess, if person want to use vue, he/she is responsible to integrate it with laravel.
Laravel works pretty hard to make stuff easier on people. No one's forcing you to use Vue - Laravel's just being nice and making it easier if you do want to use it.
1
u/violarium Jul 29 '16
For the first time it's enough to have the choice: vue.js or nothing. And if laravel developers will see that lots of people like ember.js and they wish, they will add this. Also it opens gates for community plugins to generate what people want. The same thing with gulp.
Being nice means, that person could reject to have some files which he will never be use and not seek and delete them. Even if by default they are present but there is a choice not to generate it.
6
u/rich97 Jul 28 '16
The reason people like Laravel is that it does a lot for you but allows you to break out of it easily. Also got a great supporting toolset.
24
u/Soccham Jul 28 '16
You want Laravel to not have an opinion? Lol.
13
u/khaustic Jul 28 '16
Framework agnosticism is not necessarily a silly request.
46
u/Soccham Jul 28 '16
The joke is that Laravel is a very opinionated framework
4
u/taqfu Jul 28 '16
I'm new to Laravel. Can you tell me how it's opinionated?
6
Jul 28 '16
Has a default orm, default app structure, default everything. It makes assertions about how to send mail even.
This isn't bad, it's why it's so quick to build stuff in.
7
Jul 28 '16
It selects vue.js as the default JavaScript framework
1
Jul 28 '16
Meaning it has a vue transpiler hooked up in the gulpfile, with no actual vue code whatsoever. I guess that's kind of opinionated.
1
u/savunit Jul 29 '16
I like how you were down voted for facts. The fact is they just included the .vue extension for Laravel Elixir (Pre-built gulp file for common tasks). So you can compile components from Vue using an import at the top of your gulp file. It's more or less the same as webpack/browserify components and importing what you need. It's annoying that people go on a stupid bandwagon without understanding anything besides the clickbait title.
1
u/Soccham Jul 28 '16
/u/xmashamm gave a good simple explanation of it
Laravel is really good for getting a project up and running quickly. It's especially good for any small-medium sized project, which is where Laravel excels because you don't necessarily need or want to d o a lot of setup since it's not going to be a large scaling project.
I've heard of a lot of companies using Laravel for a Minimum viable product, and then once the site gets traction and becomes large enough switching to Symfony where they can make their own decisions regarding all of the architecture.
1
u/thelonepuffin Jul 28 '16
well its not really at all. Only compared to symphony really. But thats only because symphony is especially loose.
8
1
Jul 28 '16
True, but there are upsides to being opinionated and pitfalls to trying to stay neutral. (The reverse is true as well)
2
1
3
u/aboustayyef Jul 28 '16
Laravel is indeed opinionated, but its strong opinions are loosely held. Laravel makes it easy to use the default packages, but it also makes it easy to use other ones (no penalties whatsoever)...
-1
2
u/_atwork Jul 28 '16
1
Jul 28 '16
Well that's reassuring. I just wouldn't want it to start shipping with vue components included all ready and what not.
1
u/Caraes_Naur Jul 28 '16
Think of it less as an opinion than as a sign of Laravel's maturity that they decided they need to bundle a JS framework. How they chose to integrate it is where the opinion lies.
-1
7
2
u/magenta_placenta Jul 28 '16
Can anyone recommend some indepth Vue screencasts or tutorials that are moderately complex? I've been trying to assemble some of these internally for our team to take a look at - I haven't even found the time to do this yet.
1
u/ceejayoz Jul 28 '16
https://laracasts.com/series/learning-vue-step-by-step is great, and starts to dig into the complexity (transitions, Vuex, etc.) towards the later lessons.
1
1
u/propelol Jul 28 '16
Video series: https://laracasts.com/series/learning-vue-step-by-step
More indepth tutorials: https://coligo.io
Awesome Vue: https://github.com/vuejs/awesome-vue/blob/master/README.md#tutorials
1
3
Jul 28 '16
As a Fullstack, that uses Laravel a lot. I now have another reason to learn another framework :D Sparkly eyes
1
u/mattaugamer expert Jul 28 '16
Learn Ember. It's my favourite. Super productive and well architected.
2
Jul 28 '16
Yes it is. I already did use it because i was looking for a framework that utilizes mutability :)
2
u/mattaugamer expert Jul 28 '16
What other ones have you used? JS frameworks are so tribal it's interesting to see someone who embraces different ones.
1
Jul 31 '16
Sry for the late response.
JS frameworks that i used in production are:
Backbone.js
Ember.js
Angular
Angular 2
React
Meteor
The biggest difference in between those frameworks are their core function and some distinguished features. As i already mentioned Ember.js was the perfect solution to a problem, because the provided toolset is aware of mutability. Backbone was at the time of its release a break through for me, since it introduced me to the whole JS world, including RESTful applications. Angular or React have been the fastest way to get specific tasks up and running.
One thing that i learned was, any tool can archive anything. But Some tools are better suited to get the job done.
-6
u/siamthailand Jul 28 '16
Ember
what year is it?
3
u/mattaugamer expert Jul 28 '16
You know that's not even a funny joke, right, let alone a compelling argument? I've seen you make it before and it was baffling then too. If you want to make it a winner it has to at least be on an image of Robin Williams.
0
u/siamthailand Jul 28 '16
I don't keep track of whom I reply to or who replies to me.
With that said, that's my go to response anytime I hear anyone say Ember. What next? jQuery?
3
u/mattaugamer expert Jul 28 '16
It wasn't to me, it was to someone else.
You need a better response. This one makes no sense. I feel like you have no actual argument because you have no actual knowledge on the subject.
-2
u/siamthailand Jul 28 '16
You can feel however you like.
2
3
u/aboustayyef Jul 28 '16 edited Jul 28 '16
I love Vue.JS but am I the only one worried that it's a one guy project? Come to think of it, so is Laravel... Scrap that..
5
2
u/Kaishiyoku Jul 28 '16
I much more prefer React.
3
u/leeharris100 Jul 28 '16
React is just a view layer. Vue offers a lot of features beyond React. They aren't really comparable.
1
u/JX3 Jul 28 '16
If you read the go-through on vue.js's own site the differences in what the frameworks can do don't seem very major. I guess the discrepancy is due to you considering the companion modules to be part of the framework whereas the docs make the inspection by only taking the core package into account?
React comes with options which enable you to achieve at least most of the things you can with vue. How standardised the companion packages are does carry meaning when we consider what choice Laravel made. But when comparing the two frameworks without that context, it's not perfectly accurate to say that you couldn't compare them, when both of them are, or at least can be, used to solve the same problems.
1
-4
u/le_f Jul 28 '16
I like both these projects and it's nice to see them bundled together. Laravel is my go-to PHP framework, when I am unfortunate enough to have to use PHP for reasons outside my control :D
5
-11
u/SandalsMan Jul 28 '16
dat bloat
13
Jul 28 '16
There is no bloat. It's boilerplate. Just like how Bootstrap is included but commented out. You don't have to use it. It's there as an example. And even if VueJS was included, it's hardly bloat.
-4
u/DrVirite Jul 28 '16
Included and commented out? Worse bloat!
2
1
-55
Jul 27 '16
So, they hitched their wagon to a javascript framework that no one has heard of, and which just released it's first beta a couple of weeks ago. What could go wrong?
35
u/zeroskillz Jul 27 '16
Vue has been out for quite some time. 2.0 just recently entered beta. Also, pretty sure plenty of people have heard of VueJS. I know I've been coding with it for over a year.
2
u/moogeek full-stack Jul 28 '16
Hi, pardon my ignorance but I'm aware that VueJS exist. However I don't know what makes it better than Angular(1 & 2) and React. So can you please list down your personal opinions on why Vue is better? Thanks!
4
u/zeroskillz Jul 28 '16 edited Jul 28 '16
Keep in mind, this is subjective.
It is less opinionated
It is easier to do progressive enhancement
It is faster
The barrier to entry is extremely low
Those are some of the key points that allow Vue to be a real contender in the market. I have multiple projects personal and professional that are in a production environment that are utilizing Vue. It has been an absolute dream to work with and my team has recently switched to use it as our primary framework for front end development.
0
u/moogeek full-stack Jul 28 '16
I see I see. The faster and lighter the JS framework, the better. Should be always the top priority when you expect high volume of visitors especially if it was meant for public use.
2
Jul 28 '16
Wat? "Faster and Lighter" are extremely contextual, especially in larger applications. Facebooks JS could be 300x the size of your 10kb js file and still run faster and more efficiently than something a low level JS dev can scrap together. Top priority is security and stability, speed and file size are just optimizations, but "for public use", security and stability are the only things that matter.
1
u/moogeek full-stack Jul 28 '16 edited Jul 28 '16
security
Wat? Why would someone prioritize security in JS? More importantly, why would you put security trusts in your frontend when it can be viewed by your browser?? Shouldn't be your backend that should be prioritizing security?
1
Jul 28 '16
You want to make sure somebody won't steal cookies from other users with XSS in a very large application, for example.
1
u/moogeek full-stack Jul 28 '16
XSS are browsers and backend issues in the end since you can pretty much inject it on any browsers. Even unsafe and no validation javascript forms can be safe if you validate it on your backend since you can pretty much get tokens and session using any browsers that you made up. Even wordpress has XSS vulnerabilities but they don't fix the issues in their javascript.
1
Jul 28 '16
The Javascript code should not rely on the backend for security, because you don't know if the developers are gonna change to a new framework/library/language in the next month.
If you have detailed control over every input, that is fine, but as I explained before, this discipline may fail on large projects. Why not try something that escapes Everything properly by default?
→ More replies (0)-45
Jul 27 '16
No, not many people have heard of it/are using it.
Angular, Angular2, React, Backbone, Knockout, Aurelia. People use those. I've never heard of anyone using Vue. Maybe it's something popular in the php scene, but I avoid that scene.29
u/jordaanm Jul 27 '16
Dude, Aurelia v1.0 came out in the last 24 hours, and you're bagging out Vue which has been around for years?
6
u/ceejayoz Jul 27 '16
Aurelia and Vue have the same number of SO questions, which is even apparently his metric for a successful project. ¯_(ツ)_/¯
10
u/zeroskillz Jul 27 '16
Well your comment is just as subjective as mine. Doesn't make either of us right. However, just because you haven't heard of something doesn't make it not heard of or unpopular.
-59
Jul 27 '16
just because you haven't heard of something doesn't make it not heard of or unpopular.
Unless I'm a specialist in the field, which I am.
26
u/canadianpersonas Jul 27 '16
Hey everybody, look at this specialist in the field. JUST LOOK AT HIM!
-32
Jul 27 '16
What a scathing retort. Your mom must be really proud. I bet she makes you the best PB&J's and tucks you in extra tight at night when you let fly a zinger like that.
Shine on, you crazy diamond.11
8
Jul 27 '16
"mom"
Do you want more downvotes from unknown people?
-24
Jul 28 '16
Downvotes from php developers who think my opinions on tech are bad are about as painful as criticism from color-blind interior decorators, so bring them on.
4
Jul 28 '16
At this rate I think everybody took the bait. Just don't make this a Trump/Hillary topic.
12
7
u/ceejayoz Jul 27 '16
Meh. As a fellow specialist in the field, I've heard of (and used) Vue. Does that make it popular? I dunno.
-6
Jul 27 '16
There are metrics which you can use to gauge the popularity of it. As I mentioned earlier. Questions on SO are a good one to gauge actual use.
Angular has over 175k questions.
React has 60k
Vue has 2k.
That's 2k questions in (apparently) 2 years. That's nothing.18
u/ternarysolo Jul 27 '16
That is a poor choice of metrics there. Surely SO questions exist because people don't understand something, are confused, etc. So you are basing the popularity of a framework on how many people are confused by it?
13
u/ceejayoz Jul 27 '16
Your metric has pretty clear flaws.
I did the "getting started" in Angular and had probably a dozen "why?" questions. Vue's "getting started" left me with none. Maybe you're demonstrating it's easier to use, who knows?
Ultimately, you started this thread off with the entirely incorrect "they just had their first beta", so your opinion on its popularity isn't carrying immense weight with me.
2
u/jhoff484 Jul 28 '16
Wouldn't the greater the number of SO questions on a topic be a bad thing? I found Vue to be incredibly straight forward and their documentation is complete ( albeit not the easiest to navigate ). I've not once felt the need to ask a SO question about Vue.
While I could kinda understand the argument that there might be a correlation between the popularity of a project and the number of questions people have about it. I would assume the high number of questions would correlate more strongly to the complexity and high barrier of entry to a project. Especially projects with either a strong marketing presence within the community and / or poor documentation.
1
u/judgej2 Jul 28 '16
Not so many questions? So it's better documented and more intuitive to use? Cool.
1
6
2
2
Jul 28 '16
You might want to spend some time catching up, then. I only dabble in front-end dev, and I don't use php at all, yet even I've heard of Vue.
2
u/Disgruntled__Goat Jul 28 '16
I've heard of Vue (and was considering it for my next project), but have never heard of Knockout or Aurelia.
1
u/rk06 v-dev Jul 28 '16
You have not heard of knockout? worry not, its all right.
It is a data binding library which was popular few years back. Recently, It is present in only legacy apps and is not preferred for new projects.
You have not heard of Aurelia? the hell, you live under a rock or something?
Aurelia is a full fledged javascript front end framework. by Rob Eisenberg. It is very well designed and unobtrusive framework.
It hit 1.0 yesterday.
1
u/Disgruntled__Goat Jul 28 '16
You have not heard of Aurelia? the hell, you live under a rock or something?
LOL you're deluded if you think more than a few people know about it. Try searching this sub for it, barely any results.
1
u/rk06 v-dev Jul 28 '16
I was joking. I know of devs who have not heard of vue or webpack. Let alone Aurelia.
1
11
u/ceejayoz Jul 27 '16 edited Jul 27 '16
What? Vue has risen quickly in popularity (already has about half as many stars as React on GH), and just released its first beta of version TWO a few weeks ago. The first version has been around for quite some time.
2
Jul 27 '16 edited Jul 27 '16
released its first beta of version TWO a few weeks ago.
Ah, I misread that. Thanks.
EDIT: Also, I think that a better metric than the number of stars on GH it has is the number of SO posts on a subject. React has around 60k. Vue has 23009
u/ceejayoz Jul 27 '16
Having played with both, that may be explainable in part by Vue being a lot easier to start with. It's powerful, but it takes a lot of the "up and running quickly" from Knockout. It hits the sweet spot for me in a lot of ways.
4
u/Crye Jul 28 '16
Yeah, I would definitely agree with this. It makes so many things just easy and intuitive, and I have yet to run into any large scale problems. Also Vue seems to have a good community outside of SO. Alot of questions I have get answered in github.com issues or on Laravel forums. Oh yeah and the documentation is amazing. Gah I've really enjoyed Vue....
4
u/rk06 v-dev Jul 28 '16 edited Jul 28 '16
React has around 60k. Vue has 2300
React has around 46k and vue has 23k.EDIT: he is talking about SO questions, not github stars.
19
u/Yurishimo Jul 27 '16
What the hell are you talking about? Vue.js v2 went into beta a few weeks ago. The framework itself has been around for about 2 years at this point (though it wasn't in 1.x for very long due to the insane growth in the user base).
The biggest upside to using Vue with Laravel in particular is its close coupling with the DOM using directives. Laravel's template engine makes it easy to insert those directives. Whereas with React would need to recreate everything via JS.
Finally, Laravel's creator has a commercial product built with Vue.js and it's been very well received. At the end of the day, Laravel is his project. He'll do what he wants.
5
u/d_abernathy89 Jul 28 '16
Ugh this is getting way overblown. The only thing that happened is that Vue was added to the package.json and a very minimal boilerplate Vue template (completely unbound to the framework itself) was added to the repo. It's completely optional.
1
u/mattaugamer expert Jul 28 '16
Does that mean if you're not running Vue or running no JS framework at all you need to remove it? Just curious, I use Laravel exclusively for APIs now.
1
3
Jul 28 '16
You might want to look at the popularity of search terms surrounding JS frameworks. If you haven't heard of VueJS by now, I'm not sure you even keep up with what's actually going on. But hey, you're more than welcome to not use it and switch to pure JS, Ember (lol), or something else. It's boilerplate anyways. No one is forcing you to use it.
1
-13
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.
This won't really affect October CMS at all, it intentionally avoids pushing opinions on the developer. Use whatever front-end framework you like, at the end of the day, the front-end is not much different to creating a site using Notepad.
edit: Added quote for people who can't read.
5
Jul 28 '16
Doing some link building in reddit, huh?
-1
u/daftspunky Jul 28 '16 edited Jul 28 '16
Doing some article reading huh?
1
Jul 28 '16
I can read and I can see that you have used the exact same wording for the link in two different articles, even though Notepad is not related at all.
Nice try, though
1
-1
u/daftspunky Jul 28 '16
It is the same article in two subreddits. Notepad is the purest example of being un-opinionated. Sorry that you missed the point.
2
u/r0ck0 Jul 28 '16
Good point! While we're on the subject... Pink slippers make horrible pizza toppings.
1
u/daftspunky Jul 28 '16
Learn to read dude, you are making aussies look bad
Also, I am your dog, I'm supposed to be dumber than you
SPUNKEEEEEEEEEEE SPUNKEEEEEE
0
Jul 28 '16
[deleted]
1
u/leeharris100 Jul 28 '16
Angular 2 won't flop, too much support from Google.
But it definitely won't be the biggest either. I've used Angular 2 on two large scale enterprise SPAs for a healthcare company.
It works really well for those larger scale projects and offers some great advantages, but it has some complexity which will turn off a large portion of the community.
8
u/scootstah Jul 28 '16
Angular 2 won't flop, too much support from Google.
You mean the company famous for suddenly dropping projects when they get bored of them?
0
Jul 28 '16
[deleted]
0
Jul 28 '16
[deleted]
0
Jul 28 '16
[deleted]
0
Jul 28 '16
[deleted]
4
u/nyxin The 🍰 is a lie. Jul 28 '16
....if your lawyers would have read it, they also would have noticed that clause doesn't go into effect unless you're building a competing app that uses React AND you decide to sue Facebook for some reason.
I'm no law professor but it kind of makes sense to revoke a licence for software that you use if your going to sue the company that produced that software.
0
Jul 28 '16
[deleted]
4
u/ternarysolo Jul 28 '16
Here are some interesting thoughts: https://medium.com/@youyuxi/i-dont-think-you-are-looking-at-it-objectively-3b4381d8c0f2#.3ne090jg5
3
Jul 28 '16
Most likely their license and the fact that Vue is easier, lightweight, and takes maybe a few days to learn depending on how much time you spend on it.
0
Jul 28 '16
[deleted]
2
u/HomemadeBananas Jul 28 '16
How is React overkill? It's a pretty small library that does one thing well.
1
u/vivainio Jul 28 '16
React is not 'small', 151kb (which is more than ng1).
3
u/magnakai Jul 28 '16
It's about 44kb when minified and gzipped.
1
u/HomemadeBananas Jul 28 '16
How is 151kb big anyway, lol?
1
u/magnakai Jul 28 '16
It's big enough to think about, when you're talking about a library that's fundamental to layout etc. Obv compared to photos it's nothing, but you can still read text etc if the photos don't load.
43
u/[deleted] Jul 27 '16 edited Oct 11 '16
[deleted]
0.8489