Currently, there is no way in prerender_*() rules to read runfiles, as there is no way to depend on them. We should add a data attribute to allow users to depend on raw data files (like markdown) and then read and process those files as part of the prerendering process.
The most obvious implementation here is to just pass through the data field to the underlying ts_library() rule. However, ts_project() does not appear to have a data attribute, so migrating to ts_project() might cause problems here. I'm curious why this attribute does not exist for ts_project() but I couldn't find any documentation or justification about it. I posted on the Bazel Slack community to see if anyone has more background information. There may be more information here about issues they encountered with ts_library() which could inform our implementation for rules_prerender.
Just merged in two commits adding a data attribute to all the prerender_*() macros as well as an example that exercises it. This mostly aligns with its existing documentation in the root README.
Currently, there is no way in
prerender_*()
rules to read runfiles, as there is no way to depend on them. We should add adata
attribute to allow users to depend on raw data files (like markdown) and then read and process those files as part of the prerendering process.The most obvious implementation here is to just pass through the
data
field to the underlyingts_library()
rule. However,ts_project()
does not appear to have adata
attribute, so migrating tots_project()
might cause problems here. I'm curious why this attribute does not exist forts_project()
but I couldn't find any documentation or justification about it. I posted on the Bazel Slack community to see if anyone has more background information. There may be more information here about issues they encountered withts_library()
which could inform our implementation forrules_prerender
.