[ 10 posts ]

kenjiru

  • Username: kenjiru
  • Joined: Mon Feb 20, 2012 6:25 am
  • Posts: 16
  • Location: Romania
  • GitHub: kenjiru
  • Gists: kenjiru
  • Offline
  • Profile

Skip build step during module development

Post Posted: Mon Aug 20, 2012 4:04 am
+0-
I'm looking for a way to skip the build step altogether during custom module development. It does not make sense for me to use ant (a Java application) in order to build the JavaScript modules when I only want to test some changes.

So, can I configure the loader to load the source files, without building anything? If not, is there another loader that can do this?

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: Skip build step during module development

Post Posted: Mon Aug 20, 2012 5:37 am
+0-
Loader can do this, but your source files are not in the proper format to load. They lack the required `YUI.add` wrapper call. If you add the YUI.add calls to your source files, then sure it can. But you will need to manually remove them before you build with builder.

kenjiru

  • Username: kenjiru
  • Joined: Mon Feb 20, 2012 6:25 am
  • Posts: 16
  • Location: Romania
  • GitHub: kenjiru
  • Gists: kenjiru
  • Offline
  • Profile
Tags:

Re: Skip build step during module development

Post Posted: Tue Aug 21, 2012 8:47 am
+0-
You mean I have to point the loader to the 'src' folder instead of the 'build' folder and write all my JavaScript into a single file, right? But that's unfortunate, because than I can't split my module code into different JavaScript files as required.

It would be nice if the loader could load both source and build files..

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile
Tags:

Re: Skip build step during module development

Post Posted: Tue Aug 21, 2012 10:42 am
+0-
Loader can, but your dev environment needs to be able to produce a valid module js file.

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: Skip build step during module development

Post Posted: Tue Aug 21, 2012 10:43 am
+0-
You should look at Shifter (http://github.com/davglass/shifter) it builds modules really fast compared to Builder.

Todd Smith

YUI Contributor

  • Username: stlsmiths
  • Joined: Thu Nov 05, 2009 10:03 am
  • Posts: 675
  • GitHub: stlsmiths
  • Gists: stlsmiths
  • IRC: t_smith
  • Offline
  • Profile

Re: Skip build step during module development

Post Posted: Tue Aug 21, 2012 12:10 pm
+0-
@kenjiru: If you don't want to have to rebuild and are simply testing modules you are developing, you can always use something like Dav described in this gist https://gist.github.com/1275713. Of course you can add custom css as a separate module with "type:'css'" in a module.

Juan Ignacio Dopazo

YUI Contributor

  • Username: jdopazo
  • Joined: Fri Oct 02, 2009 5:39 am
  • Posts: 619
  • Location: Buenos Aires, Argentina
  • Twitter: juandopazo
  • GitHub: juandopazo
  • Gists: juandopazo
  • Offline
  • Profile

Re: Skip build step during module development

Post Posted: Tue Aug 21, 2012 6:41 pm
+0-
davglass wrote:
You should look at Shifter (http://github.com/davglass/shifter) it builds modules really fast compared to Builder.

Love the --strict option!

kenjiru

  • Username: kenjiru
  • Joined: Mon Feb 20, 2012 6:25 am
  • Posts: 16
  • Location: Romania
  • GitHub: kenjiru
  • Gists: kenjiru
  • Offline
  • Profile

Re: Skip build step during module development

Post Posted: Mon Aug 27, 2012 1:24 am
+0-
Is not exactly what I meant, but Shifter looks way better than Builder, because it drops the Java requirement.

It would still be nice not to require any build step at all during development. The build process looks more like packing than building, as everything you need to run the application is already in the source folder.

@Todd Smith: I'm already doing this now, thank you for the advice.

Juan Ignacio Dopazo

YUI Contributor

  • Username: jdopazo
  • Joined: Fri Oct 02, 2009 5:39 am
  • Posts: 619
  • Location: Buenos Aires, Argentina
  • Twitter: juandopazo
  • GitHub: juandopazo
  • Gists: juandopazo
  • Offline
  • Profile

Re: Skip build step during module development

Post Posted: Mon Aug 27, 2012 5:27 am
+0-
davglass wrote:
You should look at Shifter (http://github.com/davglass/shifter) it builds modules really fast compared to Builder.

How fast is Shifter? Is the --watch mode faster than Alt+Tab + F5?


Last edited by jdopazo on Mon Aug 27, 2012 5:51 am, edited 1 time in total.

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: Skip build step during module development

Post Posted: Mon Aug 27, 2012 5:45 am
+0-
There is a difference between loading your raw source and loading a built module. Many module require more than one JS file in a certain order. Plus a module with a skin or a language pack needs a generated set of source files that are not the same as they are in the src directory.

Using shifter to build a module that is only one JS file is probably overboard, but if you have several JS files, skin, language files (and eventually pre-compiled templates) you are doing yourself a diservice by not building per change ;)
  [ 10 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum