0.5.0 is the first element quality release, covering every A, B and C element. Components rebuild cleanly when moved or re-populated, keyboard and screen-reader access is fixed across the C components, and several XSS paths are closed. Themes gain a --btn-border-width hook,…
VB's JSON fetch layer: components call endpoints by role, and one configure() call points every role at your backend. Available as window.VB.service and as a named export.
VBService is how VB components talk to servers. A component asks for a role (notify, email, newsletter); VBService turns the role into a URL. By default every role lives under /go/, and one configure() call moves any of them to your own backend.
Getting it
Global or import
// Any page that loads Vanilla BreezeVB.service.configure({ baseUrl: '/api' });// Or as a moduleimport { VBService, VBServiceError } from'vanilla-breeze/js'; // also exported by core-js
Configuration is shared by every bundled copy, including the ones inside autoloaded components, so configure once, early, before components fetch.
Pointing VB at your backend
Before components load their data
<scripttype="module">VB.service.configure({baseUrl: '/api', // notify → /api/notifyheaders: { 'X-App': 'shop' }, // sent with every requestservices: { email: 'https://mail.example.com/v1' } // one role elsewhere });</script>
How a role becomes a URL
services[role], if set (trailing slash removed).
Otherwise {baseUrl}/{role}. The default baseUrl is /go.
configure() merges: unspecified options keep their values, and headers and services are merged key by key. VB.service.resolve('notify') shows the URL a role resolves to.
Paths are relative to the role's URL; a missing leading slash is added. Query parameters with null or undefined values are dropped.
Bodies are sent as JSON with content-type: application/json.
The resolved value is the parsed JSON when the response is application/json, otherwise the response text.
Errors
Any non-2xx response rejects with a VBServiceError carrying status, body (parsed like a success), role and path. Network failures reject with the browser's own error.