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

deprecate and remove standalone dartdoc tool #44610

Closed
2 of 3 tasks
jcollins-g opened this issue Jan 7, 2021 · 20 comments
Closed
2 of 3 tasks

deprecate and remove standalone dartdoc tool #44610

jcollins-g opened this issue Jan 7, 2021 · 20 comments
Assignees
Labels
area-build Use area-build for SDK build issues. area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. deprecation P2 A bug or feature request we're likely to work on

Comments

@jcollins-g
Copy link
Contributor

jcollins-g commented Jan 7, 2021

The dartdoc tool needs to be removed as a standalone tool in the SDK.

Checklist:


Possible alternatives include:

1) Simply deprecating/deleting it and taking no further action, requiring users to use pub global activate dartdoc to install a package to document code. This is a straightforward approach that matches with recommended best practice for using dartdoc.
2) Deprecating the standalone tool, and replacing it with a wrapper inside dartdev that uses pub global activate internally to install dartdoc, then pass dartdoc the command line parameters.

3) Deprecating the standalone tool, and replacing it with a full version of dartdoc linked into dartdev as a library.

2 and 3 look largely the same to the user, 2 being more fragile and requiring network access but also more compact for SDK size.

My inclination is to go with option 1, funneling all users to the pub package.
edit: option 3 was chosen.

cc @mit-mit, @devoncarew, @bkonyi for input

@jcollins-g jcollins-g added area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. P2 A bug or feature request we're likely to work on labels Jan 7, 2021
@jcollins-g jcollins-g self-assigned this Jan 7, 2021
@jcollins-g jcollins-g added the area-build Use area-build for SDK build issues. label Jan 7, 2021
@jcollins-g
Copy link
Contributor Author

Adding area-build as well since dartdoc-in-the-SDK's most important user is the SDK build system itself.

@mit-mit
Copy link
Member

mit-mit commented Jan 8, 2021

My preference is option 3, which is what we're doing for other tools (dartfmt, analyzer, pub). I really like the consistency of that.

Yes, that has the disadvantage that it becomes a bit harder to use bleeding edge versions of dartdoc, as you have to wait for a roll, but looking at the global activate stats, I see less than 100 activates of dartdoc a week, which is a very small fraction of our overall user base.

@bkonyi
Copy link
Contributor

bkonyi commented Jan 11, 2021

+1 to option 3. We're trying our best to stay consistent and embed tooling into dartdev when it makes sense to. However, option 2 would allow for us to dynamically install dartdoc which has the nice property of not using extra disk space for users that never run the tool, which I think was an original goal for the CLI unification effort. Is that something we'd still be interesting in doing @mit-mit or did we shelve the idea for some particular reason?

@jcollins-g
Copy link
Contributor Author

+1 for consistency -- will go for option 3 then unless there's a strong reason to do otherwise.

@mit-mit
Copy link
Member

mit-mit commented Jan 12, 2021

the nice property of not using extra disk space for users that never run the tool, which I think was an original goal for the CLI unification effort

Yes, that is correct, but that was more in the context of very large and rarely used features; say downloading an 100MB linker for building a custom embedder, og something like that.

@mit-mit
Copy link
Member

mit-mit commented Aug 5, 2021

@jcollins-g is there a known timeline for this deprecation?

@jcollins-g
Copy link
Contributor Author

@mit-mit It is on the Q3 OKRs but not at a high priority (P2)

@jcollins-g jcollins-g removed their assignment Oct 14, 2021
@jcollins-g
Copy link
Contributor Author

Based on offline discussion, a proposed minimum list of command line parameters:

    --input                                       Path to source directory
                                                  (defaults to current working directory)
    --output                                      Path to output directory.
                                                  (defaults to "doc/api")
    --sdk-docs                                    Generate ONLY the docs for the Dart SDK.
    --[no-]validate-links                         Runs the built-in link checker to display Dart context aware warnings for broken links (slow)
                                                  (defaults to on)

You could use fork and exec, but I would suggest creating your own entry point modeled after https://github.com/dart-lang/dartdoc/blob/master/bin/dartdoc.dart. You might even be able to get dartdoc to handle help and all command line bits for you, at the expense of having a large surface area.

Let me know if you have any questions.

@mit-mit
Copy link
Member

mit-mit commented Oct 15, 2021

Thanks! What's the typical use for the --sdk-docs option? Is that something an app developer is likely to ever use?

@jcollins-g
Copy link
Contributor Author

The typical use for the sdk docs option is to generate documentation for the SDK. A developer will use that if they want to check or modify docs for the SDK itself. It could be omitted if you want, especially since the pub package still exists.

@mit-mit
Copy link
Member

mit-mit commented Oct 26, 2021

I've started working on this in this CL:
https://dart-review.googlesource.com/c/sdk/+/217980

I have a test issue I'm hunting down with @bkonyi, but other than that it's pretty much done. I've done just the basic arg parsing:

$ dart  doc --help
Generate HTML API documentation from Dart documentation comments.

Usage: dart doc [arguments] <input directory>
-h, --help                   Print this usage information.
-o, --output-dir             Output directory (defaults to "doc/api)
                             (defaults to "./doc/api")
    --[no-]validate-links    Display context aware warnings for broken links (slow)


@mit-mit
Copy link
Member

mit-mit commented Nov 26, 2021

@mit-mit mit-mit self-assigned this Nov 26, 2021
@bkonyi
Copy link
Contributor

bkonyi commented Nov 29, 2021

The new changes LGTM. I'm assuming there's corresponding changes in dart-lang/dartdoc (maybe dart-lang/dartdoc#2857?)

@mit-mit
Copy link
Member

mit-mit commented Nov 30, 2021

I'm assuming there's corresponding changes in dart-lang/dartdoc

You, that issue you're linking needs to land first, then we'll roll dartdoc, and then my CL should work.

copybara-service bot pushed a commit that referenced this issue Dec 1, 2021
Bug: #44610
Change-Id: Ieb17c588f66354c0af31cb510bc9cd8c9a4e3f61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221762
Reviewed-by: Michael Thomsen <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
@mit-mit
Copy link
Member

mit-mit commented Dec 6, 2021

The new dart doc command has landed via https://dart-review.googlesource.com/c/sdk/+/220744 and was manually tested and confirmed working on Linux, macOS, and Windows with a bleeding edge build from http://gsdview.appspot.com/dart-archive/channels/be/raw/latest/sdk/

copybara-service bot pushed a commit that referenced this issue Dec 6, 2021
Mark the `dartdoc` command as deprecated.
It's being replaced by the `dart doc` command.

Part of #44610

Change-Id: Ia0607cb53ef526388a749acb735fd6145149334e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221948
Reviewed-by: Samuel Rawlins <[email protected]>
Commit-Queue: Michael Thomsen <[email protected]>
@mit-mit
Copy link
Member

mit-mit commented Dec 6, 2021

@mit-mit
Copy link
Member

mit-mit commented Jan 25, 2022

@DanTup
Copy link
Collaborator

DanTup commented Jan 27, 2022

@mit-mit is it intended/expected that the input directory is mandatory using the new command (but wasn't before)?

danny@Dannys-MacBook-Pro hello_world % ~/Dev/Dart\ SDKs/stable/bin/dartdoc 
Documenting hello_world...
-^C

danny@Dannys-MacBook-Pro hello_world % ~/Dev/Dart\ SDKs/nightly/bin/dart doc
Error: Input directory not specified

Usage: dart doc [arguments] <input directory>
-h, --help                   Print this usage information.
-o, --output-dir             Output directory
                             (defaults to "doc/api")
    --[no-]validate-links    Display context aware warnings for broken links (slow)

I noticed this while moving VS Code over. It's no bother for me to pass . (esp. since that works with both old and new) although it's more to type when invoking manually and seems like it could be inferred?

@mit-mit
Copy link
Member

mit-mit commented Jan 27, 2022

Yes, that is intentional. It was something we discussed a bit back and forth, and agreed to require given the command has a side effect that it changes the input directory (by writing a lot if files to it). This is consistent with the dart format command.

@DanTup
Copy link
Collaborator

DanTup commented Jan 27, 2022

Cool, just wanted to check it wasn't accidental. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-build Use area-build for SDK build issues. area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. deprecation P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

4 participants