Developer Roadmap: API Clarity and Renderer
Stability
This 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 (
flextable or 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.
Phase 3: Deprecation policy and migration
- Keep wrapper stable for beginners.
- Mark low-level transitions with soft deprecation warnings.
- Provide migration examples in release notes.
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
- 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
Design Reference
For design language and contributor guardrails, see
DESIGN_PHILOSOPHY.md in the repository root.