Skip to content

Commit

Permalink
Upgrade samples to 0.77 (#1005)
Browse files Browse the repository at this point in the history
## Description
Upgrades Calculator samples and csharp and cppwinrt NativeModule samples
to 0.77.

Note: will include fabric NativeModule sample in separate PR.

### Why
Part of the 0.77 release.
  • Loading branch information
Yajur-Grover authored Feb 4, 2025
1 parent 1f4b998 commit b264808
Show file tree
Hide file tree
Showing 57 changed files with 28,680 additions and 6,814 deletions.
2 changes: 1 addition & 1 deletion samples/Calculator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This sample showcases the usage of React Native for Windows to build a simple calculator. It includes implementations in C# and C++/WinRT.

It currently targets React Native Windows 0.76.
It currently targets React Native Windows 0.77.

### Setup
First, make sure you've met the [React Native Windows System Requirements](https://microsoft.github.io/react-native-windows/docs/rnw-dependencies).
Expand Down
1 change: 1 addition & 0 deletions samples/Calculator/cppwinrt/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ ruby ">= 2.6.10"
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'
2 changes: 1 addition & 1 deletion samples/Calculator/cppwinrt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To upgrade this sample to the latest version of RNW:
```
3. Create a new React Native app and change version to version you want to upgrade to (replace 'version' with desired version - for latest version, use 'latest'):
```cmd
npx @react-native-community/cli@latest init Calculator --version {version}
npx @react-native-community/cli@latest init Calculator --template @react-native-community/template@latest --skip-git-init
```
4. Add a lockfile to the calculator directory:
Expand Down
14 changes: 5 additions & 9 deletions samples/Calculator/cppwinrt/__tests__/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
* @format
*/

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

// Note: import explicitly to use the types shipped with jest.
import {it} from '@jest/globals';

// 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 samples/Calculator/cppwinrt/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,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
193 changes: 4 additions & 189 deletions samples/Calculator/cppwinrt/ios/Calculator.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions samples/Calculator/cppwinrt/ios/Calculator/AppDelegate.h

This file was deleted.

31 changes: 0 additions & 31 deletions samples/Calculator/cppwinrt/ios/Calculator/AppDelegate.mm

This file was deleted.

30 changes: 30 additions & 0 deletions samples/Calculator/cppwinrt/ios/Calculator/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 = "Calculator"
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 samples/Calculator/cppwinrt/ios/Calculator/main.m

This file was deleted.

66 changes: 0 additions & 66 deletions samples/Calculator/cppwinrt/ios/CalculatorTests/CalculatorTests.m

This file was deleted.

24 changes: 0 additions & 24 deletions samples/Calculator/cppwinrt/ios/CalculatorTests/Info.plist

This file was deleted.

5 changes: 0 additions & 5 deletions samples/Calculator/cppwinrt/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ target 'Calculator' do
:app_path => "#{Pod::Config.instance.installation_root}/.."
)

target 'CalculatorTests' 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(
Expand Down
Loading

0 comments on commit b264808

Please sign in to comment.