generator-closure icon indicating copy to clipboard operation
generator-closure copied to clipboard

Run 'deps' in server & build tasks

Open casio opened this issue 11 years ago • 9 comments

Generating a project with the generator and subsequently running grunt server will open the app without the deps.js file existing yet.

Since the tasks is rather fast, IMHO deps should be run at the beginning of server and maybe `build, as well.

casio avatar Mar 26 '13 11:03 casio

hmmm are you sure about this? The fresh generated project contains a proper deps.js file...

thanpolas avatar Oct 14 '13 13:10 thanpolas

Have not tested recent versions lately, so I didnt yet realize deps.js is being created now.

However, running deps in server could also be beneficial eg. when you just pulled recent changes from a repo that introduced new depencencies or similar. Dunno, just my 2 cents.

casio avatar Oct 15 '13 09:10 casio

Any changes to goog.required scripts won't be mirrored in deps.js in server-mode until you explicitly launch grunt deps (this is the behaviour of vanilla app generated by this generator).

(btw, live-reloading doesn't work in vanilla app either)

ostronom avatar Nov 22 '13 23:11 ostronom

@ostronom that's the expected behavior... why didn't you open a new issue for the live-reloading? does the problem persist? If so please open a new issue

@casio running deps on server is a major nono for so many reasons... On server only your compiled app should land...

thanpolas avatar Nov 25 '13 13:11 thanpolas

@thanpolas err, the 'server' we're talking about here is a local dev server with livereload & whatnot and by no means a production server. We're both talking about the grunt server command, I think?

casio avatar Nov 25 '13 15:11 casio

@casio i see...

So what's the issue here? I am not sure i completely understand...

If it's about deps automation, then you have to setup your gruntfile as it'd fit your needs... i can help with that... or it's something else?

thanpolas avatar Nov 25 '13 15:11 thanpolas

@thanpolas I just created this very minor ticket as a little hint regrading developer convenience..U know, so guys checking out the generator would have a proper git clone, npm install, launch & success experience : )

Really minor, so please close as you see fit. However, @ostronom's argument might be worth considering...

casio avatar Nov 25 '13 15:11 casio

I see, i will do a full regression test soon and if all checks out i'll close the issue.

for the record, i don't consider adding the grunt deps task to livereload/watch, i might add the option commented out in the Gruntfile so it's activated by folks that require it.

Deps generation is decoupled and irrelevant with the watch tasks. The deps task needs to run whenever a change in the deps tree of your product has changed, that doesn't happen with every file change.... Personally, i have the grunt deps command as a shortcut key in sublime (build option), so whenever i touch the dep tree i just press Cmd+b and the deps file is updated before i switch windows to my browser...

thanpolas avatar Nov 25 '13 15:11 thanpolas

I've made a new grunt-file with your closure-oriented tasks, which:

  1. assembles all js and stuff to .tmp directory
  2. runs deps on them
  3. makes a symlink (grunt-contrib-symlink or smth) of closure-library to .tmp/.../closure-library
  4. and serves the app from .tmp

This gives a possiblity to develop not only in js, but in coffee/livescript/etc and to do a deps-run on change of .tmp/*.js to recalculate dependencies.

I will share a gruntfile via gist when i'll be sure that everything works (if you want).

P.S. I can't file an issue about livereload breakage, because i don't know how to fix it :) So it's probably not a bug of this software.

ostronom avatar Nov 25 '13 21:11 ostronom