angular/aio/tools/transforms/templates/api
George Kalpakas bdefeb1f11 perf(docs-infra): reduce unnecessary whitespace in API docs (#43435)
The HTML for the docs pages is generated by Dgeni based on some
[Nunjucks][1] templates.

Previously, these templates were set up in a way that introduced a lot
excess whitespace in the generated HTML, unnecessarily bloating the
corresponding JSON files that need to be downloaded in order to view a
certain docs page. This has been discussed in #28105 and was again
observed while investigating #43285.

This commit refactors some of the templates related to API docs (which
seem to be the most affected ones) to drastically reduce the amount of
excess whitespace. More specifically, the total size of all files in
`generated/docs/api/` was reduced from ~13MB to ~7MB.

Besides the reduced payload size for each API page, this change will
also reduce the amount of memory needed by the ServiceWorker to cache
the API pages that have been visited by a user.

NOTE:
The affected files are not eagerly downloaded when navigating to
angular.io. Instead, each file is downloaded individually, as soon as a
user visits the corresponding API docs page. Therefore, the impact of
this change will be relatively small for most users.

[1]: https://mozilla.github.io/nunjucks/

PR Close #43435
2021-09-14 08:29:50 -07:00
..
includes perf(docs-infra): reduce unnecessary whitespace in API docs (#43435) 2021-09-14 08:29:50 -07:00
lib perf(docs-infra): reduce unnecessary whitespace in API docs (#43435) 2021-09-14 08:29:50 -07:00
base.template.html perf(docs-infra): reduce unnecessary whitespace in API docs (#43435) 2021-09-14 08:29:50 -07:00
class.template.html perf(docs-infra): reduce unnecessary whitespace in API docs (#43435) 2021-09-14 08:29:50 -07:00
const.template.html build(aio): refactor API templates for clean start 2017-05-03 13:30:11 -07:00
decorator.template.html build(docs-infra): render optional decorator options with a ? (#39167) 2020-10-07 13:33:26 -07:00
directive.template.html perf(docs-infra): reduce unnecessary whitespace in API docs (#43435) 2021-09-14 08:29:50 -07:00
element.template.html feat(docs-infra): add support for "special elements" (#41299) 2021-06-16 14:01:16 -07:00
enum.template.html build(docs-infra): remove unused property table heading (#25768) 2018-10-01 09:36:34 -07:00
export-base.template.html perf(docs-infra): reduce unnecessary whitespace in API docs (#43435) 2021-09-14 08:29:50 -07:00
function.template.html build(aio): render param descriptions for function exports (#22534) 2018-03-05 10:12:55 -08:00
interface.template.html build(aio): add github links to API doc members (#24000) 2018-06-13 16:47:40 -07:00
let.template.html build(aio): refactor API templates for clean start 2017-05-03 13:30:11 -07:00
ngmodule.template.html build(docs-infra): associate providedIn injectables with their NgModule (#41960) 2021-05-10 10:28:30 -04:00
package.template.html feat(docs-infra): add support for "special elements" (#41299) 2021-06-16 14:01:16 -07:00
pipe.template.html build(aio): improve the API Pipe pages (#22702) 2018-03-14 14:21:11 -07:00
type-alias.template.html build(aio): fix various API rendering issues 2017-10-03 08:15:02 -07:00
value-module.template.html build(aio): refactor API templates for clean start 2017-05-03 13:30:11 -07:00
var.template.html fix(docs-infra): add deprecated-api-item class to remaining deprecated items (#34192) 2019-12-05 10:12:11 -08:00