Date: 2022-09-06
Pending
The FAC frontend needs to support some complicated interactions as well as binding DOM elements to data. It would be helpful to add a lightweight JavaScript library to make implementing these features easier without having to write this code ourselves from scratch.
We will use a combination of Eleventy's is-land plugin with Alpine JS.
- As a first-party plugin,
is-land
is well-supported by the Eleventy team, and makes it simple to add small pieces of interactivity/reactivity to isolated parts of a page according to the Islands Architecture pattern. - Alpine is a small library that:
- Works out of the box with
is-land
- Includes a lightweight frontend state-management solution the FAC can leverage without bringing in the complexity of a tool like Redux.
- Integrates easily into our existing templates and doesn't require creating separate JS-based components. This will let us keep content in YAML/markdown where it currently lives.
- Works out of the box with
- Future components will be able to leverage Alpine, requiring less custom JS.
- Adding
is-land
will allow the team to add other libraries on a page-by-page basis if needed.
Was previously ADR 0011; renamed/renumbered when PDRs and ADRs were merged.