Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Hotfix: update Cocoa SDK from 8.29.1 to 8.36.0 #4102

Merged
merged 9 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## Unreleased

### Fixes

- Support `metro@0.80.10` new `sourceMapString` export ([#4004](https://github.com/getsentry/sentry-react-native/pull/4004))

### Dependencies

- Bump Cocoa SDK from v8.29.1 to v8.36.0 ([#4102](https://github.com/getsentry/sentry-react-native/pull/4102))
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8360)
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.29.1...8.36.0)

## 5.24.2

### Features
Expand Down
2 changes: 1 addition & 1 deletion RNSentry.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Pod::Spec.new do |s|
s.preserve_paths = '*.js'

s.dependency 'React-Core'
s.dependency 'Sentry/HybridSDK', '8.29.1'
s.dependency 'Sentry/HybridSDK', '8.36.0'

s.source_files = 'ios/**/*.{h,m,mm}'
s.public_header_files = 'ios/RNSentry.h'
Expand Down
4 changes: 0 additions & 4 deletions ios/RNSentry.mm
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@
#import "RNSentryFramesTrackerListener.h"
#endif

@interface SentryTraceContext : NSObject
- (nullable instancetype)initWithDict:(NSDictionary<NSString *, id> *)dictionary;
@end

@interface SentrySDK (RNSentry)

+ (void)captureEnvelope:(SentryEnvelope *)envelope;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"jest-environment-jsdom": "^29.6.2",
"jest-extended": "^4.0.2",
"madge": "^6.1.0",
"metro": "0.76",
"metro": "0.80.10",
"prettier": "^2.0.5",
"react": "18.2.0",
"react-native": "0.73.2",
Expand Down
21,253 changes: 12,433 additions & 8,820 deletions samples/react-native/yarn.lock

Large diffs are not rendered by default.

24 changes: 23 additions & 1 deletion src/js/tools/vendor/metro/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ import * as bundleToString from 'metro/src/lib/bundleToString';

import type { MetroSerializer } from '../../utils';

type NewSourceMapStringExport = {
// Since Metro v0.80.10 https://github.com/facebook/metro/compare/v0.80.9...v0.80.10#diff-1b836d1729e527a725305eef0cec22e44605af2700fa413f4c2489ea1a03aebcL28
sourceMapString: typeof sourceMapString;
};

/**
* This function ensures that modules in source maps are sorted in the same
* order as in a plain JS bundle.
Expand Down Expand Up @@ -75,8 +80,25 @@ export const createDefaultMetroSerializer = (): MetroSerializer => {
return code;
}

let sourceMapStringFunction: typeof sourceMapString | undefined;
if (typeof sourceMapString === 'function') {
sourceMapStringFunction = sourceMapString;
} else if (
typeof sourceMapString === 'object' &&
sourceMapString != null &&
'sourceMapString' in sourceMapString &&
typeof sourceMapString['sourceMapString'] === 'function'
) {
sourceMapStringFunction = (sourceMapString as NewSourceMapStringExport).sourceMapString;
} else {
throw new Error(`
[@sentry/react-native/metro] Cannot find sourceMapString function in 'metro/src/DeltaBundler/Serializers/sourceMapString'.
Please check the version of Metro you are using and report the issue at http://github.com/getsentry/sentry-react-native/issues
`);
}

// Always generate source maps, can't use Sentry without source maps
const map = sourceMapString([...preModules, ...getSortedModules(graph, options)], {
const map = sourceMapStringFunction([...preModules, ...getSortedModules(graph, options)], {
processModuleFilter: options.processModuleFilter,
shouldAddToIgnoreList: options.shouldAddToIgnoreList,
});
Expand Down
Loading
Loading