You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There were a few hoops to jump through to get it working, so your code pointers were really useful in tracking these down. Mostly it worked out quite easily (thankfully!).
Ideally, this could be included as an API function at requirejs.trace when running through node. It would be a very useful API. Let me know if you'd like a pull request for integration at all.
There are a couple of issues with the tracing process at the moment, particularly with reference to the onResourceLoad API:
Dependency maps for plugins are often provided unnormalized even though loading has completed. I had to manually check 'unnormalized' and then replace with prefix + '!' + name.
Tracing cs! modules means writing specific code to check if there is a cs! prefix and if so, trace dependencies for without the prefix by adding a dummy dependency. Ideally this would be sorted by having the defined ID as the full ID not the name when using load.fetchText.
Nested plugin calls (a!b!module/name) still don't normalize into the depth of the call, meaning traces aren't possible on any module which is a plugin of a plugin. This is probably a tricky one. The only use case I can see this affecting is with calls like is!mobile?cs!mobile-code. That might cause issues later when this is actually attempted, but for now it isn't too much of a critical use case.
Thanks! Will put this in the 2.1.5 bin, but may get bumped later depending on anything pressing for 2.1.5. No plans to do a 2.1.5 release yet though, I expect at least a month's time.
Activity
jrburke commentedon Jan 28, 2013
Thanks! Will put this in the 2.1.5 bin, but may get bumped later depending on anything pressing for 2.1.5. No plans to do a 2.1.5 release yet though, I expect at least a month's time.