decafjs / decaf

decaf core
MIT License
31 stars 7 forks source link

Cloning from github #12

Open mm765 opened 8 years ago

mm765 commented 8 years ago

The way it is described in the readme ("git clone git@github.com:decafjs/decaf") did not work for me, instead i used: "git clone https://github.com/decafjs/decaf" I don't know if that is just me or if the readme should be changed.

Regards, Matthias

mschwartz commented 8 years ago

Thanks. I will fix it in the morning. ;)

On Tuesday, January 5, 2016, mm765 notifications@github.com wrote:

The way it is described in the readme ("git clone git@githubcom:decafjs/decaf") did not work for me, instead i used: "git clone https://githubcom/decafjs/decaf" I don't know if that is just me or if the readme should be changed

Regards, Matthias

— Reply to this email directly or view it on GitHub https://github.com/decafjs/decaf/issues/12.

mschwartz commented 8 years ago

I highly recommend you use bower to install decaf. There's an example app or tutorial repo you might want to review.

On Tuesday, January 5, 2016, Mike Schwartz mykesx@gmail.com wrote:

Thanks. I will fix it in the morning. ;)

On Tuesday, January 5, 2016, mm765 <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

The way it is described in the readme ("git clone git@githubcom:decafjs/decaf") did not work for me, instead i used: "git clone https://githubcom/decafjs/decaf" I don't know if that is just me or if the readme should be changed

Regards, Matthias

— Reply to this email directly or view it on GitHub https://github.com/decafjs/decaf/issues/12.

mm765 commented 8 years ago

Yeah, i've seen that you use bower but i don't like the added "weight" :)

mschwartz commented 8 years ago

The advantage of bower is you can be sure your app isn't loading modules from /usr/local, and you basically just do git clone && bower install and you're up and running.

On Tuesday, January 5, 2016, mm765 notifications@github.com wrote:

Yeah, i've seen that you use bower but i don't like the added "weight" :)

— Reply to this email directly or view it on GitHub https://github.com/decafjs/decaf/issues/12#issuecomment-169204111.

mm765 commented 8 years ago

Im using Cake (from coffeescript, like "make") to install and update(watch for code-changes) my app, so i have my own directory structure which i want to keep as clean as possible. Which btw, also gave me a small headache regarding the mongo-jar-file. My solution was to add a LOCALCP environment var and add that in the decaf-common.sh directly to the CP="." line - making it CP=".:$LOCALCP". I've seen that, if there is a local modules dir the files from there are added but, again, this does not work with my directory structure

mschwartz commented 8 years ago

Please read the require() documentation on the wiki. You can set the path array that require() searches to your preferred structure. If it were me, I'd use bower to install some things and cake for the rest. Path of least resistance.

On Tue, Jan 5, 2016 at 6:54 PM, mm765 notifications@github.com wrote:

Im using Cake (from coffeescript, like "make") to install and update(watch for code-changes) my app, so i have my own directory structure which i want to keep as clean as possible. Which btw, also gave me a small headache regarding the mongo-jar-file. My solution was to add a LOCALCP environment var and add that in the decaf-common.sh directly to the CP="." line - making it CP=".:$LOCALCP". I've seen that, if there is a local modules dir the files from there are added but, again, this does not work with my directory structure

— Reply to this email directly or view it on GitHub https://github.com/decafjs/decaf/issues/12#issuecomment-169204731.

mm765 commented 8 years ago

I read that - but i thought that it only works for javascipt-modules not for adding .jar files to the classpath ? Maybe i should read it again.

mschwartz commented 8 years ago

require() doesn't load the .jar files. Those are loaded from ./modules/java/*.jar and a few other possible locations added to the class path. Java is ugly when it comes to CLASSPATH.

On Tue, Jan 5, 2016 at 7:01 PM, mm765 notifications@github.com wrote:

I read that - but i thought that it only works for javascipt-modules not for adding .jar files to the classpath ? Maybe i should read it again.

— Reply to this email directly or view it on GitHub https://github.com/decafjs/decaf/issues/12#issuecomment-169205581.

mm765 commented 8 years ago

Ok, thats what i thought - my LOCALCP adds to the java classpath, not js-modules. And yeah, i already hated the classpath 10-15 years or so ago, when i last used java.

mschwartz commented 8 years ago

decaf.sh debug yourscript.js

in the debugger, choose "break on exceptions" and let your program run

When it stops at the error, you can examine the variables and state of the program.

In the debugger's console panel (lower right), you can enter JS expressions. I implemented a d() method that will dump a JS/Java object in human readable format. That might help diagnose things.

On Tue, Jan 5, 2016 at 7:02 PM, Mike Schwartz mykesx@gmail.com wrote:

require() doesn't load the .jar files. Those are loaded from ./modules/java/*.jar and a few other possible locations added to the class path. Java is ugly when it comes to CLASSPATH.

On Tue, Jan 5, 2016 at 7:01 PM, mm765 notifications@github.com wrote:

I read that - but i thought that it only works for javascipt-modules not for adding .jar files to the classpath ? Maybe i should read it again.

— Reply to this email directly or view it on GitHub https://github.com/decafjs/decaf/issues/12#issuecomment-169205581.

mm765 commented 8 years ago

That is very good to know (need to bookmark this :) )

mschwartz commented 8 years ago

If you come up with any pull requests, they are welcome.

On Tue, Jan 5, 2016 at 7:12 PM, mm765 notifications@github.com wrote:

That is very good to know (need to bookmark this :) )

— Reply to this email directly or view it on GitHub https://github.com/decafjs/decaf/issues/12#issuecomment-169206903.

mschwartz commented 8 years ago

This site is done with decaf and mongodb:

http://mbrea.net

It has a basic CMS with modules for events and news. The pages are rendered using HoganJS. It does e-commerce and sends email, syncs with mailchimp for sending newsletters.

The home page is rendering maybe 10 hogan templates and does a handful of mongo queries. I see page load times (with empty browser cache) something like this:

527ms seems fast to me :)

I wish I could open the source to the public, but it's not my call.

The directory structure is something like:

./ ./boot.js ./controllers/ ./lib/ ./views/ ./services/

controllers are Jolt endpoints.

lib/ contains local modules and data models

views/ contains hoganjs templates and partials

services/ contains Jolt endpoints for Ajax/XHR requests from the client. That is, API returning JSON.

On Tue, Jan 5, 2016 at 7:13 PM, Mike Schwartz mykesx@gmail.com wrote:

If you come up with any pull requests, they are welcome.

On Tue, Jan 5, 2016 at 7:12 PM, mm765 notifications@github.com wrote:

That is very good to know (need to bookmark this :) )

— Reply to this email directly or view it on GitHub https://github.com/decafjs/decaf/issues/12#issuecomment-169206903.

mschwartz commented 8 years ago

You can put debugger; statement in your code to stop the app in the debugger.

d(db.find()) works :)

any expression can be dumped.

On Tue, Jan 5, 2016 at 7:20 PM, Mike Schwartz mykesx@gmail.com wrote:

This site is done with decaf and mongodb:

http://mbrea.net

It has a basic CMS with modules for events and news. The pages are rendered using HoganJS. It does e-commerce and sends email, syncs with mailchimp for sending newsletters.

The home page is rendering maybe 10 hogan templates and does a handful of mongo queries. I see page load times (with empty browser cache) something like this:

527ms seems fast to me :)

I wish I could open the source to the public, but it's not my call.

The directory structure is something like:

./ ./boot.js ./controllers/ ./lib/ ./views/ ./services/

controllers are Jolt endpoints.

lib/ contains local modules and data models

views/ contains hoganjs templates and partials

services/ contains Jolt endpoints for Ajax/XHR requests from the client. That is, API returning JSON.

On Tue, Jan 5, 2016 at 7:13 PM, Mike Schwartz mykesx@gmail.com wrote:

If you come up with any pull requests, they are welcome.

On Tue, Jan 5, 2016 at 7:12 PM, mm765 notifications@github.com wrote:

That is very good to know (need to bookmark this :) )

— Reply to this email directly or view it on GitHub https://github.com/decafjs/decaf/issues/12#issuecomment-169206903.

mschwartz commented 8 years ago

Regarding your first post, the clone URL (for SSH) on the home page, the URL provided by github, is git@github.com:decafjs/decaf.git

It only works if you've logged in and uploaded an ssh key.

mschwartz commented 8 years ago

one more thing...

https://github.com/decafjs/decaf-coffeescript

If you require('decaf-coffeescript'), then you can require('foo') and it will load and compile foo.coffeescript if it exists.

No need for watchers except for client side coffeescript -> JS.

There is also this:

https://github.com/decafjs/decaf-jolt-coffeescript

It provides a Jolt module that allows you to write your controllers and API endpoints 100% in coffeescript, no watchers.

The version of coffeescript in the repo is probably really old. You can probably drop in a newer version if that's required.

mm765 commented 8 years ago

I've seen the coffeescript/jolt-coffeescript projects and really like the idea. But my codebase will be too large for that - i am running a minify on the javascript after coffeescript-compilation.

mschwartz commented 8 years ago

That's ok. You know your app best.

FWIW, I wrote the http server in 100% coffeescript and for the life of me, I could not get it to go any faster than .6 x the speed of pure JS. That is, my best coffeescript turned out to be 40% slower than my best JS.

On Tue, Jan 5, 2016 at 7:41 PM, mm765 notifications@github.com wrote:

I've seen the coffeescript/jolt-coffeescript projects and really like the idea. But my codebase will be too large for that - i am running a minify on the javascript after coffeescript-compilation.

— Reply to this email directly or view it on GitHub https://github.com/decafjs/decaf/issues/12#issuecomment-169212952.