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

generated docs for flutter plugins also include the dart: docs #1431

Closed
devoncarew opened this issue May 18, 2017 · 19 comments
Closed

generated docs for flutter plugins also include the dart: docs #1431

devoncarew opened this issue May 18, 2017 · 19 comments
Labels
customer-flutter Issues originating from important to Flutter P2 A bug or feature request we're likely to work on

Comments

@devoncarew
Copy link
Member

See https://www.dartdocs.org/documentation/url_launcher/0.4.1/ for an example.

@devoncarew devoncarew added customer-flutter Issues originating from important to Flutter P1 A high priority bug; for example, a single project is unusable or has many test failures labels May 18, 2017
@jcollins-g
Copy link
Contributor

jcollins-g commented May 18, 2017

This is a dartdocs.org bug, but exactly what sort of dartdocs.org bug is not clear to me.

My guess is this probably has something to do with flutter shipping their own SDK and dartdocs.org not excluding the flutter SDK explicitly on the commandline (or incorrectly including it).

@jcollins-g
Copy link
Contributor

The inclusion of dart:ui in the generated docs would seem to confirm this hypothesis.

@jcollins-g
Copy link
Contributor

https://www.dartdocs.org/documentation/url_launcher/0.4.1/log.txt

The log suggests dartdoc is not recognizing that the flutter SDK isn't part of the package. But why isn't quite as clear.

@mit-mit
Copy link
Member

mit-mit commented May 18, 2017

@jcollins-g in case you need a local repro, these steps work for me:

git clone https://github.com/flutter/plugins.git
cd plugins/packages/url_launcher/
export FLUTTER_ROOT=<path to where you have flutter>/flutter
dartdoc

@mit-mit
Copy link
Member

mit-mit commented May 22, 2017

Any news @jcollins-g?

@jcollins-g
Copy link
Contributor

I can reproduce it and am working on a set of command line flags for you to use to work around while I come up with a more permanent fix.

@jcollins-g
Copy link
Contributor

@mit-mit work around with the following command line flag:

--exclude dart.collection,dart.math,dart.core,dart.developer,dart.io,dart.ui,dart.isolate,dart.convert,dart.async,dart.typed_data

This will be safe to use with and without the real fix to this problem.

@jcollins-g jcollins-g added P2 A bug or feature request we're likely to work on and removed P1 A high priority bug; for example, a single project is unusable or has many test failures labels May 22, 2017
@jcollins-g
Copy link
Contributor

demoting to P2 since there is a workaround, but will still try to get this fixed soon.

@jcollins-g
Copy link
Contributor

This is no longer needed at head; SDK calculation is now smart enough not to try to include the SDK components in flutter plugins.

jcollins-g added a commit that referenced this issue Dec 12, 2018
jcollins-g added a commit that referenced this issue Dec 12, 2018
* Enable flutter plugin test

* Plugin makes flutter check take longer again

* Add workaround for #1431 and use update-packages to make sure Flutter is ready to go before building docs

* flag in wrong place

* dartfmt
@devxpy
Copy link

devxpy commented Jan 20, 2019

@jcollins-g Does this fix $ dartdoc trying to parse a whole bunch of files, unrelated to my flutter app?

output.txt

@devxpy
Copy link

devxpy commented Feb 5, 2019

@jcollins-g That workaround doesn't work for me. It's still parsing a whole bunch of files, that are outside the lib/ directory of my project!

@jcollins-g
Copy link
Contributor

Hi @devxpy,

dartdoc parses all files in all packages reachable via the import-export tree of your project (this issue was that sometimes we thought we needed to document some of them when that was inappropriate) and this is expected behavior. It needs to do this because of the way dartdoc's macros and comment reference scoping works, though it probably could be optimized to only do this on demand.

If it is generating docs for things it should not be though, either this or another bug would be appropriate to open.

@devxpy
Copy link

devxpy commented Feb 5, 2019

though it probably could be optimized to only do this on demand.

The current mechanism doesn't cache things?
Because it currently parses everything again, which takes an absurdly long amount of time, for a relatively small application.

@jcollins-g
Copy link
Contributor

@devxpy

Sadly, no, it does not cache and indeed therefore does take an absurdly long amount of time. I have had some ideas on how to improve that, but performance for dartdoc has not been a high enough priority to be able to allocate the time.

@jcollins-g
Copy link
Contributor

jcollins-g commented Feb 5, 2019

@devxpy To expand very briefly, caching is not straightforward for dartdoc as a change in seemingly unrelated files can impact the documentation generated for another file. This is due to the global scope macros and some comment references can have as well as dartdoc's public interface canonicalization. A design to fix this will either have some heuristics to eliminate those problems in common cases, or we can change some of our scoping rules and then adopt the analysis server's strategy of targeted invalidations when changes are detected. Not a trivial amount of work in either case (though certainly not impossible)

@devxpy
Copy link

devxpy commented Feb 5, 2019

Thank you for the detailed explanation!

@devxpy
Copy link

devxpy commented Feb 5, 2019

@jcollins-g Would a file-watcher based "hot-reloading" compiler take a similar amount of effort?

@jcollins-g
Copy link
Contributor

jcollins-g commented Feb 5, 2019

@devxpy Indeed, I would say even more effort. There's a team of folks doing something like that at https://github.com/dart-lang/build, and Flutter of course has hot reloading support.

jcollins-g added a commit that referenced this issue Oct 13, 2020
jcollins-g added a commit that referenced this issue Oct 13, 2020
…king (#2387)

* remote linking flutter bug

* Fix dartfmt and class count test

* Remove workaround for #1431
@srawlins
Copy link
Member

Closing as the dart: docs are no longer being included with a flutter plugin's docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-flutter Issues originating from important to Flutter P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

5 participants