-
Notifications
You must be signed in to change notification settings - Fork 43
[SDK-482] 0-84 #866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: upgrade/SDK-473-0-83
Are you sure you want to change the base?
[SDK-482] 0-84 #866
Changes from all commits
7e6f6e4
96bdf6b
d77a9f4
0478efb
4ece7ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,44 +1,23 @@ | ||
| /* eslint-disable @typescript-eslint/no-wrapper-object-types */ | ||
| import type { TurboModule } from 'react-native'; | ||
| import { TurboModuleRegistry } from 'react-native'; | ||
|
|
||
| // NOTE: No types can be imported because of the way new arch works, so we have | ||
| // to re-define the types here. | ||
| interface EmbeddedMessage { | ||
| metadata: { | ||
| messageId: string; | ||
| placementId: number; | ||
| campaignId?: number | null; | ||
| isProof?: boolean; | ||
| }; | ||
| elements: { | ||
| buttons?: | ||
| | { | ||
| id: string; | ||
| title?: string | null; | ||
| action: { type: string; data?: string } | null; | ||
| }[] | ||
| | null; | ||
| body?: string | null; | ||
| mediaUrl?: string | null; | ||
| mediaUrlCaption?: string | null; | ||
| defaultAction?: { type: string; data?: string } | null; | ||
| text?: { id: string; text?: string | null; label?: string | null }[] | null; | ||
| title?: string | null; | ||
| } | null; | ||
| payload?: { [key: string]: string | number | boolean | null } | null; | ||
| } | ||
|
|
||
| // Codegen (RN 0.84+) rejects unions that include array types (e.g. `T[] | U`, | ||
| // `string | string[]`). Use capital `Object` (not TS `object`) for loose maps; | ||
| // lowercase `object` is TSObjectKeyword and fails iOS/Android codegen. | ||
| export interface Spec extends TurboModule { | ||
| // Initialization | ||
| initializeWithApiKey( | ||
| apiKey: string, | ||
| config: { [key: string]: string | number | boolean | undefined | string[] }, | ||
| config: Object, | ||
| version: string | ||
| ): Promise<boolean>; | ||
|
|
||
| initialize2WithApiKey( | ||
| apiKey: string, | ||
| config: { [key: string]: string | number | boolean | undefined | string[] }, | ||
| config: Object, | ||
| version: string, | ||
| apiEndPointOverride: string | ||
| ): Promise<boolean>; | ||
|
|
@@ -122,12 +101,13 @@ export interface Spec extends TurboModule { | |
| // App links | ||
| handleAppLink(appLink: string): Promise<boolean>; | ||
|
|
||
| // Subscriptions | ||
| // Subscriptions (arrays only in spec — RN codegen rejects `T[] | null`; callers | ||
| // may still pass null at the bridge when using typed assertions.) | ||
| updateSubscriptions( | ||
| emailListIds: number[] | null, | ||
| unsubscribedChannelIds: number[] | null, | ||
| unsubscribedMessageTypeIds: number[] | null, | ||
| subscribedMessageTypeIds: number[] | null, | ||
| emailListIds: number[], | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment is honest about what's happening but the resulting contract is wrong. The TurboModule now declares That cast silences TS but does nothing at runtime. The Iterable backend treats Fix should be one of:
Option 1 is cleaner. Either way, this needs:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. RN codegen couldn’t parse number[] | null (and related unions) -- the spec was narrowed to number[] so the upgrade could build. Trying out available options now. |
||
| unsubscribedChannelIds: number[], | ||
| unsubscribedMessageTypeIds: number[], | ||
| subscribedMessageTypeIds: number[], | ||
|
Comment on lines
+104
to
+110
|
||
| campaignId: number, | ||
| templateId: number | ||
| ): void; | ||
|
|
@@ -151,11 +131,9 @@ export interface Spec extends TurboModule { | |
| endEmbeddedSession(): void; | ||
| startEmbeddedImpression(messageId: string, placementId: number): void; | ||
| pauseEmbeddedImpression(messageId: string): void; | ||
| getEmbeddedMessages( | ||
| placementIds: number[] | null | ||
| ): Promise<EmbeddedMessage[]>; | ||
| getEmbeddedMessages(placementIds: number[]): Promise<Object[]>; | ||
| trackEmbeddedClick( | ||
| message: EmbeddedMessage, | ||
| message: Object, | ||
| buttonId: string | null, | ||
| clickedUrl: string | null | ||
| ): void; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AGP version was stripped (
'com.android.tools.build:gradle:8.7.2'→"com.android.tools.build:gradle"). This silently delegates the AGP version to the react-native-gradle-plugin's BOM. If that's intentional for RN 0.84, please add a Groovy comment explaining why, since:If unintentional, pin to whatever AGP RN 0.84.1 ships with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for flagging this — the version removal is intentional.
This matches the RN 0.84 app template (
react-native-community/template0.84-stable) and thecreate-react-native-libraryexample pattern: the example app does not pin AGP/Kotlin/RNGP versions inbuildscript.Versions are resolved via
@react-native/gradle-plugin, which is included as a composite build insettings.gradle(pluginManagement { includeBuild(...) }+includeBuild(...)). The plugin’s version catalog (node_modules/@react-native/gradle-plugin/gradle/libs.versions.toml) defines AGP 8.12.0 and Kotlin 2.1.20 for RN 0.84.1. That’s the setup Meta documents for versionless classpath deps (see also facebook/react-native#48953).I added a comment above the classpath block in
example/android/build.gradleso future readers know this is deliberate and shouldn’t re-pin without a reason.Note: this applies to the example app only. The library’s
android/build.gradlestill pins AGP explicitly for standaloneandroid/builds (no RNGPincludeBuildthere). I’m updating that pin from8.7.2→8.12.0(and the library Gradle wrapper to meet AGP 8.12’s minimum) in a separate change so it stays aligned with our RN 0.84.1 target without fighting the host app’s RNGP-managed versions.