Closed webpro closed 10 years ago
Hey @webpro,
For better or worse, curl.js tries to fetch dependencies as soon as possible. AMD does not specify when dependencies should be fetched or when the factory function should be executed. Therefore, in the early days I decided to make curl.js do things as soon as possible. This made a huge difference in our development cycles when using IE (orders of magnitude performance difference on our large project).
curl needs to know the current module's ID before it can correctly normalize dependencies. Therefore, if it knows the id in advance, then it fetches the dependencies immediately.
As I've been rewriting curl (or its successor?), I've been careful to only do things just-in-time. This makes the code simpler and avoids some tricky situations. Are you having a specific issue caused by curl's "eager" fetching?
-- John
Thanks for the detailed clarification.
For instance, the following
define()
is "just" a definition (as expected).Yet this named module immediately tries to resolve/fetch "bar":