@coinbase/cds-mobile-visualization 3.4.0-beta.15 → 3.4.0-beta.16
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.
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,12 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 3.4.0-beta.16 (1/28/2026 PST)
|
|
12
|
+
|
|
13
|
+
#### 🐞 Fixes
|
|
14
|
+
|
|
15
|
+
- Fix every context rendering a second time in CDS Chart for performance. [[#339](https://github.com/avocado-cb/cds/pull/339)] [DEX2-874]
|
|
16
|
+
|
|
11
17
|
## 3.4.0-beta.15 (1/27/2026 PST)
|
|
12
18
|
|
|
13
19
|
#### 🐞 Fixes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartContextBridge.d.ts","sourceRoot":"","sources":["../../src/chart/ChartContextBridge.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ChartContextBridge.d.ts","sourceRoot":"","sources":["../../src/chart/ChartContextBridge.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAuF/B;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK,CAAC,SAAS,CAAC;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC;IACtF,OAAO,CAAC,eAAe,CAAY;IAEnC,MAAM;CAOP;AA4BD,MAAM,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG;IACtD,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;CAClD,CAAC;AAmCF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAE3E;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,kBAAkB,CAgB1D"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { CartesianChartContextValue } from './utils';
|
|
2
|
+
export declare const CartesianChartContext: import('react').Context<
|
|
3
|
+
CartesianChartContextValue | undefined
|
|
4
|
+
>;
|
|
2
5
|
export declare const useCartesianChartContext: () => CartesianChartContextValue;
|
|
3
6
|
export declare const CartesianChartProvider: import('react').Provider<
|
|
4
7
|
CartesianChartContextValue | undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartProvider.d.ts","sourceRoot":"","sources":["../../src/chart/ChartProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ChartProvider.d.ts","sourceRoot":"","sources":["../../src/chart/ChartProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAE1D,eAAO,MAAM,qBAAqB,iEAEjC,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAAO,0BAQ3C,CAAC;AAEF,eAAO,MAAM,sBAAsB,kEAAiC,CAAC"}
|
|
@@ -6,6 +6,17 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import * as React from 'react';
|
|
9
|
+
import { ThemeContext } from '@coinbase/cds-mobile/system/ThemeProvider';
|
|
10
|
+
import { ScrubberContext } from './utils/context';
|
|
11
|
+
import { CartesianChartContext } from './ChartProvider';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Whitelist of contexts that should be bridged to the Skia canvas.
|
|
15
|
+
* Only these contexts will be made available inside the chart's Skia tree.
|
|
16
|
+
* This improves performance by avoiding the overhead of rendering every bridged context.
|
|
17
|
+
*/
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
const BRIDGED_CONTEXTS = [ThemeContext, CartesianChartContext, ScrubberContext];
|
|
9
20
|
|
|
10
21
|
/**
|
|
11
22
|
* Represents a react-internal tree node.
|
|
@@ -14,7 +25,7 @@ import * as React from 'react';
|
|
|
14
25
|
/**
|
|
15
26
|
* Represents a tree node selector for traversal.
|
|
16
27
|
*/
|
|
17
|
-
|
|
28
|
+
|
|
18
29
|
/**
|
|
19
30
|
* Traverses up or down a React tree, return `true` to stop and select a node.
|
|
20
31
|
*/
|
|
@@ -104,7 +115,7 @@ function useTreeNode() {
|
|
|
104
115
|
return treeNode;
|
|
105
116
|
}
|
|
106
117
|
/**
|
|
107
|
-
* Returns a map of
|
|
118
|
+
* Returns a map of whitelisted contexts and their values.
|
|
108
119
|
*/
|
|
109
120
|
function useContextMap() {
|
|
110
121
|
const treeNode = useTreeNode();
|
|
@@ -118,7 +129,7 @@ function useContextMap() {
|
|
|
118
129
|
// https://github.com/facebook/react/pull/28226
|
|
119
130
|
const enableRenderableContext = node.type._context === undefined && node.type.Provider === node.type;
|
|
120
131
|
const context = enableRenderableContext ? node.type : node.type._context;
|
|
121
|
-
if (context && context !== TreeNodeContext && !contextMap.has(context)) {
|
|
132
|
+
if (context && context !== TreeNodeContext && BRIDGED_CONTEXTS.includes(context) && !contextMap.has(context)) {
|
|
122
133
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
123
134
|
contextMap.set(context, React.useContext(wrapContext(context)));
|
|
124
135
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext, useContext } from 'react';
|
|
2
|
-
const CartesianChartContext = /*#__PURE__*/createContext(undefined);
|
|
2
|
+
export const CartesianChartContext = /*#__PURE__*/createContext(undefined);
|
|
3
3
|
export const useCartesianChartContext = () => {
|
|
4
4
|
const context = useContext(CartesianChartContext);
|
|
5
5
|
if (!context) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-mobile-visualization",
|
|
3
|
-
"version": "3.4.0-beta.
|
|
3
|
+
"version": "3.4.0-beta.16",
|
|
4
4
|
"description": "Coinbase Design System - Mobile Visualization Native",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"CHANGELOG"
|
|
37
37
|
],
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@coinbase/cds-common": "^8.
|
|
39
|
+
"@coinbase/cds-common": "^8.40.0",
|
|
40
40
|
"@coinbase/cds-lottie-files": "^3.3.4",
|
|
41
|
-
"@coinbase/cds-mobile": "^8.
|
|
41
|
+
"@coinbase/cds-mobile": "^8.40.0",
|
|
42
42
|
"@coinbase/cds-utils": "^2.3.5",
|
|
43
43
|
"@shopify/react-native-skia": "^1.12.4 || ^2.0.0",
|
|
44
44
|
"react": "^18.3.1",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"@babel/preset-env": "^7.28.0",
|
|
58
58
|
"@babel/preset-react": "^7.27.1",
|
|
59
59
|
"@babel/preset-typescript": "^7.27.1",
|
|
60
|
-
"@coinbase/cds-common": "^8.
|
|
60
|
+
"@coinbase/cds-common": "^8.40.0",
|
|
61
61
|
"@coinbase/cds-lottie-files": "^3.3.4",
|
|
62
|
-
"@coinbase/cds-mobile": "^8.
|
|
62
|
+
"@coinbase/cds-mobile": "^8.40.0",
|
|
63
63
|
"@coinbase/cds-utils": "^2.3.5",
|
|
64
64
|
"@shopify/react-native-skia": "1.12.4",
|
|
65
65
|
"@types/react": "^18.3.12",
|