feat[gen2]: ENG-11602 add support for global symbols#4307
feat[gen2]: ENG-11602 add support for global symbols#4307floating-dynamo wants to merge 5 commits intomainfrom
Conversation
|
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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)
|
View your CI Pipeline Execution ↗ for commit 7657fe4
☁️ Nx Cloud last updated this comment at |
|
@midhunadarvin , I noticed that in the packages/sdks/output/react/src/scripts/init-editing.ts:33, there is a flag that is used - |
| 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!} |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.


Description
Screenshot

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 onsymbol.global/ownerId, which can affect content resolution and caching behavior across SDKs.Overview
Adds Gen2 global symbol support by extending
SymbolInfowithglobal/ownerIdand switching symbol fetch/render logic to usesymbol.ownerIdas theapiKeywhenglobal: true(otherwise keeping the current space key).Updates SDK tests to cover this behavior by introducing
CONTENT_WITH_GLOBAL_SYMBOLat/symbols-with-globaland 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.