Skip to content

Commit 7891c91

Browse files
Add New arch only support status (#1812)
* Add New arch only support status * Update README.md
1 parent f3b21b7 commit 7891c91

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
- #### `template`
140140
**(boolean)** - signify that a library is a new project template.
141141
- #### `newArchitecture`
142-
**(boolean)** - signify that a library supports, or not, the New Architecture. Skipping the field will result in "untested" status, unless automatic support detection returned a result. You can provide additional context with the `newArchitectureNote` field, if needed.
142+
**(boolean|'new-arch-only')** - signify that a library supports both, or not, the New Architecture and the Old Architecture or only the New Architecture. Skipping the field will result in "untested" status, unless automatic support detection returned a result. You can provide additional context with the `newArchitectureNote` field, if needed.
143143

144144
> [!TIP]
145145
> Set `newArchitecture` field only when automatic architecture detection fails for your package, despite it supports the New Architecture.

components/Library/NewArchitectureTag.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function NewArchitectureTag({ library }: Props) {
2222
const icon =
2323
status === NewArchSupportStatus.Unsupported ? (
2424
<XIcon fill={getIconColor(status, isDark)} width={11} height={11} />
25-
) : status === NewArchSupportStatus.Supported ? (
25+
) : status === NewArchSupportStatus.Supported || status === NewArchSupportStatus.NewArchOnly ? (
2626
<Check fill={getIconColor(status, isDark)} width={12} height={12} />
2727
) : (
2828
<Question fill={getIconColor(status, isDark)} width={11} height={11} />
@@ -53,10 +53,19 @@ export function NewArchitectureTag({ library }: Props) {
5353
<HtmlElements.A
5454
href="https://reactnative.dev/docs/new-architecture-intro"
5555
target="_blank">
56-
<Tag label="New Architecture" icon={icon} tagStyle={getTagColor(status, isDark)} />
56+
<Tag
57+
label={
58+
status === NewArchSupportStatus.NewArchOnly
59+
? 'New Architecture Only'
60+
: 'New Architecture'
61+
}
62+
icon={icon}
63+
tagStyle={getTagColor(status, isDark)}
64+
/>
5765
</HtmlElements.A>
5866
</View>
5967
}>
68+
{status === NewArchSupportStatus.NewArchOnly && 'Only Supports New Architecture'}
6069
{status === NewArchSupportStatus.Supported && 'Supports New Architecture'}
6170
{status === NewArchSupportStatus.Unsupported && 'Does not support New Architecture'}
6271
{status === NewArchSupportStatus.Untested && 'Untested with New Architecture'}
@@ -71,6 +80,7 @@ export function NewArchitectureTag({ library }: Props) {
7180

7281
function getIconColor(status: NewArchSupportStatus, isDark: boolean) {
7382
switch (status) {
83+
case NewArchSupportStatus.NewArchOnly:
7484
case NewArchSupportStatus.Supported:
7585
return colors.primaryDark;
7686
case NewArchSupportStatus.Unsupported:
@@ -82,6 +92,7 @@ function getIconColor(status: NewArchSupportStatus, isDark: boolean) {
8292

8393
function getTagColor(status: NewArchSupportStatus, isDark: boolean) {
8494
switch (status) {
95+
case NewArchSupportStatus.NewArchOnly:
8596
case NewArchSupportStatus.Supported:
8697
return {
8798
backgroundColor: isDark ? '#142733' : '#edf6fc',

util/newArchStatus.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Library } from '~/types';
22

33
export enum NewArchSupportStatus {
4+
NewArchOnly = 'new-arch-only',
45
Supported = 'supported',
56
Unsupported = 'unsupported',
67
Untested = 'untested',
@@ -23,6 +24,8 @@ export function getNewArchSupportStatus({ newArchitecture, github, expoGo }: Lib
2324
}
2425

2526
switch (flag) {
27+
case 'new-arch-only':
28+
return NewArchSupportStatus.NewArchOnly;
2629
case true:
2730
return NewArchSupportStatus.Supported;
2831
case false:

util/search.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,22 @@ export function handleFilterLibraries({
182182

183183
if (
184184
newArchitecture === 'false' &&
185-
[NewArchSupportStatus.Supported, NewArchSupportStatus.Untested].includes(newArchStatus)
185+
[
186+
NewArchSupportStatus.NewArchOnly,
187+
NewArchSupportStatus.Supported,
188+
NewArchSupportStatus.Untested,
189+
].includes(newArchStatus)
186190
) {
187191
return false;
188192
}
189193

190194
if (
191195
newArchitecture === 'untested' &&
192-
[NewArchSupportStatus.Supported, NewArchSupportStatus.Unsupported].includes(newArchStatus)
196+
[
197+
NewArchSupportStatus.NewArchOnly,
198+
NewArchSupportStatus.Supported,
199+
NewArchSupportStatus.Unsupported,
200+
].includes(newArchStatus)
193201
) {
194202
return false;
195203
}

0 commit comments

Comments
 (0)