Skip to content

[MOB-11175] make-rn-sdk-compatible-with-expo #629

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

Merged
merged 15 commits into from
Apr 10, 2025

Conversation

lposen
Copy link
Contributor

@lposen lposen commented Apr 7, 2025

🔹 JIRA Ticket(s) if any

✏️ Description

Fixes issues that cause expo builds to fail

Test

Just run the example app and make sure that everything loads as expected. None of the changes are high risk, so a quick smoke check is fine.

lposen added 6 commits April 7, 2025 13:46
… multiple files to use NativeModules directly, as expo does breaks when importing this from another file
…bleInAppManager and IterableInboxDataModel, otherwise expo gets upset
Copy link

github-actions bot commented Apr 7, 2025

Lines Statements Branches Functions
Coverage: 38%
38.11% (178/467) 11.29% (20/177) 32.46% (50/154)

@lposen lposen requested a review from Copilot April 7, 2025 21:14
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Copy link

codeclimate bot commented Apr 7, 2025

❌ 3 blocking issues (4 total)

Tool Category Rule Count
rubocop Lint Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem concurrent\-ruby should appear before xcodeproj. 2
prettier Style Incorrect formatting, autoformat by running qlty fmt. 1
ripgrep Lint // TODO: Organize these so that there are no circular dependencies 1

@qltysh one-click actions:

  • Auto-fix formatting (qlty fmt && git push)

This is from Qlty Cloud, the successor to Code Climate Quality. Learn more.

import { NativeModules } from 'react-native';

import { Iterable } from '../../core';
import type { IterableInAppDeleteSource, IterableInAppLocation } from '../enums';
Copy link

Choose a reason for hiding this comment

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

unused expression, expected an assignment or function call

import { NativeModules } from 'react-native';

import { Iterable } from '../../core';
import type { IterableInAppDeleteSource, IterableInAppLocation } from '../enums';
Copy link

Choose a reason for hiding this comment

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

Do not use comma operator here because it can be easily misunderstood or lead to unintended bugs.

IterableInboxImpressionRowInfo,
IterableInboxRowViewModel,
} from '../types';
import type { IterableInboxImpressionRowInfo, IterableInboxRowViewModel } from '../types';
Copy link

Choose a reason for hiding this comment

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

unused expression, expected an assignment or function call

IterableInboxImpressionRowInfo,
IterableInboxRowViewModel,
} from '../types';
import type { IterableInboxImpressionRowInfo, IterableInboxRowViewModel } from '../types';
Copy link

Choose a reason for hiding this comment

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

Do not use comma operator here because it can be easily misunderstood or lead to unintended bugs.

IterableInAppManager,
IterableInAppMessage,
} from '../../inApp';
// TODO: Organize these so that there are no circular dependencies
Copy link

Choose a reason for hiding this comment

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

TODO found

// expo throws an error if this is not imported directly due to circular
// dependencies
// See https://github.com/expo/expo/issues/35100
import type { IterableEdgeInsetDetails } from '../../core/types/IterableEdgeInsetDetails';
Copy link

Choose a reason for hiding this comment

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

unused expression, expected an assignment or function call

// expo throws an error if this is not imported directly due to circular
// dependencies
// See https://github.com/expo/expo/issues/35100
import type { IterableInAppContentType } from '../enums/IterableInAppContentType';
Copy link

Choose a reason for hiding this comment

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

unused expression, expected an assignment or function call

IterableInAppManager,
IterableInAppMessage,
} from '../../inApp';
// TODO: Organize these so that there are no circular dependencies
Copy link

Choose a reason for hiding this comment

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

// TODO: Organize these so that there are no circular dependencies [ripgrep:TODO]

example/Gemfile Outdated
@@ -6,3 +6,4 @@ ruby ">= 2.6.10"
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'concurrent-ruby', '< 1.3.4'
Copy link

Choose a reason for hiding this comment

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

Expected a newline at the end of the file.

example/Gemfile Outdated
@@ -6,3 +6,4 @@ ruby ">= 2.6.10"
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'concurrent-ruby', '< 1.3.4'
Copy link

Choose a reason for hiding this comment

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

Final newline missing. [rubocop:Layout/TrailingEmptyLines]

IterableInAppManager,
IterableInAppMessage,
} from '../../inApp';
// TODO: Organize these so that there are no circular dependencies
Copy link

Choose a reason for hiding this comment

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

// TODO: Organize these so that there are no circular dependencies [ripgrep:TODO]

lposen added 2 commits April 9, 2025 17:40
…hub.com:Iterable/react-native-sdk into expo/MOB-11175-make-rn-sdk-compatible-with-expo

* 'expo/MOB-11175-make-rn-sdk-compatible-with-expo' of github.com:Iterable/react-native-sdk:
  Concurrent Ruby version
@Ayyanchira Ayyanchira self-requested a review April 10, 2025 00:43
Copy link
Member

@Ayyanchira Ayyanchira left a comment

Choose a reason for hiding this comment

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

Looks good. Only caveat is Xcode 16.2.

Copy link

codeclimate bot commented Apr 10, 2025

Code Climate has analyzed commit bf51fd5 and detected 3 issues on this pull request.

Here's the issue category breakdown:

Category Count
Bug Risk 1
Style 2

The test coverage on the diff in this pull request is 71.1% (50% is the threshold).

This pull request will bring the total coverage in the repository to 38.4% (0.5% change).

View more on Code Climate.

@@ -6,3 +6,11 @@ ruby ">= 2.6.10"
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '< 1.3.4'
Copy link

Choose a reason for hiding this comment

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

Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem concurrent-ruby should appear before xcodeproj. [rubocop:Bundler/OrderedGems]

# Ruby 3.4.0 has removed some libraries from the standard library.
gem 'bigdecimal'
gem 'logger'
gem 'benchmark'
Copy link

Choose a reason for hiding this comment

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

Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem benchmark should appear before logger. [rubocop:Bundler/OrderedGems]

IterableInAppManager,
IterableInAppMessage,
} from '../../inApp';
// TODO: Organize these so that there are no circular dependencies
Copy link

Choose a reason for hiding this comment

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

// TODO: Organize these so that there are no circular dependencies [ripgrep:TODO]

@lposen lposen merged commit 63ec450 into master Apr 10, 2025
10 of 11 checks passed
@lposen lposen deleted the expo/MOB-11175-make-rn-sdk-compatible-with-expo branch April 10, 2025 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants