15 ms·
Sails.js – Real-time MVC Framework for Node.js
- lmm 13y agoI know nothing about the framework (and I don't see any examples or anything that tells me why it's any good), but that is a beautiful landing page.
- camus 13y agoEspecially with Javascript off ... it's white ,empty and beautifull , I learned nothing about what the framework was about.
- sergiotapia 13y agoThen turn it on. Why are you browsing the web with JS off in 2013? Do you want web developers to make _two_ sites, one for the 99% using JS and another for the Stallman's out there using lynx for browsing? /rant
- awavering 13y agoNo, he wants it to work without JS, like any site should. Developers should build one site, and use JS for progressive enhancement.
- randallsquared 13y agoWhile this used to be the common wisdom, it's not clear to me that it should still be. Designing a site which smoothly gains features as your browser does seems ideal, but often takes half again as long. Doing that for the tiny percentage of people who browse with JS off seems perverse when most of the modern web is broken or invisible to them anyway.
- reustle 13y agoThe most common reason discussed was screen readers, which can now parse JS powered sites just fine.
- bphogan 13y ago"just fine" is not even close to true. Developers have to code it right or it doesn't work right. JavaScript-based sites are as accessible as Flash-based sites - the developer has to know how to make it accessible, or it isn't.
- jonknee 13y ago> JavaScript-based sites are as accessible as Flash-based sites - the developer has to know how to make it accessible, or it isn't. How is that the case? The text is on the screen like any other website would be. It's not an image or in a binary format like it would be with Flash.
- bphogan 13y agoScreen readers can read text in Flash movies if it's bade available as text. and with JavaScript, if it's injected after page load, rather than during, the screen reader may not get notified that the page has changed, so it doesn't know to read it. This is what WAI-ARIA and other things are about. Thankfully JAWS and WindowEyes have free trials, and NVDA is free, so we can actually test things instead of talking about them on HN.
- matthewmacleod 13y agoIt really doesn't take that long. Sure, a modern web application, or a site with lots of interactivity, is never going to work without JS. But this is some static content on a page; it would not be hard to make this work without it. Although the time would probably be better spent optimising the page somewhat. 3MB of assets and 85 HTTP requests (including 24 individual stylesheets!) makes for an unpleasant experience.
- ulisesrmzroche 13y agoNot for the kind of applications that this framework is designed to build, so that statement is bound to attract a lot of crows.
- Diamons 13y agoWelcome to 2013, where people want to hold us back with their 90's browsing habits.
- dreen 13y agoJS blocking does not mean "BAN ALL JAVASCRIPT GRRRR" it means "I will decide which sites can run code on my computer". So if you have a web app - a page that needs to run code to provide its value - you have to let it do that. But if you have a document that is strictly informative then REQUIRING that you run some code just to read some text is simply counter-intuitive. A document shouldn't need to run code to provide its value, NOR SHOULD IT DO SO TO LOOK NICE.
- mistercow 13y agoThis is a strange definition of "should". If 2% of your users are browsing with JS turned off, "should" you really spend valuable time maintaining the no-JS path at the expense of working on how the site works for the other 98%?
- bphogan 13y agoYou should never have to develop two paths. Web development boils down to forms that post and links that get. It's not difficult to make all that work and then apply JS on top to intercept things. But it's getting harder to do that as we embrace frameworks we don't understand that do it all for us.
- mistercow 13y agoWhen you put JS on top of it to intercept, you are creating two paths. That may be easier than a totally separate code base, or maybe not (I have seen compelling arguments either way), but it still boils down to a different code path in terms of potential for different bugs, different cross-browser issues, and more testing. In addition, developing that way (instead of with JS in mind) also has a cost which in the end means that you are sacrificing resources developing for those 2% instead of the other 98%. Regardless of whether that approach leads to an easier situation in terms of maintaining JS vs. non-JS, it certainly does not lead to an easier situation than ignoring non-JS altogether.
- jongold 13y agoIt's a site for a JavaScript framework — that's like saying Dribbble should work with images disabled.
- WayneDB 13y agoDribble does work with images disabled though, as well it should.
- jonknee 13y agoWhy should any site work without JS? Especially the site for a front-end JS framework. Are you similarly angry when a photo gallery doesn't work without images turned on? Or when a video site doesn't work when you disallow video from playing?
- bphogan 13y agoThose images better have alternative descriptions, and that video better have a transcript.
- mistercow 13y agoSo you would rather a video weren't posted at all than that it be posted without a transcript?
- WayneDB 13y agoA blind person might. A government agency would rather not post a video to it's own site without a transcript (Section 508). Many people would. For me it depends on the video. I often would rather read the transcript than watch. So yeah, it'd be better for me that the video wasn't even posted so I wouldn't have to waste my time searching for a transcript that didn't exist.
- bphogan 13y agoYes, honestly, because lots of times I just don't have headphones and don't want to disturb folks around me. But other times I can read faster than I can watch the video. If you made the video with care, then you probably already have a script you used. If you didn't, https://castingwords.com/ https://castingwords.com/ is really, really cheap and does a good job.
- camus 13y agothanks awavering ,it's hard to be surrounded by Javascript fanatics when the point is just to be able to read a doc about a framework. A txt file should be sufficient but no, today developers want to get fancy and throw at you every stunt they can pull ...
- bacongobbler 13y agoYou can always read the README on GitHub. no markup there. https://raw.github.com/balderdashy/sails/master/README.md https://raw.github.com/balderdashy/sails/master/README.md
- kayoone 13y agothere is a reason why the option to turn JS off has been removed from Firefox 23. Javascript is a big part of todays web. Better spend your time working on your JS powered App rather than to make it work for 1% who have turned it off.
- kbojody 13y agoIt does look amazing, and maybe its just my PC but on Windows 7, the bullet text below is almost impossible to read. Could also be my display. It looks fine on my Nexus 4, and is ok on Ubuntu. Maybe my font aliasing is just messed up. Thin fonts have never really looked great on windows for me.
- jongold 13y agoHave you got Cleartype disabled?
- xutopia 13y agoIt doesn't have associations between models yet but it does have amazing branding.
- 1qaz2wsx3edc 13y agoI don't think you're forced to use their model layer.
- lucisferre 13y agoTechnically you're not forced to use Sails.js at all. I'm not sure that's the point though.
- particlebanana 13y agoI just recently split out the ORM, Waterline into a new project. The first step was to get API compatibility with the current ORM and a bit of sugar like lifecycle callbacks and custom instance methods. Associations are next on the list of to-dos. It's still a very new ORM but I'm working on making it better. Check it out I'd love feedback or better yet pull requests. https://github.com/balderdashy/waterline https://github.com/balderdashy/waterline
- altcognito 13y agoThe back button is broken and it doesn't appear to support HTML5 history by default in browsers that support it. (uses hash for tracking pathing)
- nicksergeant 13y agoThat's really more of a concern for your front-end framework than your back-end framework, though.
- anondesign 13y agoIt looks pretty well thought-out, which is a big +1 when I'm framework shopping. However: use pushState/replaceState! Or at least fix your buggy back button. Your hash-based navigation totally breaks the back button to a point where I can't believe you shipped this.
- anondesign 13y agoAlso: don't forget to use manifest files to concatenate your compiled CSS :)
- mistercow 13y agoOr you could just use LESS and @import your styles. LESS @import for other LESS files works much like C's #include, rather than simply converting to a CSS @import line.
- anondesign 13y agoHe's using rails, so he can use SASS (which personally I like better than LESS, but they accomplish the same things). Manifest files are better though, because with LESS's @import, you might import more files than you actually want. I believe you also have the recursive import issue, just like C. Manifest files give you more granularity by existing outside of the actual stylesheet.
- mikermcneil 13y agoThanks for the bug report! In particular, what back button issues were you having? I can't replicate any issues just now, but feel free to submit a PR if you see a fix. Shipping a customer site is way different than "shipping" the website for an open-source framework. Unfortunately, we don't get paid to work on Sails, and we're completely bootstrapped, so we only get to work on stuff like the public-facing website when we get spare time.
- nahname 13y agoGET requests to create users. What could go wrong?
- kennethkl 13y agoHow did you manage that? o.0 Re-wiring the routes?
- city41 13y agoI believe he's refering to this # Create a new user http://localhost:1337/user/create?name=Fisslewick (or send an HTTP POST to http://localhost:1337/user) From: http://balderdashy.github.io/sails/ http://balderdashy.github.io/sails/
- brodo 13y agoYea, it's no real REST. Better then Metors 'server methods' though.
- particlebanana 13y agoThis is in development mode for quick prototyping. You can turn it off in production and only use POST requests.
- spullara 13y agoThis word real-time. I do not think it means what you think it means.
- notb 13y agoBut.. Socket.io is built in sooo realtime ... Right?
- geuis 13y agoYes, it is. We are mostly professionals here and understand the limitations of technology, specifically when talking about latency and implementations ranging from websockets to long polling. We look past these minutiae and get to the real subject of getting data to the user as soon as possible. Generically, this is referred to as "real time".
- lucisferre 13y agoI actually wish we called this something else like say "persistent". Real-time systems have a very specific meaning for many people and while yes we all get it, it is probably a point of distraction for a lot of people to hear this term constantly misused.
- xoail 13y agoSo how is it different from Express.js?
- ulisesrmzroche 13y agoexpressjs is a more minimalist framework, taking a lot more inspiration from sinatra than rails. This wants to be rails for javascript. edit: Actually, just checked the package.json, and express is listed as a dependency, (probably for the controller middleware?) so in essence you're using both.
- dylanhassinger 13y agoSails is based on top of Express. Like if Rails had Sinatra at the core
- cpursley 13y agoA better analogy is the way Padrino has Sinatra at the core.
- c0mpute 13y agoExpress isn't really much of a client side MVC framework. It is still a very clean and simple framework. If you want to drink the cool aid of single page apps, 'rich' client side etc, you have to invest into some MVVC/MVC frameworks like Angular, Ember or now Sails, which works well with Node.js apparently.
- kayoone 13y agoimo Sails is a backend framework to be used with Node, while you can use Ember/Angular/whatever on the frontend side.
- c0mpute 13y agoYou are right. Having not gone through what Sails was, I have mis-represented it a bit. Its more RoR than Sinatra (Express) as others have expressed here.
- chevreuil 13y agoI'm not too versed in Node frameworks : is Sails a direct competitor to Meteor ? If so how is it different ?
- notb 13y agoProbably could be considered a competitor. This offers socket.io built-in, but doesn't seem to have the reactive data binding templates like meteor. This looks to be a Ruby on Rails for node.
- progx 13y agoI did not see the difference, only that Sails has a smaller scope. With Meteor you can change all frontend-data of connected clients "in realtime", but Sails did not have this key feature. So iam not sure why i should use Sails, when i can have more with meteor?
- KaoruAoiShiho 13y agoBecause Meteor front-end bindings suck terribly. With sails you can use any of the tried and true front end frameworks like angularjs or emberjs etc instead of meteor's crap. Disclaimer I haven't used Sails so this is not an endorsement for sails, just a reflection of my experience with meteor.
- brodo 13y agoWarning, this is a rant. I've started a Meteor.js Project 3 Weeks ago and I'm regretting it. It's an architectural nightmare. It uses global variables for everything. One would think the news, that this is a bad idea, would have spread since the 70's. Unit tests are not possible in this style. You can do integration tests with the Laika Framwork though. The next problem is a severe case of "note invented here" syndrome. Packaging, data access, Templating - Meteor.js has it's own. For example, they have their own version of Handlebars which I did not realize until yesterday. It has some documented and some undocumented differences to the original one. I had lots of fun with some custom Handlebar helpers that I wrote. I tested them against the original Handlebars and they passed all my unit tests. In the project however they did not work at all. As KaoruAoiShiho said the bindings suck terribly. Well, they don't exist really, you just use jQuery. (Thank god, they don't roll their own version of that.) The elephant in the room is data access. If you're a MongoDB fan like I am they will lure you in with the fact that you can use MongoDB directly form the client. Don't fall for that, it's a terrible idea. It's such a terrible idea, that they introduced 'server methods' to kind of fix all the problems with it. Server methods are not REST. Server methods are RPC style web APIs. Welcome to 10 years ago. They dislike REST because it's stateless. (at least that's what i've taken form this talk: http://www.youtube.com/watch?v=NnMqMAYmTuo http://www.youtube.com/watch?v=NnMqMAYmTuo) As you might have realized by now these guys just LOVE state. State and global variables. If you're a Haskell programmer and you are not jet curled together into a ball and crying, id's suggest to quickly read a monad tutorial before continuing. Dependency management is also a big problem. You can't just use nodes good old `require` and `module`. The order in which files are loaded is determined by their name and position in the directory structure. I shit you not. They have also their own build tool. (who would have thought...) It watches your files and compiles them. Which works great most of the time. You can't have includes in your SASS/LESS/Stylus files tough. I guess the notion of having a proper module system scares it a little. I found this thing to be the best aspect of my whole Meteor experience. Not as good as Grunt though. Per default, there is no routing. There is an unofficial routing package which works good, but is by far not as feature rich as the Express one. It also introduces some more global variables in true Meteor.js spirit. In my opinion Meteor is good for prototyping. You can get a small app up in no time. Just don't build anything real with it.
- mgkimsal 13y agoNot sails-specific, but sudo npm -g install sails Why do so many projects require sudo? Why are we writing to any area which would require root write privileges? Why do we not default to just writing stuff in to user home directories and patching off that? Possibly naive question, but one which is increasingly bugging me.
- deleted 13y ago[deleted]
- mistercow 13y agoMy understanding is that npm defaults to putting its install directory somewhere that requires root access. So you see this with the -g option since that puts it in the root npm directory.
- dspillett 13y agoThe -g option in NPM means "install globally" (i.e. system wide) instead of in this projects modules directory. You will always need root privs for that, for any module. Without the -g option sudo is usually not required.
- mAritz 13y agoThat depends on how you install your node/npm. For nvm installs the default is ~/.npm which doesn't require root privileges but is user specific.
- jnycs 13y agoSeems like it's just for convenience? It does get inconvenient to not install things globally with npm and having to run: ./node_modules/.bin/<packageNameHere> every time (or to alias every package)
- progx 13y agoI think on github https://github.com/isaacs/npm/issues https://github.com/isaacs/npm/issues is the right place to ask this, or tho add a feature request. "-g" ist for global installations and you want a "-l" for user local installation.
- jongold 13y agoGreat stuff. Whilst getting in to Node from Rails (& Meteor) I've found the lack of backend, structured MVC frustrating. Apparently it's not 'Nodey' to make a big framework like Rails, but I'd rather figure that out myself in due course rather than using Express and having no idea what to do after the trivial stuff you see in tutorials…
- nilkn 13y agoCorrect me if I'm wrong, but isn't Meteor built on top of Node? Though I suppose it does, as far as I remember, completely hide the Node container. (Or did I misparse your sentence?)
- jongold 13y agoYup, but it's super abstracted — I run the London Meteor meetup but still have no idea how Fibers work :) I've now written a couple of production apps with Meteor but it always feels like I'm writing frontend JS with a magical backend (and a couple of server methods) ala Parse, rather than building apps with Node.
- mclenithan 13y agoI have had the chance to play with Sails and I really like it. Just a warning, this is a great tool for simple web apps. I wouldn't take the Sails path if you are going to do something a little more tailored, (like Nodejs + PostgreSQL w/ Sequelize + Redis for sessions + memcached + MongoDB for analytics + passport w/ Oauth2 + etc.. ), I would leave that to express + express-routes. I would definitely chose Sails for demo'ing a product idea or personal projects I want to get up and over with as quickly as possible, and Sails is REALLY quick. I can't wait to see how Sails evolves, they are some damn good dev's.
- throwit1979 13y agoI don't think "real time" means what you think it means.
- heldrida 13y agoHi! I've tried a couple of days ago and after running the getting started, noticed that none of the tutorials in the right column were available. Did this changed ?
- criswell 13y agoI keep reading it as "snails". It looks like fun, though. I look forward to playing with it.
- lucisferre 13y agoHow does sails handle assets, do you have something similar to sprockets that can be added to this?
- particlebanana 13y agoIn the upcoming v0.9.0 release we are using Grunt for assets.
- deleted 13y ago[deleted]
- pg_bot 13y agoHmm seems to be broken currently on OSX. (Not sure if sails or node is the problem) Following the steps on getting started guide. brew install node sudo npm -g install sails sails new testProject command not found: sails Also from a UX standpoint I would point the user to another page where they can continue learning about the framework after the download is finished. Right now it states "Now, let's get Sails to do cool stuff." and leaves the user hanging with nowhere to navigate to.
- brodo 13y agoNpm should be used without sudo, like homebrew. I guess thats the problem. They should change that.
- zhemao 13y agoProbably because npm is installing the executable to a directory that's not on your PATH. Check to see if /usr/local/bin is in your PATH variable.
- pg_bot 13y ago/usr/local/bin is the first directory in my PATH variable
- VeejayRampay 13y agoThis looks like an awesome project and the overall design is absolutely great, kudos. One thing that amuses me though is how part of bootstrapping the Node user base was built upon a lot of Rails-bashing, only to find out a few years later that most of the frameworks are basically trying to recreate some form of Rails in Javascript. All the best to the authors nonetheless.
- bdcravens 13y agoTotally off-topic and maybe even trollish, but I noticed the cute little illustration here: http://sailsjs.org/#getStarted http://sailsjs.org/#getStarted Interesting that the female is skinny, with a trendy little mid-riff baring shirt, and attractive (so far as a stylized comic character can be). One of the male characters is a pudgy dude with glasses. It seems the norm in characterizing girls in tech is "you can be a developer, but stay sexy - you don't have to be a nerd!" Does this risk marginalizing normal women?
- mikermcneil 13y agoOne of the two designers who worked on it is a woman-- feel free to ask her: https://twitter.com/KallunaLovegood https://twitter.com/KallunaLovegood
- marknutter 13y agoegg, meet face
- bdcravens 13y agoWhether or not a woman did the design isn't the point. This particular design wasn't even the point. I was questioning what seems to be a trend.
- WayneDB 13y agoThe person you're responding to didn't say that a woman designer was the point. They said you can feel free to ask her your question. I wish you would too, because I can't stand coming into a thread about some cool new technology and having it turn into a melodramatic women's study.
- rayhano 13y agoIf women weren't brainwashed to (generally) serve men, strive to be skinny, pretty and dutiful, they'd soon realise women don't need the male half of the species to survive. SO, let's leave the stereotypes be, or risk the evolutionary extinction of males...
- mikermcneil 13y agoHey if anyone's curious about what this is, here's my video: https://www.youtube.com/watch?v=GK-tFvpIR7c&feature=youtu.be https://www.youtube.com/watch?v=GK-tFvpIR7c&feature=youtu.be
- Zolmeister0 13y agoThis Sails.js tutorial is really good: http://net.tutsplus.com/tutorials/javascript-ajax/working-with-data-in-sails-js/ http://net.tutsplus.com/tutorials/javascript-ajax/working-wi...
- hhandoko 13y agoOff topic, but the choice of port for a Sails app is quite interesting, "1337" [1]. [1] http://sailsjs.org/#getStarted http://sailsjs.org/#getStarted