@gradio/dataframe 0.23.2 → 0.23.4

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
@@ -1,5 +1,19 @@
1
1
  # @gradio/dataframe
2
2
 
3
+ ## 0.23.4
4
+
5
+ ### Fixes
6
+
7
+ - [#13240](https://github.com/gradio-app/gradio/pull/13240) [`0d670ad`](https://github.com/gradio-app/gradio/commit/0d670adf41a0b510f7fd745495dce1664d38f0e5) - Fix browser freeze when a dataframe's value is set (e.g. via a tab select event), and only dispatch the tabs select event when the selected tab actually changes. Thanks @freddyaboulton!
8
+
9
+ ## 0.23.3
10
+
11
+ ### Dependency updates
12
+
13
+ - @gradio/client@2.2.1
14
+ - @gradio/upload@0.17.10
15
+ - @gradio/markdown-code@0.8.0
16
+
3
17
  ## 0.23.2
4
18
 
5
19
  ### Fixes
@@ -206,7 +206,17 @@
206
206
  globalFilterFn: "includesString",
207
207
  enableSorting: true,
208
208
  enableMultiSort: true,
209
- maxMultiSortColCount: 3
209
+ maxMultiSortColCount: 3,
210
+ // This table has no pagination or row-expansion UI, so TanStack's
211
+ // automatic page-index/expanded resets are pure churn: when `data`
212
+ // changes, the row-model memos' onChange fires `_autoResetPageIndex`,
213
+ // which calls setState({ pagination }) -> our onStateChange bumps
214
+ // `version` -> the `rows`/`header_groups` $derived re-run -> the row
215
+ // model recomputes -> onChange fires again, an infinite microtask loop
216
+ // that freezes the page (see issue #13198). Disabling these resets
217
+ // removes the only internal setState that occurs during render.
218
+ autoResetPageIndex: false,
219
+ autoResetExpanded: false
210
220
  });
211
221
 
212
222
  let rows = $derived(table.getRowModel().rows);
@@ -60,10 +60,14 @@ export function createSvelteTable(options) {
60
60
  let state = $state(table.initialState);
61
61
  let version = $state(0);
62
62
  function updateOptions() {
63
- table.setOptions((prev) => {
64
- // mergeObjects creates lazy getters — `state` is NOT read here,
65
- // only when TanStack accesses the `state` property later.
66
- return mergeObjects(prev, options, {
63
+ table.setOptions(() => {
64
+ // Always merge from resolvedOptions instead of prev to prevent
65
+ // unbounded getter chains. Using prev would add a new mergeObjects
66
+ // layer on every call; properties not in the overrides would have
67
+ // to traverse every previous layer, causing stack overflow.
68
+ // TanStack's setOptions already re-applies feature defaults via
69
+ // mergeOptions, so we don't lose any internal defaults.
70
+ return mergeObjects(resolvedOptions, options, {
67
71
  state: mergeObjects(state, options.state || {}),
68
72
  onStateChange: (updater) => {
69
73
  if (updater instanceof Function)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/dataframe",
3
- "version": "0.23.2",
3
+ "version": "0.23.4",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -17,13 +17,13 @@
17
17
  "@tanstack/virtual-core": "^3.13.6",
18
18
  "@gradio/atoms": "^0.24.0",
19
19
  "@gradio/checkbox": "^0.7.0",
20
- "@gradio/client": "^2.2.0",
21
20
  "@gradio/button": "^0.6.6",
21
+ "@gradio/client": "^2.2.1",
22
+ "@gradio/markdown-code": "^0.8.0",
22
23
  "@gradio/icons": "^0.15.1",
23
- "@gradio/markdown-code": "^0.7.0",
24
24
  "@gradio/statustracker": "^0.14.1",
25
- "@gradio/utils": "^0.12.2",
26
- "@gradio/upload": "^0.17.9"
25
+ "@gradio/upload": "^0.17.10",
26
+ "@gradio/utils": "^0.12.2"
27
27
  },
28
28
  "exports": {
29
29
  ".": {
@@ -39,7 +39,7 @@
39
39
  "./package.json": "./package.json"
40
40
  },
41
41
  "peerDependencies": {
42
- "svelte": ">=5.0.0"
42
+ "svelte": "^5.48.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@gradio/preview": "^0.16.2"
@@ -206,7 +206,17 @@
206
206
  globalFilterFn: "includesString",
207
207
  enableSorting: true,
208
208
  enableMultiSort: true,
209
- maxMultiSortColCount: 3
209
+ maxMultiSortColCount: 3,
210
+ // This table has no pagination or row-expansion UI, so TanStack's
211
+ // automatic page-index/expanded resets are pure churn: when `data`
212
+ // changes, the row-model memos' onChange fires `_autoResetPageIndex`,
213
+ // which calls setState({ pagination }) -> our onStateChange bumps
214
+ // `version` -> the `rows`/`header_groups` $derived re-run -> the row
215
+ // model recomputes -> onChange fires again, an infinite microtask loop
216
+ // that freezes the page (see issue #13198). Disabling these resets
217
+ // removes the only internal setState that occurs during render.
218
+ autoResetPageIndex: false,
219
+ autoResetExpanded: false
210
220
  });
211
221
 
212
222
  let rows = $derived(table.getRowModel().rows);
@@ -74,10 +74,14 @@ export function createSvelteTable<TData extends RowData>(
74
74
  let version = $state(0);
75
75
 
76
76
  function updateOptions(): void {
77
- table.setOptions((prev) => {
78
- // mergeObjects creates lazy getters — `state` is NOT read here,
79
- // only when TanStack accesses the `state` property later.
80
- return mergeObjects(prev, options, {
77
+ table.setOptions(() => {
78
+ // Always merge from resolvedOptions instead of prev to prevent
79
+ // unbounded getter chains. Using prev would add a new mergeObjects
80
+ // layer on every call; properties not in the overrides would have
81
+ // to traverse every previous layer, causing stack overflow.
82
+ // TanStack's setOptions already re-applies feature defaults via
83
+ // mergeOptions, so we don't lose any internal defaults.
84
+ return mergeObjects(resolvedOptions, options, {
81
85
  state: mergeObjects(state, options.state || {}),
82
86
  onStateChange: (updater: any) => {
83
87
  if (updater instanceof Function) state = updater(state);