You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 1, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@
18
18
19
19
## Steps
20
20
21
-
### <aname="setup" />[[Setup] Create the calculator folder and the package.json](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/)
21
+
### <aname="setup" />[[Setup] Create the calculator folder and the package.json](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/9021940f8d65d1ffd93ced7ab211e17781a7e986)
22
22
23
23
1.`mkdir calculator`
24
24
1.`touch calculator/package.json`
@@ -57,7 +57,7 @@
57
57
}
58
58
```
59
59
60
-
### <aname="js-import" />[[Native Module] Create the JS import](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/)
60
+
### <aname="js-import" />[[Native Module] Create the JS import](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/93779da0638eaa39030bacd3947030e422488c54)
61
61
62
62
1.`mkdir calculator/src`
63
63
1.`touch calculator/src/index.js`
@@ -69,7 +69,7 @@ import { NativeModules } from 'react-native'
69
69
exportdefaultNativeModules.Calculator;
70
70
```
71
71
72
-
### <aname="ios-native" />[[Native Module] Create the iOS implementation](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/)
72
+
### <aname="ios-native" />[[Native Module] Create the iOS implementation](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/dcf74b8aac1f7b9ded606e4effa41830d652539d)
73
73
74
74
1.`mkdir calculator/ios`
75
75
1. Create an `ios/RNCalculator.h` file and fill it with the following code:
@@ -124,7 +124,7 @@ Pod::Spec.new do |s|
124
124
end
125
125
```
126
126
127
-
### <aname="android-native" />[[Native Module] Create the Android implementation](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/)
127
+
### <aname="android-native" />[[Native Module] Create the Android implementation](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/7aca0fb5af0ba13e854a0f51f2953389668ee328)
128
128
129
129
1. Create a folder `calculator/android`
130
130
1. Create a file `calculator/android/build.gradle` and add this code:
@@ -231,7 +231,7 @@ end
231
231
}
232
232
```
233
233
234
-
### <a name="test-native"/>[[Native Module] Test The Native Module](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/)
234
+
### <a name="test-native"/>[[Native Module] Test The Native Module](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/af2d57e53f5f5a423329966ac14beeeff2a42460)
235
235
236
236
1. At the same level of calculator run `npx react-native init OldArchitecture --version 0.70.0-rc.2`
237
237
1.`cd OldArchitecture && yarn add ../calculator`
@@ -277,7 +277,7 @@ end
277
277
278
278
**Note:** OldArchitecture app has not been committed not to pollute the repository.
279
279
280
-
### <a name="js-spec"/>[[TurboModule] Add the JavaScript specs](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/)
280
+
### <a name="js-spec"/>[[TurboModule] Add the JavaScript specs](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/019e750a75992dfb04f39060cdd4887695ef5a19)
281
281
282
282
1.`touch calculator/src/NativeCalculator.js`
283
283
1. Paste the following code:
@@ -295,7 +295,7 @@ end
295
295
): ?Spec);
296
296
```
297
297
298
-
### <a name="codegen"/>[[TurboModule] Set up CodeGen](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/)
298
+
### <a name="codegen"/>[[TurboModule] Set up CodeGen](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/ea87b8b5e569bf53bcf7b3b071cc507491712f40)
299
299
300
300
1. Open the `calculator/package.json`
301
301
1. Add the following snippet at the end of it:
@@ -311,7 +311,7 @@ end
311
311
}
312
312
```
313
313
314
-
### <a name="android-gradle"/>[[TurboModule] Set up build.gradle](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/)
314
+
### <a name="android-gradle"/>[[TurboModule] Set up build.gradle](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/1c13c7511f2eb215756e2a8c49cd44e9b9f237a9)
315
315
316
316
1. Open the `calculator/android/build.gradle` file and update the code as follows:
### <a name="ios-autolinking" />[[TurboModule] Set up `podspec` file](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/)
333
+
### <a name="ios-autolinking" />[[TurboModule] Set up `podspec` file](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/9fd0a9eba86a4609b1eedc3035903b7309b860c8)
334
334
335
335
1. Open the `calculator/calculator.podspec` file
336
336
1. Before the `Pod::Spec.newdo|s|` add the following code:
@@ -355,7 +355,7 @@ end
355
355
s.dependency"ReactCommon/turbomodule/core"
356
356
end
357
357
358
-
### <a name="ios-tm-code"/>[[TurboModule] Update the Native iOS code](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/)
358
+
### <a name="ios-tm-code"/>[[TurboModule] Update the Native iOS code](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/8b69380bb5b1defc90f9b0b6b67d6b83e845da06)
359
359
360
360
1. In the `ios/RNCalculator` folder, rename the `RNCalculator.m` into `RNCalculator.mm`
361
361
1. Open it and replace its content with:
@@ -413,7 +413,7 @@ end
413
413
@end
414
414
```
415
415
416
-
### <a name="android-backward"/>[[TurboModule] Android: Convert ReactPackage to a backward compatible TurboReactPackage](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/)
416
+
### <a name="android-backward"/>[[TurboModule] Android: Convert ReactPackage to a backward compatible TurboReactPackage](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/2be8af1a5fa5a8a64d142efde13e3f8bedef302b)
417
417
418
418
1. Open the `calculator/android/src/main/java/com/rnnewarchitecturelibrary/CalculatorModule.java` and modify it as it follows:
419
419
```diff
@@ -482,7 +482,7 @@ end
482
482
}
483
483
```
484
484
485
-
### <a name="android-sourceset"/>[[TurboModule] Android: Update the Native code to use two sourcesets](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/)
485
+
### <a name="android-sourceset"/>[[TurboModule] Android: Update the Native code to use two sourcesets](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/a8a8225465d5cccab567ab2d1ca15673e444632e)
486
486
487
487
1. Open the `calculator/android/build.gradle` file and update the code as it follows:
488
488
```diff
@@ -591,7 +591,7 @@ end
591
591
}
592
592
```
593
593
594
-
### <a name="android-refactor" />[[TurboModule] Android: Refactor the code to use a shared implementation](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/)
594
+
### <a name="android-refactor" />[[TurboModule] Android: Refactor the code to use a shared implementation](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/1110898284f081b7a00f8ac978664a7b74760b68)
595
595
596
596
1. Create a new `calculator/android/src/main/java/com/rnnewarchitecturelibrary/CalculatorModuleImpl.java` file (notice that the `src`'s subfolder is now `main`) and paste the following code:
597
597
```java
@@ -694,7 +694,7 @@ end
694
694
}
695
695
1. Remove the `android/src/main/java/com/rnnewarchitecturelibrary/CalculatorModule.java` (the one in the `main` folder).
### <a name="tm-test"/>[[TurboModule] Test the Turbomodule]()
706
+
### <a name="tm-test"/>[[TurboModule] Test the Turbomodule](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/99ff1accc997d466d243fb37f308bcc774034abc)
707
707
708
708
1. At the same level of calculator run `npx react-native init NewArchitecture --version 0.70.0-rc.2`
0 commit comments