7. PrimeNG Lazy-Loaded and Bundle-Isolated from the Blog
Status
Accepted — 2026-02-21 (project inception)
Context
The site has two distinct surfaces: the public blog, which is content-first and visually bespoke, and a future tools area at /tools/* that needs interactive widgets (tables, dialogs, form controls) where building from scratch would be wasted effort. PrimeNG is the component library of choice for the tools surface. The default integration pattern — installing PrimeNG and importing components anywhere — would pull the library into the blog bundle and impose its visual opinions on routes that should look nothing like enterprise UI.
Decision
PrimeNG, when introduced, is restricted to lazy-loaded /tools/* routes and never imported by the blog module.
- The blog bundle ships zero PrimeNG. Blog readers do not download the library.
- Tool pages that need PrimeNG widgets load it through their lazy route boundary, isolating it to the tools chunk.
- Every PrimeNG component used is wrapped in a
jjk-*selector (<jjk-data-table>, not<p-table>in templates). Templates outside the wrapper never reference PrimeNG selectors directly. - This decision is currently a forward-looking constraint: no tool pages have migrated yet and PrimeNG is not in
package.json. The policy governs how it gets introduced when the first tool page lands.
Consequences
- The blog’s bundle size and visual identity are protected from a library that exists for a different purpose. The satirical aesthetic does not have to fight PrimeNG defaults.
- The wrapper layer (
jjk-*components around PrimeNG primitives) costs an extra file per widget but makes the underlying library a swappable implementation detail. Replacing PrimeNG with a different widget library would touch wrapper internals only. - Tool pages pay PrimeNG’s bundle cost; that is the right surface to pay it on.
- There is no automated enforcement preventing a future import of PrimeNG into the blog module. The constraint is held by reviewer discipline and (eventually) by an inspector or scout sweep.
- If the tools area never grows enough to justify PrimeNG, the policy costs nothing — it’s a gate that only activates on the first import.