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

request: add watch task to only compile diffs #3

Open
psyrendust opened this issue Mar 6, 2017 · 1 comment
Open

request: add watch task to only compile diffs #3

psyrendust opened this issue Mar 6, 2017 · 1 comment

Comments

@psyrendust
Copy link

One of the things I kinda dislike about esdoc, was that if you were running your own watch task on your source and you make a single doc change, esdoc would have to run on the entire code base again to generate the documentation.

It would be great if it was possible to have a watch task that would only run on the diff changes. This would be a great addition if you are in documentation writing mode.

@psyrendust psyrendust changed the title request: only compile diffs request: add watch task to only compile diffs Mar 6, 2017
@typhonrt
Copy link
Member

typhonrt commented Mar 7, 2017

Hi @psyrendust... Welcome! Indeed this is an interesting and challenging feature to implement, but one that is worthy as it further hardens the runtime. It also shows off the flexibility of the architecture of TJSDoc which is internally highly modular and eventbus based. The watcher functionality will actually be implemented as a plugin. I already have added in several commits to support keep alive functionality and have a proof of concept plugin implementation that generates doc data for any updated files and gracefully handles parser / doc tag processing errors for incomplete updates.

The next step is to work out the merging / resolution logic as to generate docs for a project it's necessary to merge new data with the existing complete set of project data already parsed. The plugin basically works by TJSDoc making a complete pass then in the onComplete plugin callback a keep alive flag is set and file watching enabled by gaze. The cool thing is that TJSDoc already works internally using source globs, so it smoothly works with gaze and should support addition / deletion of files eventually as well (again just the merging / resolution logic to work out).

You can check out the initial proof of concept plugin code here. I'm pretty excited as it should take around ~3-5 seconds to do live updates to individual files once complete. It should be noted that this plugin is really for development / rapid documentation prototyping with the default doc templates. IE there is no easy way to let most other plugins in on the regeneration action though some publisher specific plugins should work as long as they don't rely on any data gathered during the process of a complete normal execution of TJSDoc. As a standalone plugin for rapid doc prototyping though it should work out well.

I feel pretty confident in getting a fully working solution tomorrow for changes.. Additions & deletions may be a bit dicier.

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

No branches or pull requests

2 participants