-
Notifications
You must be signed in to change notification settings - Fork 118
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
Support incremental changes to doc #2341
Comments
I like the idea. This is a good proposal for a shorter turnaround on big projects like Flutter. |
While this seems like it would do something, docs do not have a one-to-one correlation with files (in many cases, it isn't even close to a one-to-one correlation). A truly live-updating or incremental documentation system will have to break away from dartdoc's current design need to understand and compute everything even before writing a file. |
Most doc is class-based in Dart, no ? If people structure their projects with regards to compile and doc optimization (ie. classes when necessary, and ideally in other distinct files), then it could work, but that would require core changes indeed... But if it works more like drawing a graph first -- also perfectly valid, maybe it could memorize/store graph states and just maybe update the relevant subtrees ? I'm pretty sure the time intensive task isn't the file I/O for the classes but the preceding step (I/O takes an acceptable 20-40s, but doc compilation takes north of 5 minutes) (again, just throwing out ideas, I actually don't know how it currently works, but could it stick with what @jcollins-g explained of dartdoc's functionality ?) |
@AtomicNicos Dartdoc's general strategy for the problem has evolved over time and isn't optimal, but it is closer to the graph case you alluded to. Very briefly, dartdoc's general strategy for generating docs is:
The way we do two and three is not optimal, because in many instances we're recalculating parts of the "graph" multiple times -- [ModelElement]s do not know about neighbor elements that are "more canonical" than they are, instead it calculates the direct route to the canonical element for each one. We also have to process a lot of data that is then discarded because of how macros and templates are defined, which is something we plan to change. A proper refactor to accomodate incremental updates would more directly allow for analysis elements being updated, and record enough data to know what parts of the graph need to be recomputed. A big project, I think. |
Reasons
Generating docs on large scale projects (ie. real world Flutter apps) takes time.
Proposal
Would it be possible to have an incremental doc system ? (on a file level, not necessarily a method level)
It would perhaps only generate docs for a file if the checksum of the file has changed, and delete docs for a file that does not exist. These checksums could be stored in a JSON file at
doc/api
, possibly following a file tree structure.This functionality could be flag dependent ie.
--incremental
for the incremental update and--invalidate
for deletion.The text was updated successfully, but these errors were encountered: