Featurewise

The Featurewise UI shell

A web front end for featurewise services. It invokes features through each service's UI back end, shows whatever comes back, and follows the links in it. It knows nothing about any particular service, and that's enough to make one usable.

Here's a traveller's lost reports, in the lost property demo, as the shell shows them on its own:

The traveller's lost reports in the shell's generic renderer: the result laid out like JSON, with an "open" button for each link

Each service can then dress its own pages, a feature at a time, with a module of its own. The same result, dressed:

The same result, dressed: a card for the report, with a "Claim it" button

Every link is in the same place either way; only its presentation changed.

A service's module

A module is built from the service's features: an address for each query that wants one, and a renderer for each result, or each result case, worth dressing. Everything else is left to the shell.

npm install @featurewise/ui
import { featurewiseModule } from "@featurewise/ui";

const ui = featurewiseModule("lost-property", { home: "unclaimed-items" });
ui.addQuery("UnclaimedItems").address("unclaimed-items").render(unclaimedItems.result);
ui.addQuery("ItemsFoundAt").address("found-at/{Station}");
ui.addCommand("ClaimItem")
  .renderCase("Claimed", claimItem.Claimed)
  .renderCase("DoesntMatchReport", claimItem.DoesntMatchReport);
export default ui;

The shell is plain TypeScript with no framework, so a module can use any: the demos' are React. Modules never invoke anything themselves; they follow links, and the shell invokes them.

Getting it