-
Notifications
You must be signed in to change notification settings - Fork 664
Open
Milestone
Description
Thanks so much again for your help yesterday - I've managed to get a trace function working now!
The gist is at - https://gist.github.com/4635908
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 acs!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 likeis!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.
Metadata
Metadata
Assignees
Labels
No labels