**** BEGIN LOGGING AT Sat Apr 27 02:59:58 2013 Apr 27 19:06:36 hey, Roy__, you there? Apr 27 19:07:39 Roy__ is omnipresent. Apr 27 19:07:51 lol HaDAk Apr 27 19:08:04 as most gods are. Apr 27 19:08:06 HaDAk, how much JS do you know? Apr 27 19:08:32 alert("this much"); Apr 27 19:08:47 lol Apr 27 19:09:11 it's really starting to piss me off too. Apr 27 19:09:18 i wish i was a javascript ninja Apr 27 19:09:47 i can do neat networking things though Apr 27 19:09:48 www.hadak.org/2013/04/27/using-ssh-to-bring-local-ports-home/ Apr 27 19:11:48 he Apr 27 19:11:50 *heh Apr 27 19:12:16 I need someone who knows JS for my current problem tho Apr 27 19:12:45 i literally have a javascript for dummies book from 2001 next to me. need me to look something up? Apr 27 19:13:13 nah, if it was that easy, MDN would have already given me my answer :\ Apr 27 19:13:32 I'm gonna highlight some people and see if they respond: sugardave1, summatusmentis, madnificent, Trex005, grayb0x Apr 27 19:13:51 Basically, what I'm trying to do Apr 27 19:14:04 is I have an array of components Apr 27 19:14:41 I want a new array that has the results of the getValue() function for each of those components Apr 27 19:15:10 and I refuse to use loops, because this looks almost exactly like the problem that Array.prototype.map and enyo.map are supposed to solve Apr 27 19:15:25 well, programatically, you'd want to do something like for x in $array_items; do function(x); done Apr 27 19:15:38 I just don't know how to pass the value it gets to as this for it Apr 27 19:16:39 can't help you there Apr 27 19:16:48 unless you're trying to do alert(""); Apr 27 19:16:54 in which case BAM. problem solved. Apr 27 19:17:02 lol Apr 27 19:17:18 you're welcome :D Apr 27 19:19:00 i think it's lunchtime. Apr 27 19:21:49 GodGinrai: I looped through the components block to do that Apr 27 19:22:03 if you figure out a better way, tha'll simplify my code a lot Apr 27 19:22:41 well, I do know a better way than looping throught the components block, however I'm looking for a simpler way than that Apr 27 19:22:54 the simpler way I know is this: Apr 27 19:23:22 grabValue: function(inComponent) { Apr 27 19:23:30 return inComponent.getValue(); Apr 27 19:23:35 } Apr 27 19:23:40 and then this: Apr 27 19:23:55 enyo.map(componentArray, this.grabValue, this); Apr 27 19:24:33 Does that help simplify your code, summatusmentis? Apr 27 19:26:20 What I'm looking for is how I can pass some value as the third argument to enyo.map that will let it know to use the value it would pass to the function as the context rather than the parameter for the function Apr 27 19:26:47 or if there is an enyo function similar to enyo.map made to do that Apr 27 19:43:30 well, enyo.bind() adjusts context Apr 27 19:44:18 you still need to loop to call grabValue() though right? Apr 27 19:45:26 enyo.map calls the function for every element in the array, by using Array.prototype.map Apr 27 19:46:18 and enyo.bind can adjust context, but I have no value to give it for the value it is going to get from the array, so I have to use the function instead Apr 27 20:00:26 couldn't you use an anonymous function, and bind inside enyo.map()? Apr 27 20:00:46 something like enyo.map(componentArray, enyo.bind(this, function() {}), this); Apr 27 20:02:19 No, I can't Apr 27 20:02:27 that just binds to the object you're calling in Apr 27 20:02:31 not to the value from the array Apr 27 20:03:03 the third parameter in enyo.map is the context, so what you just put would be like binding twice Apr 27 20:03:10 to the object Apr 27 20:03:31 also, you should try to avoid anonymous functions whenever possible, IMHO. Apr 27 20:03:34 It obfuscates code Apr 27 20:04:12 I see Apr 27 20:04:31 I mean, I don't use anonymous functions regularly, I find them hard to follow, but it's sometimes useful Apr 27 20:04:46 yea Apr 27 20:04:53 but in this case, it wouldn't change anything Apr 27 20:05:28 right Apr 27 20:20:09 GodGinrai: What's up? Apr 27 20:20:47 * HaDAk hears the angelic trumpets hearlding in Roy__ Apr 27 20:21:56 lo Apr 27 20:21:58 *lol Apr 27 20:22:02 Basically Roy Apr 27 20:22:07 I have an array of components Apr 27 20:22:22 and I need to make an array of the values from their getValue functions Apr 27 20:22:31 M'kay. Apr 27 20:22:46 Then you better do that. Apr 27 20:22:58 I wanted to know if there is a way to get enyo.map to use the value from the array as the context rather than the parameter for the function you pass it Apr 27 20:23:32 or if there isn't, then is there an enyo or JS Array function that does allow you to do that? Apr 27 20:24:06 I'm not sure what you're trying to do but why don't you use the map parameter that corresponds to the value and just do value.getVAaue()? Apr 27 20:24:34 s/VAaue/Value/ Apr 27 20:24:56 there's a map parameter that corresponds to the value? Apr 27 20:26:37 ok, so this is what I am doing: enyo.map(componentsArray, this.grabValue, this), which would do this for every element: this.grabValue(inValue) Apr 27 20:27:17 you're telling me I can do: enyo.map(componentsArray, value.getValue) and that will call inValue.getValue() for each element? Apr 27 20:31:37 Um... Apr 27 20:33:15 Here's a visual aid of what I'm trying to do: Apr 27 20:33:16 Start --> [ component, component, component, component ] => [ component.getValue(), component.getValue(), component.getValue(), component.getValue() ] <-- Result Apr 27 20:33:32 enyo.map(componentsArray, function(x) {return x.getValue()}); Apr 27 20:33:50 yea, that's what my grabValue function is doing Apr 27 20:33:53 *untested* Apr 27 20:34:09 Then what's the problem? You want it smaller? Apr 27 20:34:16 basically Apr 27 20:34:39 using the array value as the context for the function seems so basic a need that I thought there would be a better way to do it Apr 27 20:34:49 like a parameter or another function I didn't know about Apr 27 20:37:12 btw, while you're here, I read your book and was wondering about the uses of enyo.Async after you mentioned using it to offload heavy work from the event handlers Apr 27 20:37:32 could you give me some examples? It's hard to find concrete examples for using enyo.Async Apr 27 20:39:40 Hmm... Apr 27 20:39:44 I don't really use it a lot myself. Apr 27 20:39:58 There should be some examples of it in the samples. Apr 27 20:40:43 well, the only async samples they have are ajax samples Apr 27 20:41:02 and that doesn't really explain how to use async as much as it says: "this is how you deal w/ webservices" Apr 27 20:41:27 there's one example in the wiki, and that's all I could find Apr 27 20:41:55 and the example in the wiki doesn't explain how the concept of the "onfail" works for a standard enyo.Async object Apr 27 20:42:29 Since as I understand it, the asynchronous operation that starts the execution of the responses on a base enyo.Async kind can't fail, can it? Apr 27 20:43:18 Maybe? Apr 27 20:43:42 I haven't read the code in a while. Apr 27 20:44:08 there seems to be a way to jump over to the fail handlers as well, w/ a function, but I'm not sure how you're supposed to handle and return to the normal flow Apr 27 20:44:34 I will look at it later. I'm running around doing some housework today. Apr 27 20:44:36 It sounds like enyo.Async could be pretty useful, but since there is little to no documentation on it, it's no wonder no one uses it Apr 27 20:44:38 k Apr 27 20:47:55 If you can come up with something good I can add it to the book. :) Apr 27 20:52:15 Enyo needs a better dependency manager Apr 27 20:52:35 what do you mean? Apr 27 20:52:46 you find enyo.depends lacking? Apr 27 20:53:37 enyo.depends is ok. Apr 27 20:54:43 My problem is mostly with external libs. Apr 27 20:55:01 like other JS libraries? Apr 27 20:55:10 Or other enyo components. Apr 27 20:55:33 what problems are you having? Apr 27 20:55:57 It's not a problem, per se, I just am not a fan of how it works. Apr 27 20:56:43 A while back I had an idea for a better way to manage it based roughly on NPM. You basically have a enyo.json file that lists your dependencies to external libraries (in the lib folder). And then it uses some external registry to download them and put them in your lib folder. And each library that you pull in could have it's own enyo.json file that lists its dependencies so that if something requires layout and you don't include layout in you Apr 27 20:56:43 app yourself, that library will pull it in itself. Apr 27 20:56:48 Basically, think NPM modules. Apr 27 20:57:33 hrm Apr 27 20:57:51 speaking of npm Apr 27 20:58:08 In that same proposal I also thought that CLI tools would be cool. enyo debug to start a local server, enyo install to install libraries, enyo build to compress css/js, etc. Apr 27 20:58:11 I'm actually frustrated that the bootplate stuff relies so much on node Apr 27 20:58:17 GodGinrai: Why? Apr 27 20:58:34 the apps I'm coding run on SPARCS Apr 27 20:58:44 which node isn't ported to Apr 27 20:59:12 Only the build tools rely on node though. Apr 27 20:59:33 yea, but that means that I have to write my own minifier if I want to minify my code Apr 27 20:59:53 Or write your code elsewhere and then minify on deploy. Apr 27 20:59:56 something as simple as a minifier could have been written in perl or something Apr 27 21:00:19 I write my code on the server so I can use relative pathing to my PHP scripts Apr 27 21:00:56 Well I'm sure there's open-source alternatives you could write. Apr 27 21:02:01 I'm just saying, the bootplate is pretty restrictive, especially if you are not using node. I think that may be detrimental for the project Apr 27 21:02:44 I doubt it. Most developers use some node-compatible environment. Apr 27 21:02:53 It sucks for the people that don't. Apr 27 21:02:58 not to mention, you need to get node for it, but then you hop over to the ares project, where they haven't updated to work w/ the latest npm, so you are having to install certain versions of npm to get it Apr 27 21:03:24 Well Ares is a mess right now, but it's not really ready for prime-time. Apr 27 21:04:23 that's true. I'm just saying that what can be implemented w/ more widely supported tools like perl, awk, sed, etc. should probably be implemented in those Apr 27 21:04:34 And writing your own enyo minifier shouldn't be hard. Compress enyo (or download an already-compressed enyo), then pull in every js file that isn't named package.js and that isn't in an examples/samples folder. Apr 27 21:04:45 And there's something to be said about not reinventing the wheel. Apr 27 21:05:51 Sure, writing my own minifier won't be that hard, but I'd only do it because I'm committed to using Enyo Apr 27 21:05:58 if someone who is on the fence looks at Enyo Apr 27 21:06:22 they'll just say: "fuck it, I'll use JQuery/Sencha/MooTools/Prototype" Apr 27 21:06:38 But a vast majority of the JS community is already set on Node. Apr 27 21:07:15 So for a good amount of them, it makes it *easier* to get started. Apr 27 21:07:15 yes, but there are still a large amount of companies using SPARC architecture Apr 27 21:08:04 I'm not sure how a minifier being written in node makes people think: "This is easier" Apr 27 21:08:04 So it sucks for them, but is better for the majority. Apr 27 21:08:17 it doesn't matter what it is written in, as long as you can run it Apr 27 21:08:26 I'm talking about making sure that people can run it Apr 27 21:09:11 But I already have a solid node environment set up. If it wasn't written in node, I would be a little put-off. Especially if I was bouncing between windows/linux. Apr 27 21:09:33 why would you be put off? Apr 27 21:09:48 what does it being written in node bring to the table? Apr 27 21:09:59 if it is a perl script, it runs anywhere just fine Apr 27 21:10:23 Yes but being a javascript developer I already have node setup on windows. I do not, on the other hand, have perl set up. Apr 27 21:10:37 you're telling me you don't have a Cygwin install? Apr 27 21:11:01 Well I do, but I'd venture to guess a solid amount of people do not. Apr 27 21:11:06 then you have perl Apr 27 21:11:17 "I'd venture to guess a solid amount of people do not" Apr 27 21:11:24 anyone who wants to interact w/ a web server should have a Cygwin install Apr 27 21:11:30 it makes SSH easier Apr 27 21:11:36 it allows simple scping Apr 27 21:11:43 Who says I want to interact with a web server? Apr 27 21:12:23 you're talking about Node Apr 27 21:12:27 A lot of web developers I know develop locally and then just dump it via ftp or something similar. Apr 27 21:12:30 and saying you don't interact w/ a web server Apr 27 21:12:37 With Enyo, node is only in the build process. Apr 27 21:12:43 yes Apr 27 21:12:54 but you are saying that people who try enyo Apr 27 21:12:59 already have node Apr 27 21:13:16 (which isn't true btw, but we'll skip that) Apr 27 21:13:33 if they are already as deeply entrenched in node as you postulate Apr 27 21:13:38 I doubt they are not using a web server Apr 27 21:14:21 plus, my point is that exactly because it is only the build process for enyo, it should be written in something that works everywhere Apr 27 21:14:34 it is impossible to install node on a Solaris SPARC box Apr 27 21:14:49 it is, however, possible to install perl on a windows box Apr 27 21:14:54 through any number of means Apr 27 21:15:39 I'm not saying all, I'm saying being a JavaScript framework, it makes sense that developers *could* have node set up. This makes it easier for them. It also is just an added convenience that the minify process is built in the same language as the framework. And hell, I'll take a minify process that works *almost* anywhere in something that I already have installed (being a JS developer) than something that doesn't run a small fraction of devi Apr 27 21:15:40 but that I have to go and install just to minify. Apr 27 21:15:58 I have to go and install node just to minify Apr 27 21:16:00 this way Apr 27 21:16:04 you're making no sense Apr 27 21:16:23 I'm not even saying that the build process has to be written in perl, I am simply using perl as an example of something that runs everywhere, btw Apr 27 21:16:26 But I'm saying that being a JS framework, that there's a solid chance people already have it installed. Apr 27 21:16:57 Not in enterprise there isn't Apr 27 21:17:06 where everyone is still entrenched in their Java ways Apr 27 21:17:07 Well then maybe Enyo isn't the best for enterprise. Apr 27 21:17:33 And when it comes down to it, that's the decision they made it in node, they're not going to change it moving forward. If anything, it's probably moving more toward node. So it doesn't really matter what you think it should have been written in. Apr 27 21:17:35 That's a horrible attitude to have Apr 27 21:17:45 Enyo needs to be open to as many people as possible Apr 27 21:17:57 for it to be successful Apr 27 21:18:26 retricting people to node is shutting the door on potential developers for no reason whatsoever Apr 27 21:18:52 I'm not saying node is bad, but for something as simple as a build process, there are other, better, options Apr 27 21:20:48 every language community eventually reinvents make, badly Apr 27 21:21:25 It may be a horrible attitude to have, but if you really think that it should have been written in another language, then maybe it's not best for your enterprise. It's not shutting the doors on anybody. Nothing is stopping you from running unbuilt versions and building on a separate machine. And I would say that given the ease of writing a simple deploy script in node, it's fine for them to do that instead of reinventing the wheel. Apr 27 21:22:18 They want adoption of Enyo Apr 27 21:22:32 if they want people to adopt enyo, they need to make it easy for all users Apr 27 21:22:39 not just for a specific demographic Apr 27 21:22:48 Why do you think JQuery is so popular? Apr 27 21:22:53 It's easy for 90%+ of developers. Apr 27 21:23:00 They support all the way to the oldest versions of IE Apr 27 21:23:18 and have simple selectors to make writing the code very easy Apr 27 21:24:05 <•05:22:50 PM•> <•kesne•> It's easy for 90%+ of developers. <-- I don't accept bullshit made up statistics Apr 27 21:24:15 you have no way to back that up Apr 27 21:24:39 I'd back it up with OS marketshare statistics. Apr 27 21:24:42 kesne: There is an enyo node module, btw. Apr 27 21:24:52 I should say npm module. Apr 27 21:25:17 And as for jquery, for most use cases. those same selectors are available in js, they're not jquery-specific, but yes, it's compatibility is a big thing. Apr 27 21:25:21 Roy__: The more you know. Apr 27 21:26:07 Roy__: It's basically what I was talking about, sans the better decency management. Apr 27 21:27:05 Roy__: Seems like it can only add official libraries. Still super cool though. Apr 27 21:27:11 * kesne starts installing it. Apr 27 21:27:50 kesne, if I make a site that only supports FF and Chrome, then I would lose the marketshare of IE users Apr 27 21:28:00 it's the same concept w/ the build system for enyo Apr 27 21:28:12 require node, and you lose everyone who doesn't use node Apr 27 21:28:18 GodGinrai: Except in this case it's supporting something that isn't very common. Apr 27 21:28:26 Except in enterprise. Apr 27 21:28:30 are you fucking kidding me? Apr 27 21:28:39 did you seriously say that perl is not common? Apr 27 21:28:46 No no Apr 27 21:29:05 I meant the SPARC architecture. Apr 27 21:29:06 GodGinrai: There are other javascript minification tools out there if you're not fond of bootplate's tools. Bootplate was made to make it easy for people who are primarily JavaScript developers. Apr 27 21:29:29 Roy__, I understand that Apr 27 21:29:42 If it were up to me, I would have replaced bootplate with the enyo node module. I kinda hate bootplate. Apr 27 21:29:47 But my question is: What benefit does the minifier being written in node bring? Apr 27 21:29:55 I hate bootplate as well <.< Apr 27 21:30:07 It's written in JavaScript so anyone with a JS background can see what it does. Apr 27 21:30:43 but isn't it more important for it to run on more systems than to be able to "see what it does"? Apr 27 21:30:44 also Apr 27 21:31:05 Any developer who can't follow another language to at least some extent isn't one you'd want to hire Apr 27 21:31:41 It's portable. And with more and more people using node for server side development… Just a natural evoltuion. Apr 27 21:32:17 Having a requirement on a whole other language wouldn't make any more sense than having the node dependency. Apr 27 21:32:44 Besides, what % of developers are using sparc? You might as well argue that Enyo is screwing up by not supporting IE 6. Apr 27 21:33:13 I suspect it has a higher market share than sparc. Apr 27 21:33:20 How is node more portable than a utility that comes by default on all the boxes? Apr 27 21:33:43 It's not on Windows... Apr 27 21:33:49 And that's what I've been saying. Apr 27 21:34:08 as I said, most developers have perl on Windows through Cygwin and the like Apr 27 21:34:14 and if not, at least they can install it Apr 27 21:34:26 V8 (required for node to work) does not work on SPARC architecture Apr 27 21:34:40 also, the opportunity cost on IE6 is greater than SPARC, I agree Apr 27 21:35:10 but the amount of development effort to maintain IE6 compatibility versus maintaining a perl minifier is much greater Apr 27 21:35:56 so while the opportunity cost is greater, one requires a large amount of continuous developer effort, while the other is minimal effort to accomplish Apr 27 21:37:09 hell, really, I think documentation would be more important than even maintaining a minifier, since that is probably where enyo is most lacking, currently Apr 27 22:25:19 hello community Apr 27 22:25:48 hello **** ENDING LOGGING AT Sun Apr 28 02:59:58 2013