Skip to content

feat(core): Export instrumentStateGraph and deprecate instrumentLangGraph - #6520

Merged
antonis merged 3 commits into
mainfrom
feat/export-instrument-state-graph
Jul 27, 2026
Merged

feat(core): Export instrumentStateGraph and deprecate instrumentLangGraph#6520
antonis merged 3 commits into
mainfrom
feat/export-instrument-state-graph

Conversation

@antonis

@antonis antonis commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Follow-up to #6516 (JavaScript SDK bump to v10.68.0).

  • Re-export instrumentStateGraph from @sentry/core.
  • Keep re-exporting instrumentLangGraph and mark it @deprecated so consumers get IDE strikethrough and a migration hint. The JSDoc tag is preserved in both the emitted dist types and the downleveled ts3.8 types.
  • Regenerate the API report (etc/sentry-react-native.api.md).
  • Changelog entry filed under ### Changes (matching the featureFlagsIntegration / logger re-export precedent), not ### Features.
  • Extend test/aiExports.test.ts to cover the new export and assert the deprecated name is the same function reference.

No behavior change — instrumentLangGraph is an alias of instrumentStateGraph upstream, so existing code keeps working unchanged.

💡 Motivation and Context

sentry-javascript v10.68.0 (#22491) renamed instrumentLangGraph to instrumentStateGraph and deprecated the old name:

export declare function instrumentStateGraph<T extends ...>
/** @deprecated This function was renamed and will be removed in a future major version.
 *  Use `instrumentStateGraph` instead. */
export declare const instrumentLangGraph: typeof instrumentStateGraph;

The RN SDK only re-exported the deprecated name, so React Native users had no way to reach the new API and got no deprecation signal. This aligns the RN public surface with the upstream JavaScript SDK ahead of the next major, where the alias will be dropped.

💚 How did you test it?

Run locally on this branch:

  • yarn test — 1718 tests / 127 suites passing, including the extended test/aiExports.test.ts.
  • yarn lint:lerna — 0 errors (1 pre-existing unrelated warning in a sample).
  • yarn circularDepCheck — no circular dependencies.
  • cd packages/core && yarn api-report:check — API report up to date.
  • Verified the @deprecated tag survives into packages/core/dist/js/index.d.ts and packages/core/ts3.8/dist/js/index.d.ts.

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • No breaking changes.

🔮 Next steps

  • Remove the instrumentLangGraph alias in the next major version.
  • Consider also re-exporting instrumentCreateReactAgent and instrumentLangChainEmbeddings, which are available in the browser build but not currently surfaced by the RN SDK (pre-existing gap, not introduced by v10.68.0).

🤖 Generated with Claude Code

…raph

The JavaScript SDK renamed `instrumentLangGraph` to `instrumentStateGraph`
in v10.68.0 and marked the old name as deprecated. Re-export the new name
and keep the old one for backwards compatibility until the next major.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • feat(core): Export instrumentStateGraph and deprecate instrumentLangGraph by antonis in #6520
  • chore(deps): bump the codeql-action group across 1 directory with 3 updates by dependabot in #6517
  • chore(deps): bump ruby/setup-ruby from 1.319.0 to 1.321.0 by dependabot in #6518
  • chore(deps): bump actions/checkout from 7.0.0 to 7.0.1 by dependabot in #6519
  • chore(deps): update JavaScript SDK to v10.68.0 by github-actions in #6516
  • chore(deps): bump tar from 7.5.20 to 7.5.21 by dependabot in #6515
  • chore(deps): bump lerna to ^9.0.7 to resolve remaining dev-tooling advisories by antonis in #6499
  • chore(deps): Migrate to @sentry/bundler-plugins by antonis in #6501
  • chore: update changelog warning with fix version by antonis in #6509
  • chore(deps): bump actions/setup-node from 6.4.0 to 7.0.0 by dependabot in #6463
  • chore(deps): bump json from 2.17.1.2 to 2.19.9 in /performance-tests by dependabot in #6512
  • chore(deps): update CLI to v3.6.2 by github-actions in #6511
  • chore(deps): update Sentry Android Gradle Plugin to v6.16.0 by github-actions in #6508
  • chore(deps): update Android SDK to v8.50.1 by github-actions in #6503

🤖 This preview updates automatically when you update the PR.

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against d6b4f7b

antonis and others added 2 commits July 27, 2026 10:07
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Matches the precedent set by the featureFlagsIntegration and logger
re-export entries, which are Changes rather than Features.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@antonis
antonis marked this pull request as ready for review July 27, 2026 08:18
@antonis
antonis requested review from a team, alwx and lucas-zimerman as code owners July 27, 2026 08:18
@antonis antonis added the ready-to-merge Triggers the full CI test suite label Jul 27, 2026
@antonis
antonis merged commit a9df5ce into main Jul 27, 2026
95 of 118 checks passed
@antonis
antonis deleted the feat/export-instrument-state-graph branch July 27, 2026 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Triggers the full CI test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants