As discussed with @rviscomi, we should have a frontmatter option to keep a guide out of dist without deleting it from the repo.
Example use cases
- Drafts. We already have stubs in the repo, and drafts are essentially intermediate states between a stub and a full guide. While they could be technically developed in a PR that just doesn't get merged until the guide is done, it's typically easier to iterate with smaller PRs.
- Unpublish If serious issues are found with an existing guide we may want to temporarily remove the guide from dist until we fix the issues. We should not need to remove the guide to do that.
- Retired A guide that is no longer needed, as it was not offering uplift. We may not want to remove the guide, e.g. the use case may later become relevant again, as a new feature gets added to the platform.
- Future: A guide that is currently premature, e.g. authored in anticipation of shipping one or more upcoming features, or depending on other guides that are currently drafts. This is distinct from Draft: draft describes the guide content, Future depends on the environment.
- Regression hold for evals that dropped below threshold, withheld until fixed. Could even be set automatically.
This could also replace the hardcoded excludeFromBundling list (though I believe it's currently empty).
- Regression hold — evals dropped below threshold, auto-withheld until fixed. This could even be automatically set.
This could also help us get rid of the current hardcoded excludeFromBundling list (although I believe the list is empty).
API / Naming
The main design question is binary publish toggle vs an enum that distinguishes the cases above?
For a binary toggle:
draft: true is common, but only covers one kind of hiding.
publish: false covers all of them, but booleans defaulting to true are discouraged — and avoiding that leads to double negatives like hidden: true.
An enum (e.g. status) adds some cognitive overhead, but enables smarter handling: a future guide can relax web-feature-id validation, a draft can skip it entirely, a regression-held guide can keep running in evals and flip back to published when uplift recovers, and diagnostics can flag guides stuck in draft too long. And frontmatter is all keywords anyway — true/false are keywords you type too.
Proposal: status: draft (with room for more values later). Covers the case that prompted this, and grows naturally into the rest. Or, we can even add values for (some of) the statuses above too and just handle them identically at first.
As discussed with @rviscomi, we should have a frontmatter option to keep a guide out of dist without deleting it from the repo.
Example use cases
This could also replace the hardcoded
excludeFromBundlinglist (though I believe it's currently empty).This could also help us get rid of the current hardcoded
excludeFromBundlinglist (although I believe the list is empty).API / Naming
The main design question is binary publish toggle vs an enum that distinguishes the cases above?
For a binary toggle:
draft: trueis common, but only covers one kind of hiding.publish: falsecovers all of them, but booleans defaulting totrueare discouraged — and avoiding that leads to double negatives likehidden: true.An enum (e.g.
status) adds some cognitive overhead, but enables smarter handling: afutureguide can relax web-feature-id validation, adraftcan skip it entirely, aregression-heldguide can keep running in evals and flip back to published when uplift recovers, and diagnostics can flag guides stuck indrafttoo long. And frontmatter is all keywords anyway —true/falseare keywords you type too.Proposal:
status: draft(with room for more values later). Covers the case that prompted this, and grows naturally into the rest. Or, we can even add values for (some of) the statuses above too and just handle them identically at first.