dgp1130 / rules_prerender

A Bazel rule set for prerending HTML pages.
13 stars 0 forks source link

`data` attribute #24

Closed dgp1130 closed 3 years ago

dgp1130 commented 3 years ago

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.

dgp1130 commented 3 years ago

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.