Skip to content

feat[gen2]: ENG-11602 add support for global symbols#4307

Open
floating-dynamo wants to merge 5 commits intomainfrom
ENG-11602-gen2-global-symbols
Open

feat[gen2]: ENG-11602 add support for global symbols#4307
floating-dynamo wants to merge 5 commits intomainfrom
ENG-11602-gen2-global-symbols

Conversation

@floating-dynamo
Copy link
Contributor

@floating-dynamo floating-dynamo commented Feb 27, 2026

Description

  • Added code to support the global symbols for Gen2 SDKs. (ENG-11602)
  • Just made a simple change in the way we fetch the symbol i.e the apiKey - for global symbol, will use the symbol.ownerId instead of the builderContext apiKey.

Screenshot
image

Complete dev testing - https://www.notion.so/builderio/ENG-11602-testing-global-symbol-for-gen2-SDKs-3143d7274be581419ee8f57d631e12ba


Note

Medium Risk
Changes symbol content fetching to sometimes use a different apiKey (cross-space) based on symbol.global/ownerId, which can affect content resolution and caching behavior across SDKs.

Overview
Adds Gen2 global symbol support by extending SymbolInfo with global/ownerId and switching symbol fetch/render logic to use symbol.ownerId as the apiKey when global: true (otherwise keeping the current space key).

Updates SDK tests to cover this behavior by introducing CONTENT_WITH_GLOBAL_SYMBOL at /symbols-with-global and adding Playwright assertions that global symbols use the owner key while non-global symbols never do.

Written by Cursor Bugbot for commit 7657fe4. This will update automatically on new commits. Configure here.

@changeset-bot
Copy link

changeset-bot bot commented Feb 27, 2026

⚠️ No Changeset found

Latest commit: 7657fe4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

inline?: boolean;
dynamic?: boolean;
ownerId?: string;
global?: boolean;
Copy link

Choose a reason for hiding this comment

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

Duplicate SymbolInfo interface risks future divergence

Low Severity

The SymbolInfo interface is independently defined in both symbol.helpers.ts and symbol.types.ts with identical fields. This PR adds ownerId and global to both copies. The component passes props.symbol (typed via symbol.types.ts) to fetchSymbolContent (typed via symbol.helpers.ts), so if these definitions ever diverge, type mismatches could go unnoticed. symbol.helpers.ts could import SymbolInfo from symbol.types.ts instead of redeclaring it.

Additional Locations (1)

Fix in Cursor Fix in Web

@nx-cloud
Copy link

nx-cloud bot commented Feb 27, 2026

View your CI Pipeline Execution ↗ for commit 7657fe4

Command Status Duration Result
nx test @e2e/qwik-city ✅ Succeeded 7m 48s View ↗
nx test @e2e/nextjs-sdk-next-app ✅ Succeeded 7m 30s View ↗
nx test @e2e/angular-17 ✅ Succeeded 6m 50s View ↗
nx test @e2e/nuxt ✅ Succeeded 5m 54s View ↗
nx test @e2e/angular-17-ssr ✅ Succeeded 5m 32s View ↗
nx test @e2e/react-sdk-next-15-app ✅ Succeeded 5m 33s View ↗
nx test @e2e/react-sdk-next-14-app ✅ Succeeded 5m 24s View ↗
nx test @e2e/gen1-remix ✅ Succeeded 5m 4s View ↗
Additional runs (37) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2026-02-27 10:40:42 UTC

@floating-dynamo floating-dynamo requested review from a team and midhunadarvin and removed request for a team February 27, 2026 08:31
@floating-dynamo
Copy link
Contributor Author

@midhunadarvin , I noticed that in the packages/sdks/output/react/src/scripts/init-editing.ts:33, there is a flag that is used - supportsGlobalSymbols: true, I am not clear on what this does and whether we need to include this in our - packages/sdks/src/scripts/init-editing.ts ? Are you aware of this?

isNestedRender
apiVersion={props.builderContext.value.apiVersion}
apiKey={props.builderContext.value.apiKey!}
apiKey={(props.symbol?.global && props.symbol?.ownerId) ? props.symbol.ownerId : props.builderContext.value.apiKey!}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we check if the ownerId is part of the same root org ? Else it will allow global symbol to be used between orgs right ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a good suggestion, but I don't think there is a way of knowing the root org at SDK side (do correct me if I am wrong), and anyways the UI and backend already have those checks to control which symbols are insertable to which spaces, so it should not be concerning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants