Ticket #2532746 (closed defect)
Reporter J. Shirley |
Opened: 09/12/12 Last modified: 12/12/12 Status: closed Type: defect Resolution: fixed |
Owner Dav Glass |
Target Release: 3.7.0 Priority: P3 (normal) |
|---|---|---|---|
| Summary: | Loader changes for pr2 create infinite loop on server-side builds | ||
| Description: | I have a script that uses Loader under node.js to create a rollup file. The rollup file includes yui-base, which has it's own .add block: http://_Sgithub.com/yui/yui3/blob/3.x/build/yui-base/yui-base-debug.js#L5718 The changes to filterRequires http://_Sgithub.com/yui/yui3/blob/master/src/loader/js/loader.js#L1357 are causing this to spin into oblivion when I use this generated rollup file. This worked fine in pr1, and additionally a simple fix to not iterate into direct descendants got me up and running:
This is a pretty critical issue for me, but I'm hesitant to put it at anything other than S2. I'm on IRC and on twitter if you need any further details or want an example rollup file. |
||
| Type: | defect | Observed in Version: | 3.7.0pr2 |
| Component: | Loader | Severity: | S2 (high) |
| Assigned To: | Dav Glass | Target Release: | 3.7.0 |
| Location: | Library Code | Priority: | P3 (normal) |
| Tags: | Relates To: | ||
| Browsers: | N/A | ||
| URL: | |||
| Test Information: | |||
Change History
|
Posted: 09/12/12
|
|
Posted: 09/12/12
Two issues here: Can you revert your patch and change this line in yui-base:
to
And see if that fixes the issue as well? The second issue is the recursion that's a side effect of this build stamp.
|
|
Posted: 09/12/12
|
|
Posted: 09/12/12
|
|
Posted: 09/12/12
|
|
Posted: 09/12/12
I'm looking and working from at what is in the yui@3.7.0pr2 installed from npm (this is a result of using Loader under Node, generating a list of YUI dependencies and then creating a rollup). In node_modules/yui/yui-base/yui-base-debug.js, it already has (with yui-base in there): YUI.add('yui', function (Y, NAME) {}, '3.7.0pr2', {"use": ["yui-base", "get", "features", "intl-base", "yui-log", "yui-later"]}); What is happening now is that somewhere, yui-base has yui-base in it's use list when generating these files from node (I'm still trying to figure out exactly where). To give you a better idea of what my script is doing is to use Y.Loader under Node to generate a list of YUI dependencies for an application, this allows me to create a single rollup file for distribution under phonegap. If it's helpful, I can provide you with the full list of files in the build list that are being concatenated together for distribution. I'm working on a small repro case right now. |
|
Posted: 09/12/12
Just open the file under 'node_modules/yui/yui-base/yui-base-debug.js' and remove the "yui-base" from that line. Then test to make sure you are good. I've tested it locally and it works for me. The issue is the build.json file was declaring "yui-base" in it's config: Just wanting you to confirm that removing that fixes your issue. The loop is a separate issue that I patched already. |
|
Posted: 09/12/12
Oh - sorry, I was on my way out the door and was trying to get a repro case hastily and read your directions wrong. In my generated file, I edited the YUI.add('yui', ...) line and remove yui-base, but it still ends up in a situation with yui-base is depending on yui-base. Is there something there that I can inspect that could be more help in tracing it? I can also provide you with my generated build file if you want (don't want to attach it here, but can send it through private channels) |
|
Posted: 09/13/12
Ok, what was happening in my scenario was yui-nodejs/yui-nodejs*.js files also had that use line. I had to excise it from those files as well and now normalcy is returned. So I can confirm that removing yui-base from the .add('yui', ...) lines does work, provided you remove it from all the places. There's a meme in here somewhere... |
|
Posted: 09/13/12
Fixes #2532746 - kill the loop |
|
Posted: 12/12/12
|
Jenny Donnelly
Looking at this further I think my initial kneejerk reading was wrong. the add is for yui, not yui-base. I should learn to read.
I can confirm that using that patch is fixing my immediate issue, but it won't fix a higher level circular dependency issue.