Vanilla Breeze

Vanilla Breeze v0.5.0 released

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,…

Read the release notes

VBService

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

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

How a role becomes a URL

  1. services[role], if set (trailing slash removed).
  2. 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.

Making requests

  • 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.

Roles VB uses

RoleUsed byContract
notify<notification-wc> (when src is a role name), data-watch-pageService contracts
emaildata-vb-email-form
newsletterdata-vb-newsletter-form

A component given a full URL (for example <notification-wc src="/api/notify">) fetches it directly and skips role resolution.

Related

↑