
Developer Roadmap: API Clarity and Renderer Stability
Source:vignettes/developer-roadmap.Rmd
developer-roadmap.RmdThis document is the implementation plan for keeping
easytable simple for beginners while making internals safer
for long-term maintenance.
Current State
easytable() currently does three jobs at once:
- Parse and transform model results.
- Render to output-specific objects (
flextableor LaTeX string). - Optionally write files (
export.word,export.csv).
This is convenient, but can be unclear for new users and harder to maintain.
API Rework Plan (Phased)
Phase 1: Keep behavior, improve clarity (current target)
- Keep
easytable()as main user entry point. - Improve parameter validation and friendly errors.
- Document side effects (
export.word,export.csv) explicitly.
Phase 2: Introduce explicit workflow functions
Add clearly separated helpers:
-
easytable_build():- takes models
- returns backend-agnostic table spec (display strings + style map)
-
easytable_render():- takes spec
- returns renderer object (
flextable, LaTeX)
-
easytable_export():- takes rendered object/spec
- writes files
easytable() remains a convenience wrapper that calls the
three steps.
Beginner Navigation Plan
Beginner path should always be:
- Fit models.
- Call
easytable(...). - Optionally add one argument at a time (
highlight,control.var,output, exports).
Avoid requiring beginners to understand renderer internals or object classes.
Renderer Adapter Contract
To reduce drift between Word/HTML and LaTeX:
- Core transformation must own row semantics:
- coefficient vs model-stat rows
- control indicator placement
- Core must own finalized display strings:
- estimate + stars +
(SE)line breaks
- estimate + stars +
- Renderers must only map style tokens to backend syntax.
External Dependency Change Strategy (example: flextable)
When dependencies evolve:
- Pin a compatibility floor in
DESCRIPTION. - Maintain adapter-focused tests in
tests/testthat. - Avoid deep reliance on undocumented object internals.
- Keep fallback behavior documented (for missing optional packages).
Compatibility Checklist for Releases
Before each release:
- Run core tests with
devtools::test(). - Run constrained profile:
EASYTABLE_SKIP_WORD_TESTS=true Rscript -e "devtools::test()"
- Spot-check parity on key invariants:
- two-line coefficient cells
- zebra only on coefficient rows
- one coefficient/stat divider