Skip to content

test(metro): Add type tests for SentryExpoConfigOptions.getDefaultConfig#5733

Merged
antonis merged 2 commits intomainfrom
antonis/5246-followup
Feb 27, 2026
Merged

test(metro): Add type tests for SentryExpoConfigOptions.getDefaultConfig#5733
antonis merged 2 commits intomainfrom
antonis/5246-followup

Conversation

@antonis
Copy link
Contributor

@antonis antonis commented Feb 27, 2026

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Follow-up to #5246. Adds type compatibility tests for SentryExpoConfigOptions.getDefaultConfig as suggested in the review comment.

Two tests validate the fix:

  1. New format (Expo SDK 54): A function with the flexible Record<string, unknown> signature compiles — this was the core fix, accommodating Metro type definitions that diverged between @expo/metro and the standalone metro package.

  2. Old usage pattern: The classic wrapping pattern (calling expo/metro-config's getDefaultConfig and returning a spread/modified config object) still works — Record<string, unknown> options are compatible with DefaultConfigOptions (all optional fields), and the spread object return type is compatible with Record<string, unknown>.

💡 Motivation and Context

Follows up on the suggestion from @lucas-zimerman in #5246 (comment):

This is optional, but would it be possible to also include a type test to validates it's working with the new format and also the old ones?

💚 How did you test it?

  • yarn test:tools — all 117 tests pass
  • npx tsc --noEmit — no new TypeScript errors

📝 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
  • No breaking changes

Adds type compatibility tests validating the fix from #5246:
- New format: a function with the flexible `Record<string, unknown>`
  signature (Expo SDK 54 style, accommodating diverged Metro types)
- Old format: the classic wrapping pattern where users call
  `expo/metro-config`'s getDefaultConfig and return a modified config

Follows up on the type-test suggestion in
#5246 (comment)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 27, 2026

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).


  • test(metro): Add type tests for SentryExpoConfigOptions.getDefaultConfig by antonis in #5733
  • chore(deps): bump axios to ^1.13.5 by antonis in #5708
  • chore(deps): bump on-headers to ^1.1.0 by antonis in #5704
  • chore(deps): bump dottie from 2.0.6 to 2.0.7 by dependabot in #5731
  • Cirrus Labs runners for other important workflows (where it makes sense to do so) + Ubuntu update (22.04 -> 24.04) by alwx in #5696
  • chore(deps): bump diff to ^5.2.2 by antonis in #5705
  • chore(deps): update Bundler Plugins to v5.1.1 by github-actions in #5700
  • chore(deps): update JavaScript SDK to v10.40.0 by github-actions in #5715
  • ci: Cancel in-progress CI jobs when a PR is closed or merged by antonis in #5725

🤖 This preview updates automatically when you update the PR.

@antonis antonis added ready-to-merge Triggers the full CI test suite skip-changelog labels Feb 27, 2026
@antonis antonis marked this pull request as ready for review February 27, 2026 14:08
Copy link
Collaborator

@lucas-zimerman lucas-zimerman left a comment

Choose a reason for hiding this comment

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

Thank you for adding the tests!

@antonis antonis merged commit 7a26cc6 into main Feb 27, 2026
45 of 75 checks passed
@antonis antonis deleted the antonis/5246-followup branch February 27, 2026 14:29
alwx added a commit to getsentry/sentry-docs that referenced this pull request Mar 18, 2026
We've recently added a bunch of changes to Expo integrations in the
React Native SDK, this PR adds the missing information about those
changes to the docs.

Here is the list of PRs it covers:

- Expo Updates
- getsentry/sentry-react-native#5794
- getsentry/sentry-react-native#5788
- getsentry/sentry-react-native#5748
- Expo Config Plugin
- getsentry/sentry-react-native#5796 — 06d4e245
— Add environment option to Expo config plugin
- EAS Build Integration
- getsentry/sentry-react-native#5666
- getsentry/sentry-react-native#5773
- getsentry/sentry-react-native#5617
- Expo Router / Tracing
- getsentry/sentry-react-native#5606
- getsentry/sentry-react-native#5718
- Tooling / Fixes
- getsentry/sentry-react-native#5636
  - getsentry/sentry-react-native#5733
stephanie-anderson pushed a commit to getsentry/sentry-docs that referenced this pull request Mar 18, 2026
We've recently added a bunch of changes to Expo integrations in the
React Native SDK, this PR adds the missing information about those
changes to the docs.

Here is the list of PRs it covers:

- Expo Updates
- getsentry/sentry-react-native#5794
- getsentry/sentry-react-native#5788
- getsentry/sentry-react-native#5748
- Expo Config Plugin
- getsentry/sentry-react-native#5796 — 06d4e245
— Add environment option to Expo config plugin
- EAS Build Integration
- getsentry/sentry-react-native#5666
- getsentry/sentry-react-native#5773
- getsentry/sentry-react-native#5617
- Expo Router / Tracing
- getsentry/sentry-react-native#5606
- getsentry/sentry-react-native#5718
- Tooling / Fixes
- getsentry/sentry-react-native#5636
  - getsentry/sentry-react-native#5733
constantinius pushed a commit to getsentry/sentry-docs that referenced this pull request Mar 20, 2026
We've recently added a bunch of changes to Expo integrations in the
React Native SDK, this PR adds the missing information about those
changes to the docs.

Here is the list of PRs it covers:

- Expo Updates
- getsentry/sentry-react-native#5794
- getsentry/sentry-react-native#5788
- getsentry/sentry-react-native#5748
- Expo Config Plugin
- getsentry/sentry-react-native#5796 — 06d4e245
— Add environment option to Expo config plugin
- EAS Build Integration
- getsentry/sentry-react-native#5666
- getsentry/sentry-react-native#5773
- getsentry/sentry-react-native#5617
- Expo Router / Tracing
- getsentry/sentry-react-native#5606
- getsentry/sentry-react-native#5718
- Tooling / Fixes
- getsentry/sentry-react-native#5636
  - getsentry/sentry-react-native#5733
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 skip-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants