Skip to content

Commit

Permalink
Example React Native App - React Native 0.77 (#1069)
Browse files Browse the repository at this point in the history
* 0.77 rc6 update, building

* breaking changes in react native API

* rn 0.77 full release

* add missed file with comment change
  • Loading branch information
Funkatronics authored Feb 4, 2025
1 parent a9e8378 commit eea22df
Show file tree
Hide file tree
Showing 16 changed files with 552 additions and 680 deletions.
3 changes: 2 additions & 1 deletion examples/example-react-native-app/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ ruby '2.7.5'
# 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 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '< 1.3.4'
13 changes: 6 additions & 7 deletions examples/example-react-native-app/__tests__/App-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
* @format
*/

import 'react-native';
import React from 'react';
import ReactTestRenderer from 'react-test-renderer';
import App from '../App';

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';

it('renders correctly', () => {
renderer.create(<App />);
});
test('renders correctly', async () => {
await ReactTestRenderer.act(() => {
ReactTestRenderer.create(<App />);
});
});
4 changes: 2 additions & 2 deletions examples/example-react-native-app/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ buildscript {
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.24"
ndkVersion = "27.1.12297006"
kotlinVersion = "2.0.21"
}
repositories {
google()
Expand Down

Large diffs are not rendered by default.

This file was deleted.

133 changes: 0 additions & 133 deletions examples/example-react-native-app/ios/ExampleApp/AppDelegate.mm

This file was deleted.

30 changes: 30 additions & 0 deletions examples/example-react-native-app/ios/ExampleApp/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import UIKit
import React
import React_RCTAppDelegate
import ReactAppDependencyProvider

@main
class AppDelegate: RCTAppDelegate {
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
self.moduleName = "ExampleApp"
self.dependencyProvider = RCTAppDependencyProvider()

// You can add your custom initial props in the dictionary below.
// They will be passed down to the ViewController used by React Native.
self.initialProps = [:]

return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}

override func sourceURL(for bridge: RCTBridge) -> URL? {
self.bundleURL()
}

override func bundleURL() -> URL? {
#if DEBUG
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
}
}
10 changes: 0 additions & 10 deletions examples/example-react-native-app/ios/ExampleApp/main.m

This file was deleted.

This file was deleted.

24 changes: 0 additions & 24 deletions examples/example-react-native-app/ios/ExampleAppTests/Info.plist

This file was deleted.

45 changes: 19 additions & 26 deletions examples/example-react-native-app/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,43 +1,36 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip

platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false
platform :ios, min_ios_version_supported
prepare_react_native_project!

linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end

target 'ExampleApp' do
config = use_native_modules!

# Flags change depending on the env values.
flags = get_default_flags()

use_react_native!(
:path => config[:reactNativePath],
# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => true,
:fabric_enabled => flags[:fabric_enabled],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
:flipper_configuration => FlipperConfiguration.enabled,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)

target 'ExampleAppTests' do
inherit! :complete
# Pods for testing
end

post_install do |installer|
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
:mac_catalyst_enabled => false
config[:reactNativePath],
:mac_catalyst_enabled => false,
# :ccache_enabled => true
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end

2 changes: 1 addition & 1 deletion examples/example-react-native-app/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
* Metro configuration
* https://reactnative.dev/docs/metro
*
* @type {import('metro-config').MetroConfig}
* @type {import('@react-native/metro-config').MetroConfig}
*/
const config = {};

Expand Down
Loading

0 comments on commit eea22df

Please sign in to comment.