« first day (504 days earlier)      last day (4443 days later) » 

12:05 AM
I added browser support
and by browser support I mean "only tested on chrome <trollface/>"
 
GGG
lol
nWhore
 
it should just work :\
I'm not a whore :(
I think its pretty awesome that DI for the browser just works
You have your folder of code, you have your dependency.json file based dependency routing
and then you just use the ncore CLI to bundle all of that into one file
 
GGG
is moduleLoader the main thing?
 
I sold my ass for for javascript once. It wasn't worth it.
 
that's it, done. No global scope, ever again
nCore is the main thing, moduleLoader is file based dependency routing sugar
 
GGG
12:08 AM
mm is there an ncore.js that i'm not seeing
 
lib/core.js
also ./index.js
 
GGG
ah ok
i always use lib for third party stuff, didn't look there
how does module.exports work on client?
and require?
 
browserify makes it work
 
GGG
woot
oh did you ever check out my modules thing
 
Maybe
link
 
GGG
12:11 AM
lol i'll take that as a no
it's very minimal right now but it does the trick
 
it has no README
fuck that
 
GGG
trying to decide whether to make module.exports work
 
tell me when it has a README
 
GGG
ah yeah it does need a readme
 
gist: A quick outline of a README.md , 2011-11-14 08:26:28Z
## README.md Outline

* Header and a Brief description (should match package.json)
* Example (if applicable)
* Motivation (if applicable)
* API Documentation: _This will likely vary considerably from library to library._
* Installation
* Tests
* Contributors
* License

**Bonus Points**

1. The file is named exactly `README.md` (not `ReadMe.md`, or `README`)
2. The license file is named exactly `LICENSE` (not `MIT-LICENSE`, or `license`)
3. The entire license is not included in `README.md`, just a snippet saying it is MIT or Apache or whatever
 
GGG
12:13 AM
yeah yeah
it's a script, all the arguments are at the top of this file =p github.com/gitbuh/com4/blob/master/src/include.sh
basically just run com4 -i inputfile -o outputfile.js
-I "include/dir/one include/dir/two"
 
I see
 
GGG
oh it lets you separate stuff into different files too
so you can have foo.js and foo.h.js, they will get glued together basically
that way you can keep all the imports and exports in one file, and all the code in the other...
so you can test in the browser easily by just dumping all the files in together without doing the modules thing if you always name things the same way
for example say you have a css module with css.hasClass, css.addClass, etc
always call it css everywhere, don't rename it, and everything will just work
in your header, var css = require('css').css;
it seems a little weird at first but it gets rid of the compile step while testing
 
o.o
foo.h.js ?
how does it get rid of the compile step?
 
GGG
yes please refer me some better solution thanks in advance i am new with the javas
 
I'm so awake...
but so tired...
why I haz jetlags ._.
 
GGG
12:21 AM
because none of the files with your actual code in it have any idea about modules, require, etc
and they all use same names for everything
so if you just dump out script tags in the right order, which this thing has a special feature for, everything will just work (for testing)
 
@IvoWetzel backwards jetlag is the worse
@IvoWetzel I did the manly thing of "STAY UP AN EXTRA 16 HOURS >:("
@GGG oh I see
 
I had like 5 hours of sleep earlier
then woke up at 20 o'clock
 
GGG
12:38 AM
tell me how you guys feel about this strategy... say you have a function called ajax, it takes a bunch of arguments, or maybe an "options" object with a bunch of settings, and a callback, right
instead of doing that, what if you passed a callback object
it needs to have a property callback which is the actual callback, and the other properties are the rest of the options
is that a normal thing to do?
it doesn't have to be named ajax, but generally a funtion that takes a bunch of inputs and a callback
maybe the thing you pass to the callback function is the same callback object, and you add a 'result' property
 
everwyone be verwy quiet.
I'm hunting wabbits
 
GGG
lol i'm thinking out loud aren't i
 
yes, I do that lol
I like talking myself through a problem too lol
but not aloud...
 
GGG
hahah
 
Idk which one makes you more crazy
 
GGG
12:42 AM
i think i'm just going to try it out and see how i like it
seems like it would be useful
actually you wouldn't need to pass it anything, because this would be the callback object if you did callbackObj.callback()
i think i like that
cbObj.response = "blah"; cbObj.callback();
"response" or "result?"
guess it depends. maybe that's why positional arguments are better?
 
I think that would be faster than constructing a new arguments object
 
GGG
'this' can be slow though
 
then why not use "cbObj"?
 
GGG
i got it
var response = "blah"; cbObj.response = response; cbObj.callback(response);
 
I never really understand the whole point of this other than to shorten code, and convenience
 
GGG
12:47 AM
it doesn't really shorten code either if you're minifying it
 
var response = "blah"; cbObj.response = response; <-why???
 
GGG
right
you're already putting it in an argument
so just cbObj.callback(response);
so at least you have "this" as a reference to your original "callback object"
so you can see what you actually called
 
Which dependency mapping makes more sense?
 
cbObj = {
callback : function () {
alert(cbObj.arg1);
return "result";
}
}

cbObj.arg1 = 'something'; alert(cbObj.callback());
maybe idk what you're talking about lol
 
GGG
no that's pretty much it
ajaxCall = {url: "http://blah.blah", post: {foo: 1, bar: "heh"}, callback: function(result){ ... } }
ajax.post(ajaxCall);
or something
 
12:52 AM
ajax.call = {url: "http://blah.blah", post: {foo: 1, bar: "heh"}, callback: function(result){ ... } }
ajax.post();
 
GGG
ehh too classical, ajax is just a singleton object i'm thinking
ajax.post({url: "http://blah.blah", post: {foo: 1, bar: "heh"}, callback: function(result){ ... } });
otherwise it would ba like var ajax = new Ajax({...});
 
with hundred of calls, I think there would be a slight performance boost in not passing an argument
 
GGG
or whatever
but it's ajax, your bottleneck will be with the network anyway
 
true
but why get to the bottleneck any slower?
no excuse to take your time getting there
 
GGG
@Raynos explain app and server
i can't tell what's going on there
 
12:55 AM
an inevitable bottleneck is just more of a reason to speed things up everywhere else
 
GGG
@Raynos if you have to do stuff like that in DI i'm not sure i'm a fan
 
@GGG what do you mean app and server?
the server is just a http server
@GGG you mean the JSON file?
the JSON file tells you what gets in injected where, you need one per project
@GGG some frameworks inject or pass things around by "convention"
the json file defines what the convention is based on file mappings
 
GGG
1:11 AM
@Raynos what is the goal of the injection stuff? Getting different results for different environments like client and server?
 
"It strictly defines what a unit is and makes it easy to mock out that unit's dependencies. This makes testing and TDD easy"
 
GGG
ok so give me an example of something i would use this for
 
Any application
its basically the base layer of any application
 
GGG
that doesnt sound right
i mean the goal is to load one of a few different things that share the same interface right
 
Well it has to be JS :p
you could
I mainly using it for loosely coupled architecture
and just having a way to unit test things real easy
 
GGG
1:14 AM
by doing this do you not need to use require()?
in your application
i mean could you just use require instead of doing this basically
 
how do you mock require in your unit tests?
yeah you could use require instead
and I still use require for third party dependencies
 
GGG
require is pretty easy to mock actually
 
I just dont use require for my own files because I want to mock those out
mocking require is ugly
 
GGG
it is ugly indeed
hack city
but not hard
 
Agreed
but id rather not hack into require
ncore also has a bunch of other advantages
which are more iffy
 
GGG
1:17 AM
i don't really "get" DI i guess
it seems like having a bunch of paths in a config file is bad
 
I dont "get" it iether
 
GGG
config files are evil
 
config files aren't evil
 
GGG
no no they are
they are bad
 
That would be a config file for an entire application I have
 
GGG
1:19 AM
yeah that's not too bad
as long as it's a finite set of stuff
 
yeah it is
because it maps folders to folders
not individual files to individual files
 
GGG
if you're adding another thing to it for every path to every file in your app you're in trouble
 
Agreed
I group files by "module type"
and map type to type
 
GGG
yeah even if you have to map every folder... i mean if your framework has to look in particular places for particular things, like it needs to know where the "views" are or whatever, that makes sense for a config file
 
well maybe "module class" is better
 
GGG
1:21 AM
but i'd go with pojs, not json. You're not going to load it as a string and do the json thing, right, it will just be evaluated
so i guess i just mean rename it to .js so it feels more like code and not a config file
ppl don't like config files
just my opinion of course ;p
 
GGG
yeah it seems like this is just a bunch of aliases for require
 
Just include it as an object rather then as a require("dependency.json")
 
GGG
this is why i keep that stuff in a separate "header" file
 
@GGG at the very core, yes. But it does a ton more
It provide a two stage setup for your modules
one for individual asynchronous setup of all modules
and one for application startup once all modules are setup asynchronously
It also allows you to expose interfaces to other modules which are subsets of your module
it allows you to use event emitters, it wraps your interfaces in proxies, it enables hot module reload on a running server
etc etc etc
 
GGG
1:26 AM
ncore does right
 
yes
 
GGG
but it did that before you did the DI stuff ;)
 
yeah :)
 
GGG
just don't make the DI stuff mandatory maybe
 
except I rewrite it all
its not mandatory
dependency.json -> empty -> no DI
 
GGG
1:27 AM
gotcha
well if it floats your boat ;)
DI, i mean
ncore sounds cool, i want to use it for something actuallyh
 
go ahead :) let me know about any API/ docs improvement suggestions
 
GGG
i just cloned it actually... where's the CLI?
oh, bin, duh
Cannot find module 'commander'
ok how do i install node stuff
and how did you get the executable flag on the CLI? I thought git didn't let you set flags
@Raynos
 
oh hi
 
GGG
lol hi
 
@GGG it does allow executable flags
you do npm install
 
GGG
1:40 AM
nfw
did not know that
still can't set mime types, or can you do that too now?
 
or npm install ncore -g
that should also work
then you can just do $ ncore ...
 
GGG
i cloned it...
you have it in the main package repo?
 
also you dont need the CLI for node code
 
GGG
i just wanted to play with it
 
:)
 
GGG
1:43 AM
son of a bitch
where is npm
 
install node :P
 
GGG
i have node
 
npm gets auto installed with node 0.6.x
install node from the source :D
 
GGG
lol i have v0.2.6
 
yeah it wont run with 0.2.6 :D
 
GGG
1:47 AM
hahah building from source now
damn it's like all openssl stuff
i bet you like 90% of this whole thing is ssl junk
 
heh
 
GGG
  CC(target) /home/owner/Projects/node/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/x509v3/v3_info.o
  CC(target) /home/owner/Projects/node/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/x509v3/v3_int.o
  CC(target) /home/owner/Projects/node/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/x509v3/v3_lib.o
  CC(target) /home/owner/Projects/node/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/x509v3/v3_ncons.o
  CC(target) /home/owner/Projects/node/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/x509v3/v3_ocsp.o
....
on and on and on
what's "uv?"
 
is the IO layer
its like boost::asio
but a fraction of the size
 
GGG
gotcha
 
its basically cross platform asynchronous IO
 
GGG
1:51 AM
and ev?
 
event loop for C
 
GGG
that was my guess
 
GGG
ok here comes v8 stuff, processor maxing out now
that's cool
they must have this on optimization level a zillion
shit is really bogging down
 
user1385191
watching a "talk" on the DOM; turns out it's a "jQuery application" tutorial
 
user1385191
1:56 AM
great...
 
-.-
 
user1385191
enjoy
 
GGG
thanks brah
 
there was a good one somewher e:P
 
user1385191
1:58 AM
it's called "An Inconvenient API"
 
user1385191
by Crockford
 
user1385191
oh great, more talk about "autocomplete"
 
user1385191
guess what, bozo? "autocomplete" already exists
 
user1385191
[typing what you want while focused on a select element]
 
:)
i hate flash
its a poc
 
user1385191
2:03 AM
blame the devs
 
user1385191
I see the same crap with JavaScript abuse
 
true dat
 
you guys made me burn my bacon
turkey bacon =]
i don't eat swine
 
GGG
mmm bacon
 
and eggs and hash brown and corned beef
 
GGG
2:07 AM
damn raynos you didn't tell me building node was going to turn my laptop into a hand warmer
 
corned beef reminds me of cat food but it's still good
 
GGG
corned beef is good but yeah it's scary
 
GGG
hmm i have eggs
 
user1385191
lol 15 minutes in and this isn't even about the DOM anymore
 
user1385191
2:09 AM
it's all client-side MVC bloat
 
GGG
augh frigging buld already
here come zlib
yay here comes node
and done
../src/node_crypto.cc: In static member function ‘static v8::Handle<v8::Value> node::crypto::Hmac::HmacDigest(const v8::Arguments&)’:
../src/node_crypto.cc:2864:5: warning: comparison between signed and unsigned integer expressions
that sounds bad
 
user1385191
 
GGG
@MattMcDonald you remind me of the guy who eats something gross and goes "oh this is terrible, here, try it"
 
@GGG lol
 
GGG
@Raynos ok i'm confused.. i installed commander with npm
built node
but still Error: Cannot find module 'commander'
 
2:18 AM
@GGG ._.
 
GGG
node is at v0.7.6-pre
 
lol 0.7
Ok
You forgot to git checkout 0.6
before make / make install
 
GGG
whaa
no way am i building that again
work your DI magic for 0.7 ;)
 
Also in the root directory of ncore you need to run just npm install -d
 
GGG
oh neat
how does it get the deps
 
2:19 AM
from package.json
 
GGG
package.json i guess
got it
ugh
ok do you want to see what failed
not too much
 
in a gist
 
yeah package.json says "I work with version 0.6 only :D
just change it
 
GGG
yeah that's what i thought
can we make it say 0.6 or later?
 
2:23 AM
yeah
>=0.6
 
GGG
wtf theres another one somewhere
 
in a nested module :)
like pd
or event emitter light
they are fuckign with you
 
GGG
grr
 
just check out 0.6 and rebuild
 
GGG
yeah right
 
2:25 AM
I guess it should work with 0.7
its just not tested
 
GGG
we'll see
 
not sure whether I should allow it
 
GGG
oh right i cant edit those bc they're being pulled in
son of a bitch
okay i give up
 
:P
 
GGG
you could just let it build in 0.7 and throw a wrning up or something
 
2:28 AM
probably
but its kind of effort to go and fix all that :D
 
GGG
i dunno if you can make npm throw a warning
 
just rebuild into 0.6
Interesting
there might be an option
 
GGG
lol it can't be that much effort
building node again is worse
that was a pain in the balls
 
--force
 
GGG
that worked... lol i saw burrito in there
 
2:30 AM
> or pick a different one with --node-version=0.6.12
 
GGG
well it didn't bomb out anyway
 
yeah theres a module called buriot
 
GGG
hmm ok how to run the unit tests real quick
for ncore
@Raynos i think you forgot to add ncore/dependency.json
 
make test
ncore doesnt need a dependency.json because ncore isnt build with ncore :P
 
GGG
but when i run the CLI it says it wanted that
Error: Cannot find module '/home/owner/Projects/ncore/dependency.json'
tests all passed
 
2:35 AM
You should run CLI with a parameter :)
see the makefile
 
GGG
makefile doesn't seem to call ncore?
no i'm retarded it does
ok so you basically just point it at your main program
and it does its thing, and cranks out a js file?
 
I point it at /test/modules
and output to test/browser/build.js
also ncore --help
 
GGG
ah
ok so the input is a directory of files
you promise dependency.json doesn't need to be there?
if so how does it know what to do?
 
2:56 AM
it needs to be there
if you want to use it for a browser
 

« first day (504 days earlier)      last day (4443 days later) »