|
Quick question for y'all. its been about a year since I looked into this. is Sails.js / Waterline still the best way to interact with an SQL database in the node.js world? Or is there anything new I should know about?
|
# ¿ Sep 5, 2015 00:42 |
|
|
# ¿ Apr 29, 2024 15:47 |
|
piratepilates posted:Well I just read this article about Sails.js, helpfully titled "Don’t Use Sails (or Waterline)" Yeah, I just saw that too, and its finally the tipping point for me where I just gave up on node.js completely and go back to Django, or maybe Flask or Mojolicious, I haven't 100% decided yet. But absolutely that blogpost was the moment that I just said "gently caress it, I'm out, I can't deal with this node.js poo poo anymore." I'd rather spend a couple weeks rewriting my entire project then waste one more day fighting with a broken library. Maybe Sequelize is good now (I remember looking at that one specifically a few years ago and it being inadequate, although that was probably an early version because this looks OK), but the trend is pointing to probably not. I'm so sick of every loving javascript library being terrible!!! ARRGHH! Time after time after time, every new thing I look at has some flashy splash page but lovely, outdated, and inconsistent documentation. Every framework has ten trillion pointless preprocessors being stapled to it that otherwise reinvent the same drat wheel. If you need layers upon layers upon layers of build tools for your server-side javascript, then what the gently caress is the point of using javascript on the server side to begin with? Isn't the whole point that both client/server are in the same language, a language that everyone in the entire drat world happens to know and have access to - a language that any ten year old can start playing around with by pressing ctrl-shift-j in their browser? That's why I got into node.js to begin with! And why is there so many broken rear end libraries/tools in the javascript ecosystem that do the exact same thing and NONE of them work right? It is a pandemic in the Javascript world that completely unlike any other language community I've seen. Even Perl's CPAN, which has shitloads of silly (e.g. the entire Acme:: namespace) and half-baked modules is nowhere near as bad as Javascript's situation because the vast majority of modules there are well-documented, automatically tested, reviewed... and centralized so you can see everything relevant at once. In contrast, new alternatives for the most minor goddamn poo poo are all over the web, especially client libraries. I find that raw jQuery is consistently the only thing I feel I can put my faith in. When I try searching for a new javascript library, I've realized that my initial expectation of *anything* I find is that it will not work or be what I need until proven otherwise. The general trend is to try to make easy poo poo even easier (why? why so much effort on something people can already do just fine?) while very few care about trying to make hard poo poo possible. Sails/Waterline was the one framework I'd seen that even seemed like it was trying to move in the right direction, and then that turns out to be riddled with mind-bogglingly inane poo poo like this? "mystery 50ms sleep calls in put/post requests" "The .count function used to work by pulling the entire table into memory and checking the length of the resulting array." "table joins randomly deleting tables" "i don't even know what to say about this" I just need code that's supposed to work to just actually work, goddammit! German Joey fucked around with this message at 11:24 on Sep 8, 2015 |
# ¿ Sep 8, 2015 11:02 |
|
Wheany posted:
Last night I started reading some Flask documentation/tutorials, and I was like, "Wow, goddamn, this is really great." But then I went to look at Django again, (I'd used it heavily 3-4 years ago), specifically a websockets library called Swampdragon, and it was really well documented too! Full API documentation, multiple full walkthroughs/examples for setting up a new app (and they actually worked). Amazing! And then I read some article comparing Flask/Django/Pyramid and one minor negative it brought up against both Flask and Django was that their documentation was "ok, but not the best." ... I had forgotten that this is what the rest of the dev world actually expects as a bare minimum.
|
# ¿ Sep 8, 2015 11:20 |
|
Odette posted:Is node.js really that bad? I feel like node.js in isolation is cool and very suitable to be the core of some types of webapps, like the one i've been working on. However, the problem is that you're never going to be "just" using node.js itself, as, surprisingly, its much more "close to the metal" than you'd expect. Your app is thus node.js + something, and in fact more like node.js + express + something + something + something + something + something + etc; not even counting your database or frontend stuff. Essentially, you'll absolutely need some sort of framework to help you manage the complexity of a large application, and all that other stuff... that's where you start the downward spiral into a world of poo poo. Worlds of poo poo inside worlds of poo poo inside worlds of poo poo... turds all the way down, each more solid than the last... and finally, at the core, you'll find the node.js server engine itself. Perhaps it truly is made of solid gold..? But how long will you need to boil it in bleach to remove that smell..? German Joey fucked around with this message at 01:52 on Sep 9, 2015 |
# ¿ Sep 9, 2015 01:47 |
|
Speaking of lovely network performance, is there any easy way to test websocket poo poo on the client side when my websocket server is still running on the localhost? I want to make sure that all my socket handlers still gracefully reconnect and resync when the websocket connection is temporarily lost without actually killing the websocket server. Is there something like a pass-through proxy I can set up to do this?
|
# ¿ Sep 21, 2015 12:06 |
|
Biowarfare posted:https://jagt.github.io/clumsy/ maybe? ...scared?
|
# ¿ Sep 22, 2015 06:06 |
|
Noam Chomsky posted:Just use the right tool for the right job and don't be a moron. Right, hence, don't use javascript if you can help it.
|
# ¿ Sep 23, 2015 00:54 |
|
MALE SHOEGAZE posted:Javascript has first class functions and is therefore more like its one saving grace. but better than what? C++? PHP? we're dredging pretty bottom of the barrel here! if only it had a real scope implementation and an object model that didn't both require extreme abuse of these aforementioned first class functions, then it might actually be enjoyable to code in this horrible loving language! but probably not! THE WEB! GOTTA LOVE IT!!!!!!!!!!
|
# ¿ Sep 23, 2015 13:08 |
|
Subjunctive posted:You want something other than lexical scope? Dynamic scope would be much worse, I think, so I'm curious as to what you have in mind. You know that only functions can create a new scope in javascript, right? That's why we have to wrap everything in this "(function() { ... code ... })();" bullshit.
|
# ¿ Sep 23, 2015 22:21 |
|
Maluco Marinero posted:You know he's written a considerable amount of JavaScript implementations? Is it too much to ask that people argue from an assumption of good faith and domain experience, given were all in the JS thread. This isn't yospos. I did not know that and in fact I find it surprising. How can he write javascript implementations and not know what's hosed up about javascript scope or its object model? If someone says something like that I have to assume it's either out of ignorance or not an argument in good faith. Javascript is just way way way too hosed up not to recognize it at all. Here's an interesting example. I took a look at the most popular javascript projects of today page on github, and then looked at how they built their classes. Like, this is a pretty basic thing for a language, right? If I were to go look at a random python, or java, or whatever library, I might not know how the gently caress its structured or how it works exactly, but when I go take a look at the class definitions I will see a "class Name" on one line, then maybe some members, and then a bunch of methods. There's gonna some imports at the top of the file, maybe some singletons or whatever, but they're all gonna look pretty much like that. With something like Perl, which is much looser, we'd see a bunch using Moo and a bunch using old-school perloo style. But, one or the other. C++? Probably something like this. Ugly, but standardish. What about javascript? gently caress NO. Let's take a look at our random sample; the point isn't which of these projects are good or bad, or which of their object models are good or bad, but that they're all completely loving different and custom-rolled object models. And, for the record, I ignored stuff that looked like it was a core engine component (as that type of thing would be mucking with internals more) or stuff that looked like it wasn't a mainly javascript project, or stuff that had a function-based interface. Just tried to find what looked like a regular component of a project implementing some its functionality. https://github.com/trending?l=javascript
Again: they're all different.. And what's really hilarious is that none of these use the "standard' javascript object models, of either a.) basic prototype inheritance, b.) the yahoo module pattern, c.) the jquery boilerplate pattern. (e.g. something like this) or d.) boilerplate OO from javascript boilerplate. And this isn't even counting poo poo like Typescript or Coffeescript, which have their own internal javascript module/class/object patterns. By the way, why are javascript-preprocessors even a thing if the language is ok? Other than C++, what other language even has language preprocessors in widespread use whose purpose it is to fix the language?
|
# ¿ Sep 24, 2015 00:06 |
|
Subjunctive posted:You know about let, and catch blocks? This is the language though. Saying "Modern JS provides lexical scope, class sugar, and a robust meta-object protocol" doesn't mean poo poo if a.) lexical scope only happens with functions, b.) nobody actually uses the class sugar or the "robust" meta-object protocol. What people actually do in the language matters more than what they theoretically could do. If seasoned professionals are using all of this other bullshit instead of javascript's built in "robust" object model than that means javascript's built in """"robust""" object model is even more bullshit. What I want (LOL) is to write AND READ code that's not indented by 4 sets of tabs to start with and/or wrapped in weird custom object engines.... like I can do in pretty much every other language. And yeah I ain't shouldn't even try to defend C++, that's the one language I consider worse than Javascript. Forget that part.
|
# ¿ Sep 24, 2015 01:05 |
|
Subjunctive posted:Perhaps let me try this again: Dude, I have also been working javascript for 20 years and I just showed you explicitly what is wrong with it. I'm not talking about "let" or any other ES6 poo poo, because I can't write code in ES6 yet. We're talking about current Javascript, not future Javascript that I won't be able to use until 2020. Maybe then, I will be happy, I don't know. But, I loving posted code samples from some of the most popular of today and showed you that general examples of professional-quality javascript code is both a labyrinthine mess and highly dissimilar, and thus errors I get during the usual course of development while using this code are also a.) labyrinthine messes and b.) highly dissimilar. And, you know, I'm just talking about errors in my own code, trying to figure out why some when I call some method, an anonymous function 10-nested calls deep in the library is thinking something is undefined, and not problems in the library itself, although anecdoteally I feel like I find errors in javascript libraries far more often than I do in comparable python ones. Diving into the guts of these libraries over and over to figure out the solution is an insanely frustrating experience because a.) they're all labyrinthine messes and b.) highly dissimilar. It wastes so much loving time! Regarding scope. Tell me. What happens here: code:
If I seem particularly pissed about this, its because its been my every-day experience lately. I've been dealing with it for the last couple of weeks now, shifting back to the frontend after spending a blissful week rewriting a node.js application in django.
|
# ¿ Sep 24, 2015 01:32 |
|
Subjunctive posted:The goalposts have moved here. YOU are the one moving the goalposts by talking about ES6, not Javascript as its, I don't know, "currently lived" or whatever. Current practices.
|
# ¿ Sep 24, 2015 01:37 |
|
Great, another preprocessor! Of course, if I need to use a compiler on the backend, what's the point of writing the backend in javascript again? Isn't the idea of "javascript on backend and frontend" to have your entire application be in the same language?
|
# ¿ Sep 24, 2015 02:46 |
|
Noam Chomsky posted:Is MongoDB pretty much a bad choice for ~99% of applications? yes.
|
# ¿ Oct 15, 2015 00:55 |
|
Speaking of, and I'm kinda laughing at myself for even thinking about this, but is there any way to sandbox Javascript in the browser? Like, lets say I have some widget that has a bunch of methods attached to it, and I want to allow user-written scripts that can interact with this widget. As in, User A writes a script on the site, and User B loads the script and runs it.... WITHOUT needing to worry about his computer blowing up or known terrorists now knowing his credit card number and his mother's maiden name. Just from the top of my head, I'd want to ban DOM manipulations except via the widget's method calls, or modifying the widget itself, or the use the eval function, or access to cookies, or to load any external objects, or who knows what else. Is this possible natively?
|
# ¿ Nov 5, 2015 11:35 |
|
Subjunctive posted:Sandboxing is what caja does, it works well. oh, this looks perfect! Looks like it works how I envision something like this should work... edit: except for all of their demos being broken...
|
# ¿ Nov 5, 2015 22:31 |
|
Skandranon posted:You could maybe try something like a WebWorker. It will run a separate .js file in a separate thread, and has no access to the DOM or a lot of other things, but can communicate with the main thread (and thus, the DOM) via postMessage. that's not a bad idea. I googled a bit along these lines and found this: https://github.com/asvd/jailed Which seems like I could do something with. I think what I'd want to do is instantiate the user code inside a wrapper, which would provide with an API that shadowed that of my widget. However, rather than operating on the widget directly, the user would actually be invoking the wrapper, which would use postMessage to communicate a command to the wrapper around the widget. Likewise, any events generated by the widget would themselves invoke postMessage to communicate a command to the worker, which would then invoke a cooresponding worker event. This seems a lot simpler than using caja, and I bet it would be a lot faster too... I'm already worried about my app being very resource-intensive on the server side, even without needing to worry about processing crap for every little UI interaction. edit: Oh I see now, this is exactly what jailed does already! I just need to provide a wrapper to jailed's application.remote object to hide that interface from the user. German Joey fucked around with this message at 23:25 on Nov 5, 2015 |
# ¿ Nov 5, 2015 22:39 |
|
What the hell are you doing that needs multiple GB of RAM, and why are you doing it in javascript?
|
# ¿ Nov 15, 2015 11:38 |
|
peepsalot posted:CSG CAD stuff, for fun fairly cool! edit: sites like this always make me feel warm and glowing about how amazing the potential of the web is, but then when I start developing in Javascript again it doesn't take long for me to degenerate back into a frothing, furious mess. German Joey fucked around with this message at 21:33 on Nov 15, 2015 |
# ¿ Nov 15, 2015 21:30 |
|
|
# ¿ Apr 29, 2024 15:47 |
|
Can anyone help me with Javascript build tools? I've developed a plugin for another library (leaflet.js) that I'd like to release on github, but the source code ended up being a lot longer than I originally predicted (~1200 lines now) so I'd like to split it up into multiple files. I don't need 'require' or anything of the sort, and my code is all plain, vanilla Javascript. I basically just want some standard build tool that will take my files and concat them together, and then minify the resulting file. What's the easiest way to do this with bower, or jake, or webpack, or rollup, or whatever the heck is the latest fashion these days?
|
# ¿ Sep 6, 2017 02:06 |