[APPS][Connections Part 12] Use static definitions for imported connection IDs#375
[APPS][Connections Part 12] Use static definitions for imported connection IDs#375sdkennedy2 wants to merge 2 commits into
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2090651bdb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (context.moduleGraph) { | ||
| const definition = resolveStaticDefinitionForIdentifier( | ||
| context.moduleGraph.modules, | ||
| context.moduleGraph.moduleId, | ||
| node, | ||
| ); |
There was a problem hiding this comment.
Reject imported object bindings mutated through aliases
When an imported object root is resolved here, a definition module can still change the runtime value through a local alias, e.g. export const CONNECTIONS = { HTTP: 'conn-a' }; const ALIAS = CONNECTIONS; ALIAS.HTTP = 'conn-b';. I checked the mutation tracking in module-graph.ts, and member assignments only mark the assigned root variable (ALIAS) unsupported, not the original CONNECTIONS binding, so this path now records conn-a instead of failing closed or seeing the runtime value. Previously imported object roots were rejected, so this is a new false allowlist for that alias-mutation shape.
Useful? React with 👍 / 👎.

Motivation
This is the next PR in the backend connection ID analysis stack. The previous PR adds a domain-neutral static definition resolver that can follow identifier references through named imports, export aliases, re-exports, and star exports. Connection ID extraction can now reuse that resolver instead of maintaining its own import/export traversal.
Changes
Wires module-graph connection ID extraction into the static definition resolver.
extractConnectionIds(...)now requiresParsedModuleRecordand module-map context soconnection-id-values.tscan resolve the actualconnectionIdidentifier, or the root identifier of a member expression, throughresolveStaticDefinitionForIdentifier(...)and evaluate the returned const binding in the module where that definition lives.Supported cases:
CONNECTIONS.HTTPCONNECTIONS.HTTP.PRODUnsupported cases continue to fail closed with connection ID errors:
This removes the older optional same-module binding-map path from connection ID value resolution. Same-module identifiers now use the same static definition resolver as imported identifiers.
QA Instructions
No manual QA needed. This is an internal AST-analysis change covered by unit tests and does not change manifest wiring outside the backend connection ID extractor.
Blast Radius
This affects High Code Apps backend connection ID extraction in
@dd/apps-pluginwhen analyzing reachable app-local backend modules. It expands supported static import/re-export shapes while preserving fail-closed behavior for unsupported module graph and value shapes.Documentation