@ulam/sawsawan
v0.3.0
Published
Integration bridge wiring taho, sili, calamansi, halohalo, and ube together.
Readme
@ulam/sawsawan
Integration bridge wiring ube and calamansi together. The dipping sauce of the ulam framework.
Named for sawsawan, the Filipino dipping sauce: no purpose alone, exists only to bring other things together.
Packages
Sawsawan is one of four ulam packages:
ulam
├── @ulam/ube sweet : UI, components, CSS, theming, router, announce
├── @ulam/calamansi sour : i18n, hooks, utilities, logic
└── @ulam/sawsawan bridge : wires the three together ← you are hereDependency rule
Sawsawan is the only package that imports from the others. None of them import from sawsawan or from each other.
ube ──────────┐
calamansi ────┴──► sawsawanResponsibilities
- Set
html[lang]when locale switches - Set
html[dir]for RTL locales - Wire
t()output intoannounce()on locale change
Usage
import { useSawsawan } from './sawsawan'
import { useT } from './calamansi'
function App() {
const [locale, setLocale] = useState('en')
const t = useT()
useSawsawan(locale, t, 'locale.switched')
return <AppShell />
}Why ube and calamansi do not depend on each other
announce() accepts any string: no knowledge of where it came from. t() returns any string: no knowledge of where it goes. The app or sawsawan wires them: announce(t('locale.switched')). Neither package knows the other exists. Integration is function composition at the call site, owned by sawsawan.
License
MIT
