Skip to content

Commit 27b34ed

Browse files
committed
feat: move react native image resizer to the native package natively
1 parent 4366578 commit 27b34ed

File tree

24 files changed

+1998
-27
lines changed

24 files changed

+1998
-27
lines changed

examples/TypeScriptMessaging/ios/Podfile.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,8 +1285,6 @@ PODS:
12851285
- ReactCommon/turbomodule/bridging
12861286
- ReactCommon/turbomodule/core
12871287
- Yoga
1288-
- react-native-image-resizer (3.0.10):
1289-
- React-Core
12901288
- react-native-netinfo (11.3.2):
12911289
- React-Core
12921290
- react-native-safe-area-context (4.11.1):
@@ -1735,6 +1733,8 @@ PODS:
17351733
- RNSVG (15.8.0):
17361734
- React-Core
17371735
- SocketRocket (0.7.0)
1736+
- stream-chat-react-native (5.39.5):
1737+
- React-Core
17381738
- Yoga (0.0.0)
17391739

17401740
DEPENDENCIES:
@@ -1779,7 +1779,6 @@ DEPENDENCIES:
17791779
- react-native-blob-util (from `../node_modules/react-native-blob-util`)
17801780
- react-native-document-picker (from `../node_modules/react-native-document-picker`)
17811781
- react-native-image-picker (from `../node_modules/react-native-image-picker`)
1782-
- "react-native-image-resizer (from `../node_modules/@bam.tech/react-native-image-resizer`)"
17831782
- "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)"
17841783
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
17851784
- react-native-video (from `../node_modules/react-native-video`)
@@ -1817,6 +1816,7 @@ DEPENDENCIES:
18171816
- RNScreens (from `../node_modules/react-native-screens`)
18181817
- RNShare (from `../node_modules/react-native-share`)
18191818
- RNSVG (from `../node_modules/react-native-svg`)
1819+
- stream-chat-react-native (from `../node_modules/stream-chat-react-native`)
18201820
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
18211821

18221822
SPEC REPOS:
@@ -1903,8 +1903,6 @@ EXTERNAL SOURCES:
19031903
:path: "../node_modules/react-native-document-picker"
19041904
react-native-image-picker:
19051905
:path: "../node_modules/react-native-image-picker"
1906-
react-native-image-resizer:
1907-
:path: "../node_modules/@bam.tech/react-native-image-resizer"
19081906
react-native-netinfo:
19091907
:path: "../node_modules/@react-native-community/netinfo"
19101908
react-native-safe-area-context:
@@ -1979,6 +1977,8 @@ EXTERNAL SOURCES:
19791977
:path: "../node_modules/react-native-share"
19801978
RNSVG:
19811979
:path: "../node_modules/react-native-svg"
1980+
stream-chat-react-native:
1981+
:path: "../node_modules/stream-chat-react-native"
19821982
Yoga:
19831983
:path: "../node_modules/react-native/ReactCommon/yoga"
19841984

@@ -1990,7 +1990,7 @@ SPEC CHECKSUMS:
19901990
glog: 69ef571f3de08433d766d614c73a9838a06bf7eb
19911991
hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0
19921992
op-sqlite: 5688336af53053aa37f0ec3496487dc2734c91cc
1993-
RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47
1993+
RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740
19941994
RCTDeprecation: 726d24248aeab6d7180dac71a936bbca6a994ed1
19951995
RCTRequired: a94e7febda6db0345d207e854323c37e3a31d93b
19961996
RCTTypeSafety: 28e24a6e44f5cbf912c66dde6ab7e07d1059a205
@@ -2022,7 +2022,6 @@ SPEC CHECKSUMS:
20222022
react-native-blob-util: 18b510205c080a453574a7d2344d64673d0ad9af
20232023
react-native-document-picker: 7343222102ece8aec51390717f47ad7119c7921f
20242024
react-native-image-picker: 2fbbafdae7a7c6db9d25df2f2b1db4442d2ca2ad
2025-
react-native-image-resizer: fd0c333eca55147bd55c5e054cac95dcd0da6814
20262025
react-native-netinfo: 076df4f9b07f6670acf4ce9a75aac8d34c2e2ccc
20272026
react-native-safe-area-context: 5141f11858b033636f1788b14f32eaba92cee810
20282027
react-native-video: b0584a6d2271cb163f817c7412708263f9893ed5
@@ -2061,8 +2060,9 @@ SPEC CHECKSUMS:
20612060
RNShare: 0fad69ae2d71de9d1f7b9a43acf876886a6cb99c
20622061
RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d
20632062
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
2063+
stream-chat-react-native: 489a6a053480ab8556883de05a28df2c7387ede6
20642064
Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6
20652065

20662066
PODFILE CHECKSUM: 6b7a4b74915b42bfe4ffddaf67cbf5e7a2bfeab3
20672067

2068-
COCOAPODS: 1.15.2
2068+
COCOAPODS: 1.16.2

examples/TypeScriptMessaging/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"clean-all": "yarn clean && rm -rf node_modules && rm -rf ios/Pods && rm -rf vendor && bundle install && yarn install && cd ios && bundle exec pod install && cd -"
1313
},
1414
"dependencies": {
15-
"@bam.tech/react-native-image-resizer": "^3.0.10",
1615
"@op-engineering/op-sqlite": "^6.0.4",
1716
"@react-native-clipboard/clipboard": "^1.10.0",
1817
"@react-native-community/netinfo": "^11.3.2",

examples/TypeScriptMessaging/yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,11 +1777,6 @@
17771777
"@babel/helper-string-parser" "^7.25.9"
17781778
"@babel/helper-validator-identifier" "^7.25.9"
17791779

1780-
"@bam.tech/react-native-image-resizer@^3.0.10":
1781-
version "3.0.10"
1782-
resolved "https://registry.yarnpkg.com/@bam.tech/react-native-image-resizer/-/react-native-image-resizer-3.0.10.tgz#03395a29cb61cd819ce1e7730fb137ab6e75618a"
1783-
integrity sha512-IVIBRkgy8eq4g51RjAzh7zk8KpGhiQH6GqLC7SgAUJ0plh2bdqG2l8+D+Q/A0uFe85YutUmHyFioyDEsRGXaCQ==
1784-
17851780
"@bcoe/v8-coverage@^0.2.3":
17861781
version "0.2.3"
17871782
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
buildscript {
2+
repositories {
3+
google()
4+
mavenCentral()
5+
}
6+
7+
dependencies {
8+
classpath "com.android.tools.build:gradle:7.2.1"
9+
10+
}
11+
}
12+
13+
def isNewArchitectureEnabled() {
14+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
15+
}
16+
17+
apply plugin: "com.android.library"
18+
19+
20+
def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
21+
22+
if (isNewArchitectureEnabled()) {
23+
apply plugin: "com.facebook.react"
24+
}
25+
26+
def getExtOrDefault(name) {
27+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["ImageResizer_" + name]
28+
}
29+
30+
def getExtOrIntegerDefault(name) {
31+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["ImageResizer_" + name]).toInteger()
32+
}
33+
34+
android {
35+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
36+
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
37+
def agpMajorVersion = agpVersion.tokenize('.')[0].toInteger()
38+
def agpMinorVersion = agpVersion.tokenize('.')[1].toInteger()
39+
/**
40+
* Namespace should be declared here starting from AGP 8.x, Starting AGP 7.3 it is also supported.
41+
* For AGP < 7.3, namespace should be declared in AndroidManifest.
42+
* See: https://developer.android.com/build/releases/past-releases/agp-8-0-0-release-notes#namespace-dsl
43+
*/
44+
if (agpMajorVersion >= 7 && agpMinorVersion >= 3) {
45+
namespace "com.reactnativeimageresizer"
46+
}
47+
48+
defaultConfig {
49+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
50+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
51+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
52+
}
53+
buildTypes {
54+
release {
55+
minifyEnabled false
56+
}
57+
}
58+
59+
lintOptions {
60+
disable "GradleCompatible"
61+
}
62+
63+
compileOptions {
64+
sourceCompatibility JavaVersion.VERSION_1_8
65+
targetCompatibility JavaVersion.VERSION_1_8
66+
}
67+
68+
sourceSets {
69+
main {
70+
if (isNewArchitectureEnabled()) {
71+
java.srcDirs += [
72+
"src/newarch",
73+
// This is needed to build Kotlin project with NewArch enabled
74+
"${project.buildDir}/generated/source/codegen/java"
75+
]
76+
} else {
77+
java.srcDirs += ["src/oldarch"]
78+
}
79+
}
80+
}
81+
}
82+
83+
repositories {
84+
mavenCentral()
85+
google()
86+
}
87+
88+
89+
dependencies {
90+
// For < 0.71, this will be from the local maven repo
91+
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
92+
//noinspection GradleDynamicVersion
93+
implementation "com.facebook.react:react-native:+"
94+
implementation "androidx.exifinterface:exifinterface:1.3.2"
95+
}
96+
97+
if (isNewArchitectureEnabled()) {
98+
react {
99+
jsRootDir = file("../src/")
100+
libraryName = "ImageResizer"
101+
codegenJavaPackageName = "com.reactnativeimageresizer"
102+
}
103+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ImageResizer_kotlinVersion=1.7.0
2+
ImageResizer_minSdkVersion=21
3+
ImageResizer_targetSdkVersion=31
4+
ImageResizer_compileSdkVersion=31
5+
ImageResizer_ndkversion=21.4.7075529
57.8 KB
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.reactnativeimageresizer">
2+
3+
</manifest>

0 commit comments

Comments
 (0)