Repository navigation
v0.4.0
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:CheckDomainResultcarries 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).subdomainis""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 incheckDomain().customdomain-js:WhiteLabel.fontUrl, a stylesheet URL loaded into the widget iframe so a
self-hosted@font-faceis available to the widget's Shadow DOM. The widget already consumed it
and the SDK forwardswhiteLabelwhole, 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 dispatchedcustomdomain:purchase. The
PurchaseInitiatedpayload type is re-exported from the SDK,onPurchaseis wired to the
customdomain:purchasewindow event (previously dropped silently for every React consumer),
andpurchaseDomain()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 apurchaseflag that is not a member
ofOpenConfig.- 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'sWhiteLabel;
packages/react/src/sdk-parity.assert.tsasserts 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 hostedwidget.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 newpurchaseDomain()share onesdkConfig()
helper, and the wrapper-only callbacks (stripped before the config reaches the SDK so window
events do not fire twice) live in a namedWRAPPER_ONLY_KEYSconstant. No behavior change to
open().
Known gap (closed in 0.5.0)
- The React README in this repo did not document
onPurchaseorpurchaseDomain().
Full changelog: CHANGELOG.md · Diff: v0.3.0...v0.4.0