dgp1130 / rules_prerender

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

Stop linking workspace root #49

Closed dgp1130 closed 2 years ago

dgp1130 commented 2 years ago

link_workspace_root = True is a bit of an antipattern. This appears to be going away in rules_js / rules_ts.

Instead, we should follow a model of:

This likely means I'll also need to rethink the publishing story and possibly move to a @rules_prerender/* package model, something I want to do anyways, but haven't really gotten around to.

Also see discussion in https://github.com/dgp1130/rules_prerender/issues/8.

dgp1130 commented 2 years ago

As part of https://github.com/dgp1130/rules_prerender/issues/50, I need to turn off link_workspace_root for a number of targets to avoid a conflict with package_name = "rules_prerender" in the declarative shadow DOM target. There's no easy path to fixing this conflict aside from dropping link_workspace_root everywhere.

Alternatively, we could rename the workspace to be a different name than rules_prerender, but given that link_workspace_root is going away in rules_js, I don't think this is a viable long term solution.

dgp1130 commented 2 years ago

Successfully removed link_workspace_root = True by converting all absolute imports to relative ones. Not elegant, but it's the minimal solution to this problem.

There are still two link_workspace_root = True usages with rollup_bundle(), but that's a different problem I can tackle separately. I think this is good enough to call it fixed.

I'll follow up on the more general project restructuring in https://github.com/dgp1130/rules_prerender/issues/51/.