[web2py] Re: Webassets in web2py
I'm starting to fall in love with TypeScript... http://www.youtube.com/watch?v=3dqZW_DqHIQ On Tuesday, December 18, 2012 1:21:33 AM UTC+2, Arnon Marcus wrote: That sounds very cool, thanks for the detailed answered, this makes my head a little calmer now... BTW, I actually DID mean coffeCup, It refers to the python module that does coffeeScript-to-javascript transipling. https://github.com/dsc/coffeecup Apparently, it also depends on node... Anyways, I think i'm sarting to lean more towards TypeScript anyways, so... On Monday, December 17, 2012 2:26:38 PM UTC-8, Niphlod wrote: On Monday, December 17, 2012 2:50:09 PM UTC+1, Arnon Marcus wrote: Holy shit... Where did you say you got all that info from? quoted the link and scanning the source code Is this what that module needs? I thought it's just a stand-alone pythonic-module doing everything... Guess I was a bit optimistic... little bit too much :P What about coffeeCup? meaning coffeescript ? - is it just something like edit the less file in static/less/file.less and have it recompiled as /static/css/file.css Well, either that and/or sass/scss, as well as coffescript transpiling, with optional minification/zipping for the resaulting js/css, yeah, basically that. I'm not that much advanced, but as long as there is a list of extensions that follow the same rule, a contrib script continuosly checking for changed files is not hard to do. But if there is ANY need for node.js in this kind of solution, than forget it. I gave you the list of what webasset provide with python modules. I think the author researched a lot and resorted to external binaries only when needed Is web2py minifying css/js scripts by default? If so, in what circumstances? And since what version? nope. Web2py includes contrib.minify (containing jsmin and cssmin) that is activated by response.optimize_css and response.optimize_js . It's a feature I think since 1.99.7. Gzipping is not done within web2py. Usually that is something done only one-time-only before releasing to production and for that there is scripts/zip_static_files.py (meant to be run from shell as web2py.py -S yourapp -R scripts/zip_static_files.py). It creates automatically .gz files with the same mtime in order to be recognized as valid replacement by apache, nginx co. Standalone web2py serves automatically gz files in the static folder with the same mtime without any configuration at all (meaning that a request for /app/static/js/jquery.js as long as there is a /app/static/js/jquery.js.gz with the same mtime will serve the gzipped one automatically) --
[web2py] Re: Webassets in web2py
anoher node.js dependancy ^_^ Il giorno mercoledì 19 dicembre 2012 15:53:45 UTC+1, Arnon Marcus ha scritto: I'm starting to fall in love with TypeScript... http://www.youtube.com/watch?v=3dqZW_DqHIQ On Tuesday, December 18, 2012 1:21:33 AM UTC+2, Arnon Marcus wrote: That sounds very cool, thanks for the detailed answered, this makes my head a little calmer now... BTW, I actually DID mean coffeCup, It refers to the python module that does coffeeScript-to-javascript transipling. https://github.com/dsc/coffeecup Apparently, it also depends on node... Anyways, I think i'm sarting to lean more towards TypeScript anyways, so... On Monday, December 17, 2012 2:26:38 PM UTC-8, Niphlod wrote: On Monday, December 17, 2012 2:50:09 PM UTC+1, Arnon Marcus wrote: Holy shit... Where did you say you got all that info from? quoted the link and scanning the source code Is this what that module needs? I thought it's just a stand-alone pythonic-module doing everything... Guess I was a bit optimistic... little bit too much :P What about coffeeCup? meaning coffeescript ? - is it just something like edit the less file in static/less/file.less and have it recompiled as /static/css/file.css Well, either that and/or sass/scss, as well as coffescript transpiling, with optional minification/zipping for the resaulting js/css, yeah, basically that. I'm not that much advanced, but as long as there is a list of extensions that follow the same rule, a contrib script continuosly checking for changed files is not hard to do. But if there is ANY need for node.js in this kind of solution, than forget it. I gave you the list of what webasset provide with python modules. I think the author researched a lot and resorted to external binaries only when needed Is web2py minifying css/js scripts by default? If so, in what circumstances? And since what version? nope. Web2py includes contrib.minify (containing jsmin and cssmin) that is activated by response.optimize_css and response.optimize_js . It's a feature I think since 1.99.7. Gzipping is not done within web2py. Usually that is something done only one-time-only before releasing to production and for that there is scripts/zip_static_files.py (meant to be run from shell as web2py.py -S yourapp -R scripts/zip_static_files.py). It creates automatically .gz files with the same mtime in order to be recognized as valid replacement by apache, nginx co. Standalone web2py serves automatically gz files in the static folder with the same mtime without any configuration at all (meaning that a request for /app/static/js/jquery.js as long as there is a /app/static/js/jquery.js.gz with the same mtime will serve the gzipped one automatically) --
[web2py] Re: Webassets in web2py
Hmmm, not exactly. You CAN use node for/with it, but there are also IDE plugins. I'm using Visual Studio 2012 (trial) and it compiles-on-save automatically, with a side-by-side updating javascript target file view. that is being generated as I save. All the material needed to make such a plugin for any other IDE is open-sourced, and does not NEED node.js to work at all... It even minimizes my files for me as well (generates another *-min.js file). I can even configure the compiler in the IDE to also auto-generate source-maps as it auto-compiles-on-save. This is just another option in the options window of VS, that gets added when I install the web-essentials extension of VS. This is a huge extension, that also provides auto-compilation of LESS-to-CSS files, and also minifiezes the resulting CSS files as well In a nut-shell: Visual Studio 2012 + TypeScript (plugin) + Web-Essentials (extension) = Auto-Compilation/Source-Map-Generation/Minification of TypeScript-JavaScript + LESS-CSS :) All this with ZERO dependencies and without node.js :) :) And I can now debug in Chrome using the original TypeScript files themselves, using the auto-generated-source-maps-on-save, via the Use Source Maps feature in chrome. :) :) :) I can also use use the LESS files in chrome, by using the Support for SASS feature. :) :) :) :) Adding the LivePage (auto-reload) chrome-extension rounds up the real-time-feedback-with-transipling experience. :) :) :) :) :) All the above, without web2py or node.js (!) Here is a better video-presentation for TypeScript: http://channel9.msdn.com/posts/Anders-Hejlsberg-Introducing-TypeScript Here is how Source-Maps work: http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/ LivePage extension: https://chrome.google.com/webstore/detail/livepage/pilnojpmdoofaelbinaeodfpjheijkbh?hl=en On Wednesday, December 19, 2012 5:12:26 PM UTC+2, Niphlod wrote: anoher node.js dependancy ^_^ Il giorno mercoledì 19 dicembre 2012 15:53:45 UTC+1, Arnon Marcus ha scritto: I'm starting to fall in love with TypeScript... http://www.youtube.com/watch?v=3dqZW_DqHIQ On Tuesday, December 18, 2012 1:21:33 AM UTC+2, Arnon Marcus wrote: That sounds very cool, thanks for the detailed answered, this makes my head a little calmer now... BTW, I actually DID mean coffeCup, It refers to the python module that does coffeeScript-to-javascript transipling. https://github.com/dsc/coffeecup Apparently, it also depends on node... Anyways, I think i'm sarting to lean more towards TypeScript anyways, so... On Monday, December 17, 2012 2:26:38 PM UTC-8, Niphlod wrote: On Monday, December 17, 2012 2:50:09 PM UTC+1, Arnon Marcus wrote: Holy shit... Where did you say you got all that info from? quoted the link and scanning the source code Is this what that module needs? I thought it's just a stand-alone pythonic-module doing everything... Guess I was a bit optimistic... little bit too much :P What about coffeeCup? meaning coffeescript ? - is it just something like edit the less file in static/less/file.less and have it recompiled as /static/css/file.css Well, either that and/or sass/scss, as well as coffescript transpiling, with optional minification/zipping for the resaulting js/css, yeah, basically that. I'm not that much advanced, but as long as there is a list of extensions that follow the same rule, a contrib script continuosly checking for changed files is not hard to do. But if there is ANY need for node.js in this kind of solution, than forget it. I gave you the list of what webasset provide with python modules. I think the author researched a lot and resorted to external binaries only when needed Is web2py minifying css/js scripts by default? If so, in what circumstances? And since what version? nope. Web2py includes contrib.minify (containing jsmin and cssmin) that is activated by response.optimize_css and response.optimize_js . It's a feature I think since 1.99.7. Gzipping is not done within web2py. Usually that is something done only one-time-only before releasing to production and for that there is scripts/zip_static_files.py (meant to be run from shell as web2py.py -S yourapp -R scripts/zip_static_files.py). It creates automatically .gz files with the same mtime in order to be recognized as valid replacement by apache, nginx co. Standalone web2py serves automatically gz files in the static folder with the same mtime without any configuration at all (meaning that a request for /app/static/js/jquery.js as long as there is a /app/static/js/jquery.js.gz with the same mtime will serve the gzipped one automatically) --
[web2py] Re: Webassets in web2py
so develop web2py in VS and not in the integrated admin interface :P I was referring to the fact that there is no python compiler for typescript (other IDE advertised have only the syntax highlight feature, not the auto-compile feature) On Wednesday, December 19, 2012 5:40:31 PM UTC+1, Arnon Marcus wrote: Hmmm, not exactly. You CAN use node for/with it, but there are also IDE plugins. I'm using Visual Studio 2012 (trial) and it compiles-on-save automatically, with a side-by-side updating javascript target file view. that is being generated as I save. All the material needed to make such a plugin for any other IDE is open-sourced, and does not NEED node.js to work at all... It even minimizes my files for me as well (generates another *-min.js file). I can even configure the compiler in the IDE to also auto-generate source-maps as it auto-compiles-on-save. This is just another option in the options window of VS, that gets added when I install the web-essentials extension of VS. This is a huge extension, that also provides auto-compilation of LESS-to-CSS files, and also minifiezes the resulting CSS files as well In a nut-shell: Visual Studio 2012 + TypeScript (plugin) + Web-Essentials (extension) = Auto-Compilation/Source-Map-Generation/Minification of TypeScript-JavaScript + LESS-CSS :) All this with ZERO dependencies and without node.js :) :) And I can now debug in Chrome using the original TypeScript files themselves, using the auto-generated-source-maps-on-save, via the Use Source Maps feature in chrome. :) :) :) I can also use use the LESS files in chrome, by using the Support for SASS feature. :) :) :) :) Adding the LivePage (auto-reload) chrome-extension rounds up the real-time-feedback-with-transipling experience. :) :) :) :) :) All the above, without web2py or node.js (!) Here is a better video-presentation for TypeScript: http://channel9.msdn.com/posts/Anders-Hejlsberg-Introducing-TypeScript Here is how Source-Maps work: http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/ LivePage extension: https://chrome.google.com/webstore/detail/livepage/pilnojpmdoofaelbinaeodfpjheijkbh?hl=en On Wednesday, December 19, 2012 5:12:26 PM UTC+2, Niphlod wrote: anoher node.js dependancy ^_^ Il giorno mercoledì 19 dicembre 2012 15:53:45 UTC+1, Arnon Marcus ha scritto: I'm starting to fall in love with TypeScript... http://www.youtube.com/watch?v=3dqZW_DqHIQ On Tuesday, December 18, 2012 1:21:33 AM UTC+2, Arnon Marcus wrote: That sounds very cool, thanks for the detailed answered, this makes my head a little calmer now... BTW, I actually DID mean coffeCup, It refers to the python module that does coffeeScript-to-javascript transipling. https://github.com/dsc/coffeecup Apparently, it also depends on node... Anyways, I think i'm sarting to lean more towards TypeScript anyways, so... On Monday, December 17, 2012 2:26:38 PM UTC-8, Niphlod wrote: On Monday, December 17, 2012 2:50:09 PM UTC+1, Arnon Marcus wrote: Holy shit... Where did you say you got all that info from? quoted the link and scanning the source code Is this what that module needs? I thought it's just a stand-alone pythonic-module doing everything... Guess I was a bit optimistic... little bit too much :P What about coffeeCup? meaning coffeescript ? - is it just something like edit the less file in static/less/file.less and have it recompiled as /static/css/file.css Well, either that and/or sass/scss, as well as coffescript transpiling, with optional minification/zipping for the resaulting js/css, yeah, basically that. I'm not that much advanced, but as long as there is a list of extensions that follow the same rule, a contrib script continuosly checking for changed files is not hard to do. But if there is ANY need for node.js in this kind of solution, than forget it. I gave you the list of what webasset provide with python modules. I think the author researched a lot and resorted to external binaries only when needed Is web2py minifying css/js scripts by default? If so, in what circumstances? And since what version? nope. Web2py includes contrib.minify (containing jsmin and cssmin) that is activated by response.optimize_css and response.optimize_js . It's a feature I think since 1.99.7. Gzipping is not done within web2py. Usually that is something done only one-time-only before releasing to production and for that there is scripts/zip_static_files.py (meant to be run from shell as web2py.py -S yourapp -R scripts/zip_static_files.py). It creates automatically .gz files with the same mtime in order to be recognized as valid replacement by apache, nginx co. Standalone web2py serves automatically gz files in the static folder with the same mtime without any configuration at all (meaning that a request for /app/static/js/jquery.js as long as there is a
[web2py] Re: Webassets in web2py
The auto-compile is just calling the JavaScript-based compiler on the code when the file is saved... Doesn't sound like a lot to implement for a plugin... Maybe there are even things one can wire manually in some IDEs, like binding the save short-key to a macro that runs a command line in the background or something... TypeScript is extremely new, so broad IDE support is not here yet, but it will come soon, I'm sure. In the meantime, I think the TypeScript plugin and web-essentials extension, can be installed on the Express edition(s) of visual studio. And if you still wanna do it in any other IDE, well, there's always node.js and running some watcher on it... I do still think that in general, one should be able to use web2py itself as a watcher, that can run transpilers/minifiers on-save. It should be easy enough to wire a new transpiler/minifier to such a watcher, as there are many javascript transpilers out there, and new ones seem to be popping up every now and then... Hell, someone could write a plugin/app for web2py that runs unit-tests via some library (jasmin, qunit or whatever,,,) It could be a full-stack CI system, kinda like yeoman... There is a growing need for such things as more logic is being developed in(and/or moved to) the client side. The Single-Page-Apps era has arrived, and web2py should adapt. It was a forerunner a few years back, and it should stay on the edge of innovation, or at the very least keep up with the trends. On Wednesday, December 19, 2012 11:53:35 AM UTC-8, Niphlod wrote: so develop web2py in VS and not in the integrated admin interface :P I was referring to the fact that there is no python compiler for typescript (other IDE advertised have only the syntax highlight feature, not the auto-compile feature) On Wednesday, December 19, 2012 5:40:31 PM UTC+1, Arnon Marcus wrote: Hmmm, not exactly. You CAN use node for/with it, but there are also IDE plugins. I'm using Visual Studio 2012 (trial) and it compiles-on-save automatically, with a side-by-side updating javascript target file view. that is being generated as I save. All the material needed to make such a plugin for any other IDE is open-sourced, and does not NEED node.js to work at all... It even minimizes my files for me as well (generates another *-min.js file). I can even configure the compiler in the IDE to also auto-generate source-maps as it auto-compiles-on-save. This is just another option in the options window of VS, that gets added when I install the web-essentials extension of VS. This is a huge extension, that also provides auto-compilation of LESS-to-CSS files, and also minifiezes the resulting CSS files as well In a nut-shell: Visual Studio 2012 + TypeScript (plugin) + Web-Essentials (extension) = Auto-Compilation/Source-Map-Generation/Minification of TypeScript-JavaScript + LESS-CSS :) All this with ZERO dependencies and without node.js :) :) And I can now debug in Chrome using the original TypeScript files themselves, using the auto-generated-source-maps-on-save, via the Use Source Maps feature in chrome. :) :) :) I can also use use the LESS files in chrome, by using the Support for SASS feature. :) :) :) :) Adding the LivePage (auto-reload) chrome-extension rounds up the real-time-feedback-with-transipling experience. :) :) :) :) :) All the above, without web2py or node.js (!) Here is a better video-presentation for TypeScript: http://channel9.msdn.com/posts/Anders-Hejlsberg-Introducing-TypeScript Here is how Source-Maps work: http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/ LivePage extension: https://chrome.google.com/webstore/detail/livepage/pilnojpmdoofaelbinaeodfpjheijkbh?hl=en On Wednesday, December 19, 2012 5:12:26 PM UTC+2, Niphlod wrote: anoher node.js dependancy ^_^ Il giorno mercoledì 19 dicembre 2012 15:53:45 UTC+1, Arnon Marcus ha scritto: I'm starting to fall in love with TypeScript... http://www.youtube.com/watch?v=3dqZW_DqHIQ On Tuesday, December 18, 2012 1:21:33 AM UTC+2, Arnon Marcus wrote: That sounds very cool, thanks for the detailed answered, this makes my head a little calmer now... BTW, I actually DID mean coffeCup, It refers to the python module that does coffeeScript-to-javascript transipling. https://github.com/dsc/coffeecup Apparently, it also depends on node... Anyways, I think i'm sarting to lean more towards TypeScript anyways, so... On Monday, December 17, 2012 2:26:38 PM UTC-8, Niphlod wrote: On Monday, December 17, 2012 2:50:09 PM UTC+1, Arnon Marcus wrote: Holy shit... Where did you say you got all that info from? quoted the link and scanning the source code Is this what that module needs? I thought it's just a stand-alone pythonic-module doing everything... Guess I was a bit optimistic... little bit too much :P What about coffeeCup? meaning coffeescript ? - is it just something like edit the
[web2py] Re: Webassets in web2py
That's interesting - you seem to be using the e-mail response and not google-groups. Try viewing this thread in google-groups, and see the difference. In this case, I already found my error and corrected it inside the post itself, long before you corrected me. I basically said what you said - CoffeCup (the real one) is not the answer. It's kind of an interesting thing what happened here - because whenever I post something, it automatically sends you an email, than if I find out a mistake and correct it by editing the post itself, you will not get the updated version of my post - you will still have my original one in your mail to respond to... Bummer... On Tuesday, December 18, 2012 1:33:54 AM UTC+2, Niphlod wrote: BTW, I actually DID mean coffeCup, It refers to the python module I referenced in my second post here: http://42coffeecups.com/ that page lends to something I can't trace to some source code doing that. I found only tddspry and django couchdb adapter and some sites they made in django. Googling around , this https://github.com/dsc/coffeecup is what are you pointing to, I think. As stated clearly in the readme *CoffeeCup depends on CoffeeScript, which depends on node.jshttp://nodejs.org .* Sorry. --
[web2py] Re: Webassets in web2py
let's give webassets a try: it's a dependency hell (I highly doubt this will be shipped with web2py). However, contrib module are made for those kind of things. Shallow first analysis according to http://elsdoerfer.name/docs/webassets/builtin_filters.html JS: - rjsmin (strips just newline and whitespaces) - yui_js (needs yuicompressor, hence a python module and java) - closure_js (needs closure, hence a python module and java) - uglify_js (needs uglify binary in path, hence node.js) - jsmin (needs jsmin, hence a python module, does pretty much the same thing as response.minify_js) - jspacker (included) CSS: - cssmin (needs cssmin, hence a python module, does pretty much the same thing as response.minify_css) - cssutils (same as before) - yui_css (same as for js) - clean_css (node.js required) - slimmer_css (needs slimmer, hence a python module) compilers - clevercss (needs clevercss, hence a python module) - less (needs less by node.js or ruby) - sass (needs sass from ruby) - scss (same as ssas) - compass (same as ssas) - pyscss (requires a module) - stylus (node.js required) - coffeescript (node.js required) gzip - done by scripts/zip_static_files.py sprites - requires spritemapper I skipped over js templates generators and jinja2 for obvious reasons. So, basically, you'd have a python only functionality slighthly better than the one currently included in web2py with: JS: no such thing CSS: no such thing compilers: clevercss and pyscss sprites: spritemapper All the others features are not python modules: they are just smart wrapper around the command-line arguments of each binary. Now, let's talk about what functionality do you miss in web2py is it just something like edit the less file in static/less/file.less and have it recompiled as /static/css/file.css ? --
[web2py] Re: Webassets in web2py
Holy shit... Where did you say you got all that info from? Is this what that module needs? I thought it's just a stand-alone pythonic-module doing everything... Guess I was a bit optimistic... What about coffeeCup? - is it just something like edit the less file in static/less/file.less and have it recompiled as /static/css/file.css Well, either that and/or sass/scss, as well as coffescript transpiling, with optional minification/zipping for the resaulting js/css, yeah, basically that. But if there is ANY need for node.js in this kind of solution, than forget it. There are already many pre-packaged npm's for node that do all that and then some (like yaomen). I guess we'll have to get used to the idea of running node locally at each dev-machine for development, and another in the server for CI stuff... Is web2py minifying css/js scripts by default? If so, in what circumstances? And since what version? --
[web2py] Re: Webassets in web2py
On Monday, December 17, 2012 2:50:09 PM UTC+1, Arnon Marcus wrote: Holy shit... Where did you say you got all that info from? quoted the link and scanning the source code Is this what that module needs? I thought it's just a stand-alone pythonic-module doing everything... Guess I was a bit optimistic... little bit too much :P What about coffeeCup? meaning coffeescript ? - is it just something like edit the less file in static/less/file.less and have it recompiled as /static/css/file.css Well, either that and/or sass/scss, as well as coffescript transpiling, with optional minification/zipping for the resaulting js/css, yeah, basically that. I'm not that much advanced, but as long as there is a list of extensions that follow the same rule, a contrib script continuosly checking for changed files is not hard to do. But if there is ANY need for node.js in this kind of solution, than forget it. I gave you the list of what webasset provide with python modules. I think the author researched a lot and resorted to external binaries only when needed Is web2py minifying css/js scripts by default? If so, in what circumstances? And since what version? nope. Web2py includes contrib.minify (containing jsmin and cssmin) that is activated by response.optimize_css and response.optimize_js . It's a feature I think since 1.99.7. Gzipping is not done within web2py. Usually that is something done only one-time-only before releasing to production and for that there is scripts/zip_static_files.py (meant to be run from shell as web2py.py -S yourapp -R scripts/zip_static_files.py). It creates automatically .gz files with the same mtime in order to be recognized as valid replacement by apache, nginx co. Standalone web2py serves automatically gz files in the static folder with the same mtime without any configuration at all (meaning that a request for /app/static/js/jquery.js as long as there is a /app/static/js/jquery.js.gz with the same mtime will serve the gzipped one automatically) --
[web2py] Re: Webassets in web2py
That sounds very cool, thanks for the detailed answered, this makes my head a little calmer now... BTW, I actually DID mean coffeCup, It refers to the python module I referenced in my second post here: http://42coffeecups.com/ It does coffeeScript-to-javascript transipling. I think this one is not dependant on node, but I might be mistaken here as well... On Monday, December 17, 2012 2:26:38 PM UTC-8, Niphlod wrote: On Monday, December 17, 2012 2:50:09 PM UTC+1, Arnon Marcus wrote: Holy shit... Where did you say you got all that info from? quoted the link and scanning the source code Is this what that module needs? I thought it's just a stand-alone pythonic-module doing everything... Guess I was a bit optimistic... little bit too much :P What about coffeeCup? meaning coffeescript ? - is it just something like edit the less file in static/less/file.less and have it recompiled as /static/css/file.css Well, either that and/or sass/scss, as well as coffescript transpiling, with optional minification/zipping for the resaulting js/css, yeah, basically that. I'm not that much advanced, but as long as there is a list of extensions that follow the same rule, a contrib script continuosly checking for changed files is not hard to do. But if there is ANY need for node.js in this kind of solution, than forget it. I gave you the list of what webasset provide with python modules. I think the author researched a lot and resorted to external binaries only when needed Is web2py minifying css/js scripts by default? If so, in what circumstances? And since what version? nope. Web2py includes contrib.minify (containing jsmin and cssmin) that is activated by response.optimize_css and response.optimize_js . It's a feature I think since 1.99.7. Gzipping is not done within web2py. Usually that is something done only one-time-only before releasing to production and for that there is scripts/zip_static_files.py (meant to be run from shell as web2py.py -S yourapp -R scripts/zip_static_files.py). It creates automatically .gz files with the same mtime in order to be recognized as valid replacement by apache, nginx co. Standalone web2py serves automatically gz files in the static folder with the same mtime without any configuration at all (meaning that a request for /app/static/js/jquery.js as long as there is a /app/static/js/jquery.js.gz with the same mtime will serve the gzipped one automatically) --
[web2py] Re: Webassets in web2py
BTW, I actually DID mean coffeCup, It refers to the python module I referenced in my second post here: http://42coffeecups.com/ that page lends to something I can't trace to some source code doing that. I found only tddspry and django couchdb adapter and some sites they made in django. Googling around , this https://github.com/dsc/coffeecup is what are you pointing to, I think. As stated clearly in the readme *CoffeeCup depends on CoffeeScript, which depends on node.jshttp://nodejs.org .* Sorry. --
[web2py] Re: Webassets in web2py
And/Or this one: http://42coffeecups.com/ On Sunday, December 16, 2012 1:57:19 PM UTC+2, Arnon Marcus wrote: Any thoughts on this? http://elsdoerfer.name/docs/webassets/index.html Has anybody tried integrating it in web2py? Should it be included in it's future releases? How should one approach using it in development/production with web2py? How could files be auto-compiled-on-save by this, via web2py's server while developing? --
[web2py] Re: Webassets in web2py
Static asset management is already integrated in web2py and it is much easier to use than those libraries. ;-) Thanks to Niphlod for that: http://web2py.com/books/default/chapter/29/04?search=static+asset#Static-asset-management On Sunday, 16 December 2012 08:04:55 UTC-6, Arnon Marcus wrote: And/Or this one: http://42coffeecups.com/ On Sunday, December 16, 2012 1:57:19 PM UTC+2, Arnon Marcus wrote: Any thoughts on this? http://elsdoerfer.name/docs/webassets/index.html Has anybody tried integrating it in web2py? Should it be included in it's future releases? How should one approach using it in development/production with web2py? How could files be auto-compiled-on-save by this, via web2py's server while developing? --
[web2py] Re: Webassets in web2py
10x Massimo - That's good to know. But this actually has very little to do with what I suggested... :) It's good to know that we can have this control over our static-files browser-reloading. But these libraries don't do (just) that... They are for compiling / transpiling/ processing CoffeScript into JavaScript and SASS/SCSS/LESS files into CSS files. On Sunday, December 16, 2012 6:40:34 AM UTC-8, Massimo Di Pierro wrote: Static asset management is already integrated in web2py and it is much easier to use than those libraries. ;-) Thanks to Niphlod for that: http://web2py.com/books/default/chapter/29/04?search=static+asset#Static-asset-management On Sunday, 16 December 2012 08:04:55 UTC-6, Arnon Marcus wrote: And/Or this one: http://42coffeecups.com/ On Sunday, December 16, 2012 1:57:19 PM UTC+2, Arnon Marcus wrote: Any thoughts on this? http://elsdoerfer.name/docs/webassets/index.html Has anybody tried integrating it in web2py? Should it be included in it's future releases? How should one approach using it in development/production with web2py? How could files be auto-compiled-on-save by this, via web2py's server while developing? --
[web2py] Re: Webassets in web2py
I'll try to explain why web2py integrates some features and why others are left alone There is mch going on web development since more or less html5 was presented. A lot of libraries, frameworks, js development, etc gained much more attention also because html5 coincided with mobile devices spreading, node.js that turned javascript in a full featured programming language (i.e. not just for do nice things on UI in the html page), etc etc. Unfortunately, this means that the dark side of html development - that was really going to be reduced at that time (most of it was due to browsers inconsistencies, like IE) - actually enlarged because of some limitations imposed by all those new things (portable devices, small cpu power, minimalist css themes, media queries, different templates, conditional resource loading, etc etc etc). Just to make an example: 2 or 3 years ago if you asked for replies on a question like should I use a single javascript file or 15 different small ones? the reply would be 90% of the cases, use a single one. That is because older browser fetched one resource at a time, serially. Lots of minification,precompressing,precompiling optimizers were released to the public. Ask that question now: you'll receive very different answers e.g. let's assume you were developing a website that expected a lot of traffic from iPad... until ios 4.0, the maximum cached size of an asset was ~25 kb. On the other hand, almost every browser now fetch the resource asynchronously, i.e. it's far speedier to use 15 small files than a single one. There are resource loaders (require.js, yepnope.js, head.js, lab.js, etc etc etc) that can speed up things on all platforms in terms of resource loading. You can see how a single right development mode is not feasible(was going to a few years ago, but not anymore). However, leaving out precompilers, web2py lets you a great deal of flexibility with response.files, response.static_version, response.minify_css and response.minify_js. Precompilers are a different beast: they are needed for leveraging other languages DSL to something that ends up being a css or a js file. Most of them give you the possibility to do that conversion right in the user's browser (coffeescript and less to say the most famous), and that's the way to go for development. However, the scaffolding app doesn't include any of those because users facing web2py are generally new in the html world and those frameworks add a layer of complexity that it's not needed in the majority of the cases. Given that precompilers are meant to be used just before going to production, a runtime option included by default in web2py it's not really smart (performance-wise). Why on hell would someone wants web2py checking at every request if files have been precompiled or not ? That's an operation meant to be done one-time-only ^_^ Summary: If needed, I'd see much more sense in a contrib module, or a script, ready to be launched as web2py.py -S yourapp -R scripts/compilemymodules.py to expose precompilers functionality. On Sunday, December 16, 2012 9:08:46 PM UTC+1, Arnon Marcus wrote: 10x Massimo - That's good to know. But this actually has very little to do with what I suggested... :) It's good to know that we can have this control over our static-files browser-reloading. But these libraries don't do (just) that... They are for compiling / transpiling/ processing CoffeScript into JavaScript and SASS/SCSS/LESS files into CSS files. On Sunday, December 16, 2012 6:40:34 AM UTC-8, Massimo Di Pierro wrote: Static asset management is already integrated in web2py and it is much easier to use than those libraries. ;-) Thanks to Niphlod for that: http://web2py.com/books/default/chapter/29/04?search=static+asset#Static-asset-management On Sunday, 16 December 2012 08:04:55 UTC-6, Arnon Marcus wrote: And/Or this one: http://42coffeecups.com/ On Sunday, December 16, 2012 1:57:19 PM UTC+2, Arnon Marcus wrote: Any thoughts on this? http://elsdoerfer.name/docs/webassets/index.html Has anybody tried integrating it in web2py? Should it be included in it's future releases? How should one approach using it in development/production with web2py? How could files be auto-compiled-on-save by this, via web2py's server while developing? --
[web2py] Re: Webassets in web2py
10 for the long and detailed answer. Couple of things: 1. I've been using web2py in production in my workplace for almost 3 years now, and admire tha hell outa it. That said, it's not a 'toy' for me. It's a workplace-production tool, and I treat it as such. I appreciate web2py's origins and main vision of Massimo for it to facilitate learning for kids and simplifying and streamlining the learning-curve for building web-apps. I'm with him all the way (and then some...) regarding kids learning to program. However, when it comes to my own production work, I expect it to be there for me just as much. I can, by all means, run node.json all the my dev machines, and even on some server for CI stuff (testing, build-processes, reporting, etc.). I just thought that with these python modules integrated, some of that work could also be streamlined and integrated. Say, integrate it with web2py's existing cron and/or the job-queue stuff. 2. Obviously I didn't think that transpiling in the production-environment server is a good idea. But from what I gather, it's not an either/or scenario... Some aspects are better done on the (local) server in development-mode, even though it's theoretically possible to do it on the client. I know how to use less.js and coffescript.js, but many say that it's a bad idea, especially for debugging. Tools integration may solve some of that, for example, having your coffeescript watched (auto-compiled-on-save) in your IDE, may have additional js-lintingbenefits on-the-fly. The transpiler itself is a form of 'lint'er as it can detect syntax errors that are only detectable in transpiling-time. Having a browser-extension for debugging DSLs is also an exciting possibility, but were not quite there yet, afaik. In any case, having DSL files 'watched', is an important asset to have in development, and it's a complementary-feature to and not a substitution for the browser-reload feature (that is solved nicely by web2py's static-assets). In fact, browser-auto-reload functionality already exists as browser-extension (at least for chrome), and it wouldn't work very well, I guess, without static-assets. But what I mean is, I think that in the long run, I should not be expected to tun 2 different servers on every dev-machine, just for transpiling, especially when there are these python modules just standing there mocking me... :) --
[web2py] Re: Webassets in web2py
And in that regard, on a more general sense, I think web2py could use a notion of dev-vs-production modes. I know many people would implement things differently, but I think that if this be a core functionality, different modules could be used for different modes. What we ended up doing, is qualifying the system's compute-name against a list of de-machine-names in the db model, for the same code to be usable in both dev and production machines. We use it for stuff like external-module-reloading on each request, which is essential for on-the-fly development. It's a retro-fit we should not have had to deal with, imho. We would have much rathered have web2py itself forcing a reload on any of our custom modules each time they changed, by (for example) deleting the .pyc files based on date-modified file-attributes or something of that sort. That can be easily be done as some kind of script-job that runs and checks a list of module files in a given folder for date-modifications and .pyc files existence, but only have it done in dev-mode. I think that static-assets should relate to that as well, but only in the context of dev-mode, which should exist anyway. --