@applicaster/zapp-react-native-ui-components 15.0.0-rc.115 → 15.0.0-rc.117

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,6 +14,7 @@ import { tvPluginsWithCellRenderer } from "../../const";
14
14
  import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
15
15
  import type { BehaviorSubject } from "rxjs";
16
16
  import { useCallbackActions } from "@applicaster/zapp-react-native-utils/zappFrameworkUtils/HookCallback/useCallbackActions";
17
+ import { isNilOrEmpty } from "@applicaster/zapp-react-native-utils/reactUtils/helpers";
17
18
 
18
19
  export type RiverItemType = {
19
20
  item: ZappUIComponent;
@@ -112,33 +113,38 @@ function RiverItemComponent(props: RiverItemType) {
112
113
  CellRenderer = undefined;
113
114
  }
114
115
 
115
- React.useEffect(() => {
116
- riverLogger.log({
117
- message: "mounting component",
118
- data: { item, feedUrl, Component, CellRenderer },
119
- jsOnly: true,
120
- });
116
+ const isComponentMissing = isNilOrEmpty(Component);
121
117
 
122
- if (!CellRenderer && !isGroup(item)) {
118
+ /**
119
+ * TODO: Move this plugin existence check further up the stack (before ComponentsMap).
120
+ * Filtering items at the list-rendering or data-processing level would prevent
121
+ * mounting RiverItem entirely for missing components.
122
+ */
123
+ React.useEffect(() => {
124
+ if (isComponentMissing) {
123
125
  riverLogger.warning({
124
- message: "Cell Renderer is null - will fallback to default cell",
125
- data: { item, CellRenderer },
126
+ message: `Component ${item.component_type} is null - skipping rendering`,
127
+ });
128
+
129
+ onLoadFinished(index);
130
+ } else {
131
+ riverLogger.log({
132
+ message: "mounting component",
133
+ data: { item, feedUrl, Component, CellRenderer },
126
134
  jsOnly: true,
127
135
  });
136
+
137
+ if (!CellRenderer && !isGroup(item)) {
138
+ riverLogger.warning({
139
+ message: "Cell Renderer is null - will fallback to default cell",
140
+ data: { item, CellRenderer },
141
+ jsOnly: true,
142
+ });
143
+ }
128
144
  }
129
145
  }, []);
130
146
 
131
- if (!readyToBeDisplayed) {
132
- return null;
133
- }
134
-
135
- if (Component === null || typeof Component === "undefined") {
136
- riverLogger.warning({
137
- message: `Component ${item.component_type} is null - skipping rendering`,
138
- });
139
-
140
- onLoadFinished(index);
141
-
147
+ if (!readyToBeDisplayed || isComponentMissing) {
142
148
  return null;
143
149
  }
144
150
 
@@ -144,12 +144,23 @@ New signature: {Component, ErrorComponent, LoadingComponent, options}`
144
144
  [props, parent]
145
145
  );
146
146
 
147
+ const hasError = !!zappPipesData?.error;
148
+
147
149
  React.useEffect(() => {
148
150
  if (!skipOnLoadFinished && !isLoading) {
149
151
  onLoadFinished();
150
152
  }
151
153
  }, [isLoading]);
152
154
 
155
+ React.useEffect(() => {
156
+ if (hasError) {
157
+ onLoadFailed?.({
158
+ error: zappPipesData.error,
159
+ index: componentIndex,
160
+ });
161
+ }
162
+ }, [hasError, componentIndex, onLoadFailed, zappPipesData?.error]);
163
+
153
164
  if (isDataSourceEmpty(props) && allowsEmptyDataSource) {
154
165
  return RenderComponent(Component, componentProps);
155
166
  }
@@ -158,12 +169,7 @@ New signature: {Component, ErrorComponent, LoadingComponent, options}`
158
169
  return RenderComponent(LoadingComponent || Placeholder, componentProps);
159
170
  }
160
171
 
161
- if (zappPipesData?.error) {
162
- onLoadFailed?.({
163
- error: zappPipesData.error,
164
- index: componentIndex,
165
- });
166
-
172
+ if (hasError) {
167
173
  return RenderComponent(ErrorComponent, componentProps);
168
174
  }
169
175
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "15.0.0-rc.115",
3
+ "version": "15.0.0-rc.117",
4
4
  "description": "Applicaster Zapp React Native ui components for the Quick Brick App",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -28,10 +28,10 @@
28
28
  },
29
29
  "homepage": "https://github.com/applicaster/quickbrick#readme",
30
30
  "dependencies": {
31
- "@applicaster/applicaster-types": "15.0.0-rc.115",
32
- "@applicaster/zapp-react-native-bridge": "15.0.0-rc.115",
33
- "@applicaster/zapp-react-native-redux": "15.0.0-rc.115",
34
- "@applicaster/zapp-react-native-utils": "15.0.0-rc.115",
31
+ "@applicaster/applicaster-types": "15.0.0-rc.117",
32
+ "@applicaster/zapp-react-native-bridge": "15.0.0-rc.117",
33
+ "@applicaster/zapp-react-native-redux": "15.0.0-rc.117",
34
+ "@applicaster/zapp-react-native-utils": "15.0.0-rc.117",
35
35
  "fast-json-stable-stringify": "^2.1.0",
36
36
  "promise": "^8.3.0",
37
37
  "url": "^0.11.0",