For users who generate binary or non-HTML content, prerender_multi_page() is a bit heavyweight. For starters, it has "page" in the name, implying its intended usage for HTML pages. It also extracts annotations, builds entry points, and exports scripts and styles. If you are just generating images, none of this infrastructure is useful. fortunately Bazel is smart enough to not execute those tools if users don't depend on them, however it is still excess infrastructure, clutters the dependency graph, and generally obfuscates the actual build.
As an alternative for such use cases, I'm thinking of prerender_raw_resources(), which is effectively a direct invocation of the renderer tool. It will invoke user code to generate a directory and stop there. No annotations are extracted, no entry points generated, no scripts or styles exported. This would enable users to leverage the renderer independently of other rules_prerender infrastructure. It would also be most useful for cases where extract_single_resources() is used, since it would likely be extracting from an unbundled directory where none of the other outputs of prerender_multi_page() are useful.
For users who generate binary or non-HTML content,
prerender_multi_page()
is a bit heavyweight. For starters, it has "page" in the name, implying its intended usage for HTML pages. It also extracts annotations, builds entry points, and exports scripts and styles. If you are just generating images, none of this infrastructure is useful. fortunately Bazel is smart enough to not execute those tools if users don't depend on them, however it is still excess infrastructure, clutters the dependency graph, and generally obfuscates the actual build.As an alternative for such use cases, I'm thinking of
prerender_raw_resources()
, which is effectively a direct invocation of the renderer tool. It will invoke user code to generate a directory and stop there. No annotations are extracted, no entry points generated, no scripts or styles exported. This would enable users to leverage the renderer independently of otherrules_prerender
infrastructure. It would also be most useful for cases whereextract_single_resources()
is used, since it would likely be extracting from an unbundled directory where none of the other outputs ofprerender_multi_page()
are useful.