Skip to content

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 28 Jul 16:17
c3a612e

Published to npm as customdomain-js@0.4.0 and @customdomain/react@0.4.0, with provenance.

Published from c3a612e, tag v0.4.0. Everything here already existed in the monorepo and had
never reached npm; this release is the hand sync catching up. Source files were ported byte
identical.

Added

  • customdomain-js: CheckDomainResult carries the control plane's Public Suffix List parse
    of the checked domain: subdomain, registrableDomain, publicSuffix. These are the
    authoritative split, and exist so a client never has to guess one; the hand-maintained suffix
    lists they replaced produced wrong Domain Connect hosts and illegal root records on multi-label
    suffixes (.co.uk, .s3.amazonaws.com). subdomain is "" when the checked domain is the
    registrable root: a verdict, not a missing value, so test it with === "" rather than for
    falsiness.
  • customdomain-js: the rest of the pre-flight the server already returned but the type
    omitted: conflictTolerance, willFallbackToManual, apexSupported, apexMessage. All seven
    new fields are mapped from their snake_case wire names in checkDomain().
  • customdomain-js: WhiteLabel.fontUrl, a stylesheet URL loaded into the widget iframe so a
    self-hosted @font-face is available to the widget's Shadow DOM. The widget already consumed it
    and the SDK forwards whiteLabel whole, so it always worked at runtime; it was simply
    inexpressible in TypeScript without a cast.
  • @customdomain/react: the buy-a-domain rail, which was absent from this wrapper
    entirely
    while the SDK it wraps already dispatched customdomain:purchase. The
    PurchaseInitiated payload type is re-exported from the SDK, onPurchase is wired to the
    customdomain:purchase window event (previously dropped silently for every React consumer),
    and purchaseDomain() starts the flow. The last one is not a convenience: open() could not
    reach the buy screen at all, because the SDK gates it on a purchase flag that is not a member
    of OpenConfig.
  • Parity gates (both packages, type only): packages/sdk/src/whitelabel-parity.assert.ts
    asserts that every white-label key the widget reads is expressible on the SDK's WhiteLabel;
    packages/react/src/sdk-parity.assert.ts asserts that the React wrapper re-exports the SDK's
    purchase payload type and can both receive and start the purchase flow. They compile as part of
    each package's build, so a surface that drifts out of sync fails CI in the repo where publishing
    actually happens.
  • @customdomain/widget (private; reaches users as the hosted widget.js): a failed or timed
    out connection shows the reason the control plane recorded (error_code, error_message)
    instead of generic timeout copy, falling back to that copy when there is no message.

Changed

  • @customdomain/react: open() and the new purchaseDomain() share one sdkConfig()
    helper, and the wrapper-only callbacks (stripped before the config reaches the SDK so window
    events do not fire twice) live in a named WRAPPER_ONLY_KEYS constant. No behavior change to
    open().

Known gap (closed in 0.5.0)

  • The React README in this repo did not document onPurchase or purchaseDomain().

Full changelog: CHANGELOG.md · Diff: v0.3.0...v0.4.0