Commit 09e7a3a
committed
feat: merge view+module native templates (#562)
This adds new templates that use `Kotlin` and `Objective-C`. The
templates each have a native view and a native module included.
1. With 993d5cd, the new arch and mixed
arch views will no longer have the `View` suffix in their codegen names.
This doesn't break codegen as the name field is arbitrary as it isn't
stated otherwise [in the new arch working group
documents](https://github.com/reactwg/react-native-new-architecture/blob/main/docs/enable-libraries-prerequisites.md#configure-codegen).
One important matter to remember here is to make sure we pass the `RN`
prefix since headers can conflict.
2. No more Java templates! I've removed them all for the sake of Kotlin.
3. I've removed templates like view-new (new arch-only view template)
since we now have view+module templates and it would be hard to maintain
the old model.
4. I kept `module-legacy`, `module-mixed`, and `module-new` since they
are used by cpp.
5. I kept `module-legacy`, and `view-legacy` since they are used by
Swift.
1. Go to `packages/create-react-native-library`.
7. Call `yarn prepare` to build the CLI.
8. Run `./bin/create-react-native-library` to run the CLI you built.
9. Fill in the name, email, etc., and make sure to select ` Fabric view
and Turbo module with backward compat`.
10. Go to the library you created and make sure to build the following:
a. Android with old architecture
b. iOS with old architecture
c. Android with new architecture
d. iOS with new architecture1 parent 091a768 commit 09e7a3a
File tree
44 files changed
+525
-238
lines changed- .github/workflows
- packages/create-react-native-library
- src
- templates
- common-example/example/src
- common
- kotlin-view-library-legacy/android/src/main/java/com/{%- project.package_dir %}
- kotlin-view-library-mixed/android/src
- main/java/com/{%- project.package_dir %}
- newarch
- oldarch
- kotlin-view-library-new/android/src/main/java/com/{%- project.package_dir %}
- kotlin-view-mixed/android/src/main/java/com/{%- project.package_dir %}
- kotlin-view-new/android/src/main/java/com/{%- project.package_dir %}
- native-view-mixed
- src
- native-view-new
- src
- objc-view-library-legacy/ios
- objc-view-library-mixed/ios
- objc-view-library-new/ios
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
44 files changed
+525
-238
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
39 | 36 | | |
40 | 37 | | |
41 | | - | |
| 38 | + | |
42 | 39 | | |
43 | 40 | | |
44 | 41 | | |
45 | | - | |
46 | | - | |
47 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
49 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
50 | 55 | | |
51 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
52 | 59 | | |
53 | | - | |
| 60 | + | |
54 | 61 | | |
55 | 62 | | |
56 | 63 | | |
57 | 64 | | |
58 | 65 | | |
59 | | - | |
| 66 | + | |
60 | 67 | | |
61 | 68 | | |
62 | 69 | | |
63 | | - | |
| 70 | + | |
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | 77 | | |
99 | 78 | | |
100 | 79 | | |
| |||
171 | 150 | | |
172 | 151 | | |
173 | 152 | | |
174 | | - | |
175 | | - | |
| 153 | + | |
176 | 154 | | |
177 | | - | |
178 | 155 | | |
179 | 156 | | |
180 | 157 | | |
181 | | - | |
182 | | - | |
| 158 | + | |
183 | 159 | | |
184 | | - | |
185 | 160 | | |
186 | 161 | | |
187 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
50 | 63 | | |
51 | 64 | | |
52 | 65 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
57 | 81 | | |
58 | 82 | | |
59 | 83 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
66 | 103 | | |
67 | 104 | | |
68 | 105 | | |
69 | | - | |
70 | | - | |
| 106 | + | |
| 107 | + | |
71 | 108 | | |
72 | 109 | | |
73 | 110 | | |
| |||
86 | 123 | | |
87 | 124 | | |
88 | 125 | | |
| 126 | + | |
89 | 127 | | |
90 | | - | |
91 | 128 | | |
92 | | - | |
93 | | - | |
| 129 | + | |
94 | 130 | | |
95 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
96 | 134 | | |
97 | 135 | | |
98 | 136 | | |
| |||
117 | 155 | | |
118 | 156 | | |
119 | 157 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 158 | + | |
128 | 159 | | |
129 | 160 | | |
130 | 161 | | |
| |||
169 | 200 | | |
170 | 201 | | |
171 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
172 | 218 | | |
173 | 219 | | |
174 | 220 | | |
| |||
194 | 240 | | |
195 | 241 | | |
196 | 242 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | 243 | | |
208 | 244 | | |
209 | 245 | | |
| |||
599 | 635 | | |
600 | 636 | | |
601 | 637 | | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
609 | 643 | | |
610 | 644 | | |
611 | 645 | | |
| |||
646 | 680 | | |
647 | 681 | | |
648 | 682 | | |
649 | | - | |
650 | | - | |
| 683 | + | |
| 684 | + | |
651 | 685 | | |
652 | 686 | | |
653 | 687 | | |
| |||
735 | 769 | | |
736 | 770 | | |
737 | 771 | | |
738 | | - | |
| 772 | + | |
739 | 773 | | |
740 | 774 | | |
741 | 775 | | |
| |||
745 | 779 | | |
746 | 780 | | |
747 | 781 | | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
| 782 | + | |
753 | 783 | | |
754 | | - | |
755 | | - | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
756 | 789 | | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
761 | | - | |
| 790 | + | |
762 | 791 | | |
763 | 792 | | |
764 | | - | |
765 | | - | |
766 | | - | |
| 793 | + | |
767 | 794 | | |
768 | 795 | | |
769 | 796 | | |
| |||
0 commit comments