-
Notifications
You must be signed in to change notification settings - Fork 74
AMD support #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AMD support #156
Conversation
@@ -22,23 +20,47 @@ function Builder( jqueryUi, components, options ) { | |||
} | |||
|
|||
Builder.prototype = { | |||
build: function() { | |||
build: function( callback ) { | |||
var cacheKey = this.jqueryUi.pkg.version + JSON.stringify( this.expandComponents( this.components ) ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sidenotes:
Builder#build was synchronous (the bundles were created by concatenating strings). Now, with requirejs, it gets async.
Initially, I've tried to avoid changing the workflow of Builder to be asynchronously. I came up with an idea of wrapping rjs output with an Stream (on rjs completion, it set the readable stream as readable) (it was using https://github.com/isaacs/readable-stream to support node 0.8). The idea worked just fine, because Builder could return an output synchronously, and the archiver (zipper) knew how to handle the asynchronous Stream data. Although, it turned out to be a problem for two reasons: (a) on certain places I needed to process the bundles (but, my own stream wrapper was able to chain those operations), (b) packer copies the same bundle into two different locations, when that happens both files reference the same data, after the first data is read by the zipper, the Stream drains out, when it tries to read the second file, the read gets stuck and thats a complicated problem to solve. I gave up and thought it was easier to change Builder to be async :P.
I had prepared the async change terrain with this previous commit 5c336d2.
@scottgonzalez @jzaefferer ready for review |
@@ -182,7 +149,8 @@ function Builder_1_11_0( build, jqueryUi, components, options ) { | |||
var slug; | |||
// Expand categories's pages and posts | |||
if ( (/\/category\//).test( doc ) ) { | |||
slug = path.basename( doc ); | |||
// TODO commit separately, replace is due to basename diff between node 0.8 and newer 0.10. 0.8 leaves trailing slash | |||
slug = path.basename( doc ).replace( /\/$/, "" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im fixing this...
Highlights:
|
…s instead of filesystem
- Also make rjs jquery path dynamic;
No description provided.