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

Use Mustachio AOT compiler for default templates #2677

Merged
merged 8 commits into from Jun 21, 2021

Conversation

srawlins
Copy link
Member

This is a pretty big change; here goes:

  • Contains the content of Fix runtime renderers rendering of certain sections #2674 and Escape variable renders in runtime renderer #2676
  • SidebarGenerator is much simplified; only takes a render function, not a Template object, which is only used in runtime renderers.
  • Add blank lines in generated AOT renderer files which correct the whitespace of the output. 800 newlines in one file!
  • templates.dart is viciously refactored; the diff is not really meaningful, maybe just new content is meaningful:
    • explicit list of partials is no longer needed; partials are eagerly parsed in both the Runtime renderers and the AOT renderers.
    • TemplatesLoader classes also not needed.
    • Templates class wildly refactored; instead of containing Template objects (only needed by the Runtime renderers; in AOT, the AOT render Dart code is in effect the parsed Template itself), it contains a dozen or so render functions.
    • Templates.fromContext now picks an subtype of Templates based on format ('html', 'md') and on presence of a templatesDir option.
  • Dartdoc.generator is made not final purely so that we can test two generators on one Dartdoc; this saves ~20 seconds in testing.
  • New renderers_output_test.dart generates HTML docs for a package using the AOT renderers (default) and the runtime renderers (forced), then walks the output trees of each result, comparing them, and making sure they generate the exact same bytes.

@google-cla google-cla bot added the cla: yes Google CLA check succeeded. label Jun 10, 2021
@srawlins srawlins force-pushed the aot-online branch 2 times, most recently from 58ac672 to ec57510 Compare June 11, 2021 22:46
@coveralls
Copy link

coveralls commented Jun 15, 2021

Coverage Status

Coverage increased (+8.0%) to 66.06% when pulling 2404875 on srawlins:aot-online into 58f7181 on dart-lang:master.

@srawlins srawlins requested a review from jcollins-g June 15, 2021 13:02
Copy link
Contributor

@jcollins-g jcollins-g left a comment

Choose a reason for hiding this comment

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

This is great! Also appreciate the precision in the comparison test, makes me much more comfortable switching this on!

@srawlins srawlins merged commit 20992ea into dart-lang:master Jun 21, 2021
@srawlins srawlins deleted the aot-online branch June 21, 2021 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants