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

Update dependencies and sample application #1043

Merged
merged 32 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7af0f3a
Update RN version
poovamraj Jan 26, 2025
95f3e7c
Enable new arch
poovamraj Jan 26, 2025
bb3d8e8
WIP: Migrating to newer version of RN
poovamraj Jan 27, 2025
faea584
upgrade Expo
poovamraj Jan 27, 2025
637ad46
Upgrade RN
poovamraj Jan 27, 2025
f6e7fed
Merge branch 'master' into upgrade-dependency
poovamraj Jan 27, 2025
c22ec06
Update android sdk version to v3.2.1
kailash-b Jan 28, 2025
99c7578
Create Podfile.lock
poovamraj Jan 28, 2025
387d435
Merge branch 'feature/SDK-5575' into upgrade-dependency
poovamraj Jan 28, 2025
bdb1a61
Kotlin support
poovamraj Jan 28, 2025
e80d137
Update MainApplication.kt
poovamraj Jan 28, 2025
79ca56f
Update MainApplication.kt
poovamraj Jan 28, 2025
1f21abd
Upgrade dependencies
poovamraj Jan 29, 2025
1abeb86
Remove babel config
poovamraj Jan 29, 2025
d3efee1
Fix iOS builds
poovamraj Jan 30, 2025
a98c55d
Update package.json
poovamraj Jan 30, 2025
93d7a3e
Upgrade deps
poovamraj Jan 30, 2025
49b3cc6
Checkpoint: Working E2E in Android
poovamraj Feb 1, 2025
380f4b2
checkpoint: E2E working for iOS
poovamraj Feb 1, 2025
1edc68c
Merge branch 'master' into upgrade-dependency
poovamraj Feb 1, 2025
a5c13f8
Update package.json
poovamraj Feb 1, 2025
dc028a8
Update package-lock.json
poovamraj Feb 1, 2025
c69314a
add babel preset
poovamraj Feb 1, 2025
d896f35
Trigger Build
poovamraj Feb 1, 2025
1b2862a
Update .snyk
poovamraj Feb 1, 2025
85e69b9
Update .snyk
poovamraj Feb 1, 2025
665b27a
Snyk ignore
poovamraj Feb 2, 2025
1286177
Delete .xcode.env.local
poovamraj Feb 2, 2025
5d9b769
Update package.json
poovamraj Feb 2, 2025
565aa96
Update dependency
poovamraj Feb 3, 2025
1e2c8f5
Upgrade react-native-safe-area-context
poovamraj Feb 3, 2025
9800657
Update build.gradle
poovamraj Feb 5, 2025
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
48 changes: 4 additions & 44 deletions .snyk
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,9 @@
version: v1.25.0
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
SNYK-JS-BRACES-6838727:
- '*':
reason: Updating dependey as fast follow up
expires: 2025-01-31T05:44:59.682Z
created: 2024-08-02T05:42:12.691Z
SNYK-JS-INFLIGHT-6095116:
- '*':
reason: Updating dependey as fast follow up
expires: 2025-01-31T05:44:59.682Z
created: 2024-08-02T05:42:54.239Z
SNYK-JS-MICROMATCH-6838728:
- '*':
reason: Updating dependey as fast follow up
expires: 2025-01-31T05:44:59.682Z
created: 2024-08-02T05:43:37.959Z
SNYK-JS-WS-7266574:
- '*':
reason: Updating dependey as fast follow up
expires: 2025-01-31T05:44:59.682Z
created: 2024-08-02T05:44:19.472Z

SNYK-JS-SEND-7926862:
- '*':
reason: Updating dependey as fast follow up
expires: 2025-01-31T05:44:59.682Z
created: 2025-01-27T05:44:59.685Z


SNYK-JS-SERVESTATIC-7926865:
- '*':
reason: Updating dependey as fast follow up
expires: 2025-01-31T05:44:59.682Z
created: 2025-01-27T05:44:59.685Z

SNYK-JS-CROSSSPAWN-8303230:
- '*':
reason: Updating dependey as fast follow up
expires: 2025-01-31T05:44:59.682Z
created: 2025-01-27T05:44:59.685Z

SNYK-JS-NANOID-8492085:
- '*':
reason: Updating dependey as fast follow up
expires: 2025-01-31T05:44:59.682Z
created: 2025-01-27T05:44:59.685Z
patch: {}
reason: No fix available
expires: 2025-03-04T05:47:18.375Z
created: 2025-02-02T05:47:18.380Z
patch: {}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ We're excited to announce the release of react-native-auth0 `v4.0.0`! Please not

### Requirements

This SDK targets apps that are using React Native SDK version `0.60.5` and up. If you're using an older React Native version, see the compatibility matrix below.
This SDK targets apps that are using React Native SDK version `0.65.0` and up. If you're using an older React Native version, see the compatibility matrix below.

### Platform compatibility

Expand Down
6 changes: 5 additions & 1 deletion example/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '>= 2.6.10'

gem 'cocoapods', '>= 1.11.3'
# 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'
25 changes: 16 additions & 9 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: "com.android.application"
apply plugin: "com.facebook.react"
apply plugin: 'org.jetbrains.kotlin.android'

import com.android.build.OutputFile

Expand All @@ -9,14 +10,14 @@ import com.android.build.OutputFile
*/
react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
// reactNativeDir = file("../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
// codegenDir = file("../node_modules/react-native-codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")
// The root of your project, i.e. where "package.json" lives. Default is '../..'
// root = file("../../")
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
// reactNativeDir = file("../../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
// codegenDir = file("../../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
// cliFile = file("../../node_modules/react-native/cli.js")

/* Variants */
// The list of variants to that are debuggable. For those we're going to
Expand Down Expand Up @@ -50,6 +51,9 @@ react {
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]

/* Autolinking */
autolinkLibrariesWithApp()
}

/**
Expand Down Expand Up @@ -130,6 +134,9 @@ android {
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
kotlinOptions {
jvmTarget = '17'
}

// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
Expand All @@ -154,6 +161,7 @@ dependencies {

implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
implementation("org.jetbrains:annotations:16.0.2")
implementation 'androidx.core:core-ktx:1.15.0'
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.squareup.okhttp3', module:'okhttp'
Expand All @@ -167,4 +175,3 @@ dependencies {
}
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
3 changes: 2 additions & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:supportsRtl="true">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package com.auth0example

import android.app.Application
import android.content.BroadcastReceiver
import android.content.Intent
import android.content.IntentFilter
import android.os.Build
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.soloader.OpenSourceMergedSoMapping
import com.facebook.soloader.SoLoader

class MainApplication : Application(), ReactApplication {

override val reactNativeHost: ReactNativeHost =
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:
// add(MyReactNativePackage())
}

override fun getJSMainModuleName(): String = "index"

override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG

override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
}

override val reactHost: ReactHost
get() = getDefaultReactHost(applicationContext, reactNativeHost)

override fun onCreate() {
super.onCreate()
SoLoader.init(this, OpenSourceMergedSoMapping)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
}
}

override fun registerReceiver(receiver: BroadcastReceiver?, filter: IntentFilter?): Intent? {
return if (Build.VERSION.SDK_INT >= 34 && applicationInfo.targetSdkVersion >= 34) {
super.registerReceiver(receiver, filter, RECEIVER_EXPORTED)
} else {
super.registerReceiver(receiver, filter)
}
}
}
12 changes: 6 additions & 6 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

buildscript {
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 21
compileSdkVersion = 34
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 34

// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
ndkVersion = "27.1.12297006"
kotlinVersion = "2.0.21"
}
repositories {
google()
Expand All @@ -17,5 +16,6 @@ buildscript {
dependencies {
classpath("com.android.tools.build:gradle:7.3.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
2 changes: 1 addition & 1 deletion example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
newArchEnabled=true

# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 3 additions & 2 deletions example/android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,7 +80,8 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

APP_NAME="Gradle"
APP_BASE_NAME=${0##*/}
Expand Down
2 changes: 2 additions & 0 deletions example/android/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
Expand Down
6 changes: 4 additions & 2 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
rootProject.name = 'Auth0Example'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/react-native-gradle-plugin')
includeBuild('../node_modules/@react-native/gradle-plugin')
25 changes: 10 additions & 15 deletions example/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
const path = require('path');
const pak = require('../package.json');
const { getConfig } = require('react-native-builder-bob/babel-config');
const pkg = require('../package.json');

module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
[
'module-resolver',
{
extensions: ['.tsx', '.ts', '.js', '.json'],
alias: {
[pak.name]: path.join(__dirname, '..', pak.source),
},
},
],
],
};
const root = path.resolve(__dirname, '..');

module.exports = getConfig(
{
presets: ['module:@react-native/babel-preset'],
},
{ root, pkg }
);
Loading