[ 4 posts ]

Michael Hasenstein

  • Username: hasenstein
  • Joined: Fri Mar 20, 2009 7:22 am
  • Posts: 91
  • Location: Nuernberg, Germany
  • Offline
  • Profile

Use Loader in build process

Post Posted: Fri Jul 06, 2012 6:19 am
+0-
I understand and successfully use a version of

http://yuilibrary.com/yui/docs/yui/loader-resolve.html

for my own project. However, I don't want to have to add the dependency information for my own modules manually - because that's 151 modules (and growing) and changes more or less frequently.

A few months ago I looked into this for the first time, and I think I only found some Python script somewhere in YUI3 to calculate the meta-information the YUI3 loader uses to compute the dependencies.

Isn't there an easier way? Since I'm already running this node.js script, and since the modules are just JS functions, whose 4th argument is the module meta info object with the "requires" array... Sure, I could write something myself to iterate over all my JS files (YUI3 modules), run the YUI.add() function which I cleverly "captured", providing my own, only to get at the 4th parameter, and from there add module meta info manually to the loader.

But maybe someone has already done this (or sees an issue in my idea) - I'm terribly lazy :-)

Michael Hasenstein

  • Username: hasenstein
  • Joined: Fri Mar 20, 2009 7:22 am
  • Posts: 91
  • Location: Nuernberg, Germany
  • Offline
  • Profile
Tags:

Re: Use Loader in build process

Post Posted: Fri Jul 06, 2012 6:56 am
+0-
Never mind - I've done it myself already. Lazy or not, have to get this done :-)

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: Use Loader in build process

Post Posted: Fri Jul 06, 2012 7:04 am
+0-
If you can, you should share this script.

I recently re-wrote the python script in JS: https://github.com/yui/yui3/blob/master ... ta_join.js

My goal is to have a command line tool that does this and inspects local meta-data to generate a module with custom loader meta-data.

Michael Hasenstein

  • Username: hasenstein
  • Joined: Fri Mar 20, 2009 7:22 am
  • Posts: 91
  • Location: Nuernberg, Germany
  • Offline
  • Profile

Re: Use Loader in build process

Post Posted: Mon Jul 09, 2012 11:49 pm
+0-
Well, okay, here is a sample. Has lots of comments so no need to say anything else here.

http://pastebin.com/A2qSC35E


PS: I just filed ticket #2532498 for a severe issue, its currently assigned to you.
  [ 4 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