Skip to content
nexus-dialogs
GitHub npm

Architecture

What nexus-dialogs is, how it is divided and how well tested each piece is. The idea: whoever only needs a confirm loads the core and nothing else.

#Positioning

nexus-dialogs is an interaction infrastructure for business applications: it doesn't just notify and ask, it also captures data, guides multi-step processes, imports and exports, and brings what a Mexican administrative system needs (RFC, CURP, NSS, CLABE, HR templates). It has a SweetAlert2 adapter so you can migrate without rewriting, but it is not positioned as one more replacement for that library.

LibraryMain focus
SweetAlert2Alerts and dialogs
NotiflixNotifications and loaders
Tippy.jsTooltips and popovers
nexus-dialogsDialogs, forms and business flows

It is not a function-by-function comparison; it helps locate the space it occupies.

#The three levels

Each level can only import from the same level or a lower one. An automated test (test/unit/capas.test.ts) checks this on every change.

LevelWhat it includesSubpathsSize (min+gzip)
CoreAlerts, confirmations, prompt, dialog.open, variable-based themes, language, RTLnexus-dialogs~10 KB
Advanced UIForms and wizards, queued toasts, tables with selection, recipes (delete, approve, save…), ready-made themesforms, toast, table, patterns, themes0.9 – 23 KB each
BusinessHR templates, CSV/Excel import and export, Mexican validators and catalogsrrhh, import, mx, sepomex0.5 – 10 KB each
IntegrationsVue 3, React 18+, Angular 16+ and SweetAlert2 compatibilityvue, react, angular, swal0.8 – 7.5 KB each

mx is made of pure functions and also works in Node; sepomex only queries, with fetch, the folder of JSON files that you publish. Neither imports anything from the rest of the library. Each subpath is a separate file: if you don't import it, it isn't downloaded. Size limits are checked on every change (npm run size).

#What is validated and what is not

ThingStatus
Unit, edge-case and SSR testsAutomated on every change
E2E in Chromium, Firefox and WebKit with axeAutomated on every change
Contrast and keyboard per themeAutomated (6 theme and scheme combinations)
Installing the published package (Node ESM/CJS, TypeScript, Vite, webpack) and core tree-shakingAutomated
CSP (styles with and without nonce) and Trusted TypesAutomated in Chromium
Memory leaks (300 dialogs, forms and toasts)Automated in Chromium
Export without formula injectionAutomated, with local LibreOffice; Excel: not tested
Screen readers (NVDA, JAWS, VoiceOver, TalkBack)Pending: see Accessibility
Use in production applicationsTo be validated: the library is being tested inside Nexus; there is no public real-world case yet

If you use it in production and find something, tell us: that is the information we lack the most.

#Who each decision is for