Skip to content
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

standardize interface for reporting dependencies of each file #38

Open
notslang opened this issue Jul 8, 2014 · 4 comments
Open

standardize interface for reporting dependencies of each file #38

notslang opened this issue Jul 8, 2014 · 4 comments
Labels

Comments

@notslang
Copy link
Contributor

notslang commented Jul 8, 2014

This will be useful in the future for telling what files affect the output of a given file. Jade already has some basic reporting for this that we could make available through an interface like this.

@notslang
Copy link
Contributor Author

In order to do this, I feel like the compile/render functions (in the adapters, not the base adapter) would need to return a promise for an object, rather than a promise for a string. And in that object we would have properties like deps (for the dependencies that are detected), and result (for the string that would normally be returned by the promise)

Thoughts on a better interface than this?

@jescalan
Copy link
Owner

Hmm, would it be possible to make a separate call to grab the dependencies? I feel like that would be a much better interface, but I am afraid that either not every compiler would support this and/or if they did it would mean a double compile...

@notslang
Copy link
Contributor Author

Nope - the dependencies are detected during the compilation. No compilers support getting deps through a separate method. However, I ended up putting the deps in the jobLog, so we don't need to change the return value of the promise. That way, we'd have something listening to the jobLog, and every time a new compile is done it would update the recorded deps with the value from the newest entry in the debug log.

@jescalan
Copy link
Owner

I think this can be merged with the logging?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants