Skip to content

Limit file count and total length in pkg/pub_dartdoc. #4765

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

Merged
merged 3 commits into from
May 4, 2021

Conversation

isoos
Copy link
Collaborator

@isoos isoos commented May 3, 2021

  • dartdoc runs too long - possible patterns dartdoc#2615
  • written files that are inside the output directory are kept in memory with a strict limit (10k files, 10MB total size)
  • this is a better approach than overriding only the DartdocFileWriter, as the later misses the static files that are copied directly
  • updated pub-dartdoc-data to use the same resource provider pattern
  • files are written to the disk at the end of the process

@isoos isoos requested a review from jonasfj May 3, 2021 16:24
@google-cla google-cla bot added the cla: yes label May 3, 2021

/// Creates an overlay file system with binary file support on top
/// of the input sources.
class PubResourceProvider implements ResourceProvider {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just create a proper overlay, instead of relying on output folder detection?

When writing we always write to _memoryResourceProvider, when reading we read from _memoryResourceProvider and if not present there, then we check: _defaultProvider.

I guess the complicated part is when listing folders, we'll need to wrap and merge them... But it would be less magic..

We can also leave that as a TODO... (I'm guessing we can almost just steal the overlay implementation from analyzer and binary file support to it, why not?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

@isoos isoos force-pushed the dartdoc-limits branch from 4d55fb7 to 0bea726 Compare May 4, 2021 11:57
@isoos isoos merged commit 09d2c42 into dart-lang:master May 4, 2021
@isoos isoos deleted the dartdoc-limits branch May 4, 2021 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants