Hey,
All the cool guys are moving to gulp :)
Few reasons to consider gulp vs grunt:
I've run a few tests on some of my projects and the results are really great. lines of code reduced and the all this grunt config(ala xml but in json) is gone.
what do you think?
@BlueHotDog what about starting with sails-generate-gulp? Then we modify sails-generate-new to allow for using gulp instead of grunt. Then you could do:
$ sails new foo --buildsystem=gulp
If the community at large likes gulp more, and we find it makes folks more productive, we could switch the defaults eventually. To me, this sounds like a good approach to take for any new thing like this. What do you think?
:+1:
@mikermcneil Your approach is probably best. To me it doesn't matter if I use gulp or grunt, as it's the least important part of my application and can be swapped out at any moment. So for now I'd like grunt as the default.
@mikermcneil Thats the way to go :+1:
Awesome, thanks for the feedback, guys. @BlueHotDog if you want to start a gulp generator, you've got my full support. Here to help if you have any questions. Also, if you want me to make a repo for it, I can- but either way, really.
Cool. Should i work on top of any specific branch?—
Sent from Mailbox for iPhone
On Tue, Mar 4, 2014 at 9:50 PM, Mike McNeil [email protected]
wrote:
Awesome, thanks for the feedback, guys. @BlueHotDog if you want to start a gulp generator, you've got my full support. Here to help if you have any questions. Also, if you want me to make a repo for it, I can- but either way, really.
Reply to this email directly or view it on GitHub:
https://github.com/balderdashy/sails/issues/1461#issuecomment-36665950
I'd say forking https://github.com/balderdashy/sails-generate-gruntfile is probably the easiest way to get started- you should only have to replace the templates and edit the targets in lib/index.js (https://github.com/balderdashy/sails-generate-gruntfile/blob/master/lib/index.js#L15)
To test it, you can run node bin/index.
Once that's good, you can test it properly by putting a .sailsrc file in your home directory like so:
{
"generators": {
"modules": {
"sails-generate-gruntfile": "/path/to/your/gulp/generator/implementation"
}
}
}
and then run sails new foo to get a new project.
When you're ready, we can create sails-generate-taskrunner or something and call it from sails-generate-new so it's easy to switch between gulp and grunt (then the grunt generator would become sails-generate-taskrunner-grunt and gulp would be sails-generate-taskrunner-gulp
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
Any progress on this?
If not, I can probably put some time into this, been using Gulp a lot lately.
+1
+1
+1
:+1:
There are enough gulp and grunt users to justify supporting both officially. I'd presume gulp support could make it in providing code quality was good and both work.
Ultimately the responsibility of providing support for both gulp and grunt falls upon the community maintaining it.
@niallobrien, @BlueHotDog, anyone else, want to take a stab at this?
@tony @niallobrien Thanks guys- would you be down to set up some time for a weekly hangout for folks interested in contributing to core/generators/adapters? We can walk through how the generators are set up/configured etc.
the core contribs went over this together, noted it, and are now closing this issue to keep tidy. Thanks!
I am currently working on gulp generators
https://github.com/Karnith/sails-generate-gulpfile
https://github.com/Karnith/sails-generate-frontend-gulp
https://github.com/Karnith/sails-generate-new-gulp
I have the generators working with .sailsrc and gulp tasks in the tasks folder. I'm still working through some of the details, but I hope to have it production ready soon. I will then work on getting sails lift to work.
I have the gulp generators working and a hook that allows sails lift to call gulp. So far the system is stable and tasks have been built out (except for jade support).
@mikermcneil could we implement this into Sails using your idea of sails new foo --buildsystem=gulp?
@Karnith +1 for the idea, hope we can get rid of grunt soon
I'm most interested in a Sails & Angular generator. I've been using a lot of different generators lately & find them lacking in one form or another.
@mikermcneil I apologise for missing your hangouts, the time difference is a barrier for me, (Texas vs Ireland). Have they been recorded and uploaded to YouTube?
@niallobrien Ireland! I miss Galway... my wife and I moved to the us back in 2010 cause recession was getting really bad... As for angular, there is a generator for this and sails.What do you feel is lacking?
@andyhu grunt and sails will always be together.
@karnith Awesome, I'm in Waterford (south-east), home to NodeconfEU.
My main gripe with a lot of Yeoman generators is that a lot are still using Grunt. Gulp-sass is much faster than gulp-ruby-sass too, some lack proper notifications with gulp-notify and some even break on sass errors. So I end up modifying most generators.
And for the record, I vote we ditch Grunt. Gulp is far easier to work with.
Well, I've alway been partial to code over configuration myself, but at this time sails is far to in twined with grunt for this to happen. I know Waterford, when my wife and I got married, we stopped there to Waterford crystal on the way to the ferry for France. Too bad they closed down though...
here is the discussion on my gulp generators
+1
Like mikermcneil proposal of letting users have a choice of either grunt or gulp. Over time, if there is a clear favourite then ensure that becomes the default. Some of it just boils down to what is most familiar / convenient to an individual at a given moment in time.
How about third proposal about to let users have neither grunt nor gulp? And move grunt or gulp with their tasks to devDeps in package.json?
+1
+1
+1
any update on this?
+1
+1
+1
+1
+1
Really hate it to install the grunt* deps every time!
SailsJS is API-Backend only for me!
I think this is not too hard to do. Check Mean.io, it's default to grunt but can be set to use gulp. For me I really don't like those grunt* dependencies too
Adding my +1 as I'm having to do some funkiness to support gulp with the current config since it is our 'production' approach.
@gregorypierce What funkiness? We were able to completely strip it pretty easily, just have to make sure and edit the .sailsrc.
I used a tool to convert the grunt to gulp and I've had a stream of dependencies grow from it to the point that there was a lot of concern about whether or not this was an astute approach to solving the problem vs just waiting for the framework to support it.
+1
gulp is very needed. currently the only thing stopping the use of sails js for some people.
As I already said on an other issue:
node_modules directory. So, feel free to use community hooks/generators or don't hesitate to create your own and share it with the community.Then, as we can read on a presentation of the Grunt team about the state of Grunt:
Grunt, Gulp, Broccoli, they're actually all good options. As long as you're using something, you're ahead of the game!
In my opinion Sails shouldn't take care of the front-end at all but it's pretty convenient for a lot of developers to have something running by default.
Thank you for your comprehension.
In my opinion Sails shouldn't take care of the front-end at all but it's pretty convenient for a lot of developers to have something running by default.
Exactly my opinion. I would strip everything frontend related from sails and build meta-packages like "sails-grunt-mvc" or "sails-gulp-angular". Everytime fetich the huge grunt stack and disable it via .sailsrc is not very nice
ok, so now when you start a sails js project - you get grunt by default, its modules and different configuration files.
is there a flag to not install grunt? for just the backend skeleton app?
You can do sails new myApp --no-frontend
you only can disable it but npm will fetch grunt
yes, by using the --no-frontend some grunt files are not included in the app, but still grunt is present in node_modules and is tightly coupled with generators, etc.
it would be awesome to exclude all the grunt files and let the user use gruntgulp or any other generators aside from sails js skeleton.
don't you share that idea?
Yes I agree. Indeed, this is what I have done on our own fork of Sails...
Is your fork public?
Im planning a fork too to solve issues like this
Yes it is: https://github.com/extensdotio. Still a lot of work to do, it's only a developer preview.
thank you for the info, will try sails and the gulp extensions.
I hope some day, maybe 0.12 or 0.15 this would be easily done out of the box
+1
@loicsaintroch Thanks for the info, extens.io looks very promising, I'm planning to build a CMS system on top of sails, which will borrow some ideas from Drupal and KeystoneJS, I may try to build it with extens.io
+1
+1
What is the current best way to swap in gulp?
@Deminetix There are a few gulp generators out there for sails: https://www.npmjs.com/package/sails-generate-new-gulp
You can also disable grunt in .sailsrc, and add your own gulp hook to build your own gulp tasks from the ground up. Something like:
.sailsrc
{
"hooks": {
"gulp": true,
"grunt": false
}
}
/api/hooks/gulp/index.js
"use strict";
var spawn = require('child_process').spawn,
module.exports = function (sails) {
return {
initialize: function (next) {
if (!sails.config.hooks.gulp) {
return next()
}
spawn('gulp', 'lift:'+sails.config.environment, {stdio: 'inherit'})
.on('exit', function (code) {
next()
})
}
}
}
Oh, those generators are mine! Thanks for reminding me, I need to update them and ensure they still work with the changes made in Sails...
Thanks, I gave that generator a whirl and it seemed to work ok but it still installed a bunch of grunt modules.
I ended up using --no-frontend and did the gulp system from scratch as our frontend build system is quite a bit more complex.
I started working on integrating gulp into sails natively. It's still in dev stage, but if anyone wants they can try
npm install -g Karnith/sails
I ripped out grunt and wanted to get gulp working first before I create a switch for sails new and pr the sails dev team with it. :)
@Karnith How has your progress been?
I got it working, I changed the name to sails-for-gulp. I haven't had much time to work on it more though... I've been swamped at Microsoft and had a daughter 2 months ago... well my wife did, not me... lol. I plan on picking back up the project here soon, so if anyone wants to help let me know. I was starting on making core revisions to the generators and converting them to machine packs.
If I just want to use my own gulp file for front end stuff, how do I got about it?
I don't care much about the generators, I just want a good build/rebuild time when I code.
Is there a documentation anywhere how to do so?
If not I'd be happy to write it with some directions :)
Well first you'don't need to create a hook for gulp, then you'd need to disable grunt in sailsrc. You would then need to recreate any tasks to move assets, images, etc. to the temp folder (or folder of your choice). You can do this all yourself, but generators do all that work for you so that all you need to worry about is coding...
I don't understand.
I never tried sailsjs. I don't know where to begin.
what's the flow. where do I put client logic and where server.
Can't find documentation either.
Can someone point me?
Any tutorial or example app?
Hi Karnith , is sails-generate-new-gulp yet supported?
@Whiskas sails-generate-new-gulp has been deprecated. Use https://github.com/Karnith/machinepack-sailsgulpify it allows you to switch between sails and gulp using a command. It's a better module than sails-generate-new-gulp.
I'm working on an angular machinepack as well.
I abandoned forking sails and adding gulp natively, not because I couldn't get it to work (I actually did get it to work), but because I didn't want the job of maintaining a fork. Hence the machinepack
@Karnith thanks for the work you did do though. Not having gulp really bothered me.
So, it's 2016 now... Any signs on official gulp support?
@jordyvandomselaar the maintainers don't owe you anything and your attitude is unhelpful. It's a free project. If you want it, build it or pay Balderdash - they are a consulting company.
-kevin
On Apr 21, 2016, at 00:56, jordyvandomselaar [email protected] wrote:
So, it's 2016 now... Any signs on official gulp support?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
wow, people seem on edge these days... @jordyvandomselaar while I don't think you meant any wrong, the discussion of gulp vs grunt with sails has become a sensitive topic these days. I have a project, machinepack-sailsgulpify that will add gulp support to sails in the same way they have grunt added. In the past I have questioned the same, if they would support gulp, and although feedback was extremely high for this feature, they decided against this. I even created a fork of sails and added gulp natively, which wasn't hard seeing as gulp is similar to grunt (if memory serves me right, I believe the creators of grunt also created gulp). I since closed that project as I didn't want or have the time to maintain it and sails team wasn't about to. at any rate, I don't believe there will be an official gulp version of sails, but if someone wants to start and maintain one I'd be more than happy to show them how to integrate gulp natively.
You're right @Karnith, I didn't mean any wrong. I didn't see anyone talking so I decided to ask about it as I might have missed them adding support for it in any way. I would start and maintain a gulp workflow but I really don't have the time, bummer. As for @kevinburke I know they don't owe me anything, and I never wanted imply such a thing. And again; I would do it myself if only I had the time to do so.
Ok - when you start off your comment saying "it's 2016", that's a pretty strong implication you think they're "behind" and you expect something different
-kevin
On May 6, 2016, at 00:09, jordyvandomselaar [email protected] wrote:
You're right @Karnith, I didn't mean any wrong. I didn't see anyone talking so I decided to ask about it as I might have missed them adding support for it in any way. I would start and maintain a gulp workflow but I really don't have the time, bummer. As for @kevinburke I know they don't owe me anything, and I never wanted imply such a thing. And again; I would do it myself if only I had the time to do so.
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
@jordyvandomselaar have you tried separating your browser-side code from your server side code? I've worked on a few projects where all the browser side code lives in a completely separate repository; the sails application is strictly used for json/rest api and serves _no_ html.
Taking that approach would free you up to use whatever build system you want. It also frees up your platform to release browser-side code and server-side code independently. It works best with single page applications but even with traditional server-side-view-rendered browser applications, the deployment could take compiled browser side code and put it on the server - or better yet push it to a cdn.
I'd actually prefer it if sails came _without_ grunt, gulp, a view engine, or anything along those lines. I like my backend code stripped down to routing, orm models and business logic services only.
edit: not that I expect sails to get rid of grunt, and I do appreciate the ability to disable the hook
@dadleyy, to be completely honest I thought grunt was doing some back-end stuff aswell. Especially with node I like to separate front & back as it makes some things a bit easier; building an app only needs a front-end rather than having to build another back-end. @kevinburkeshyp It's true that I think using grunt is a little behind, but my opinion should not matter as much. I personally think gulp is better than grunt but you're free to feel different about this. I started my post by saying "it's 2016 now" because I didn't know if they were working on it and I hoped that if they were that it'd be done in 2016.
why is sails.js staying with grunt still, and isn't connect dependency removed in express4? and what about typescript support?
without these I don't feel sails.js appealing at all these days.
I think now the topic should be something like move to webpack insead of grunt since webpack is much more capable
I have a yoeman angular fullstack project. I am currently using grunt, now i want to move to gulp. Can anybody help, what is the process to do so..
So what is Sails going to have by default in the upcoming 1.0 version? It seems like everyone is using webpack these days. I use webpack together with the Sails grunt tasks, but feel like I will be disabling the latter soon.