Skip to content

Add optional hub field to Newsroom type#404

Merged
JesseWynants merged 2 commits intomasterfrom
feature/newsroom-hub-context
Apr 22, 2026
Merged

Add optional hub field to Newsroom type#404
JesseWynants merged 2 commits intomasterfrom
feature/newsroom-hub-context

Conversation

@JesseWynants
Copy link
Copy Markdown
Contributor

Summary

  • Adds an optional hub field to the Newsroom type, mirroring the additive field introduced by prezly/prezly#18567.
  • Exposes hub.parent and hub.siblings[] (each a NewsroomRef + cultures) so theme/consumer code can render cross-site language pickers on HUB child newsrooms.
  • New Newsroom.HubPeer interface captures the shape used for parent/siblings.

Backend shape

  • hub: null for standalone newsrooms and HUB parents
  • hub: { parent, siblings } for HUB children

Release coordination

Field is typed as optional (hub?:) on purpose — this lets us merge and release the SDK independently of the backend PR's deploy order without handing consumers a type that lies about runtime shape. Once the backend is live everywhere, we can drop the ? in a follow-up.

Test plan

  • tsc --noEmit passes
  • Reviewer confirms field shape matches the backend PR
  • After backend 18567 deploys, verify SDK consumers can read newsroom.hub on a real HUB child

Mirrors the additive `hub` field introduced by prezly/prezly#18567,
which exposes the parent HUB and active siblings (each with `cultures`)
on child-newsroom API responses so themes can render cross-site language
pickers. Field is marked optional so the SDK release is not gated on
backend deploy order.
@JesseWynants JesseWynants requested a review from e1himself April 22, 2026 08:22
Copy link
Copy Markdown
Collaborator

@e1himself e1himself left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/types/Newsroom.ts Outdated
Comment thread src/types/Newsroom.ts Outdated
…ltures

- `hub` is always present on the API response (null when no parent HUB), so
  the field should not be optional.
- HubPeer `cultures` entries include an extra `is_default: boolean` not
  present on the base `CultureRef`.
@JesseWynants JesseWynants merged commit afa7573 into master Apr 22, 2026
5 checks passed
@JesseWynants JesseWynants deleted the feature/newsroom-hub-context branch April 22, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants