Skip to content

Commit 11f3be4

Browse files
committed
fix: skip children blocks in Pacer and Table Subscribe
Dual-mode Subscribe children compiled from .tsrx are tagged block functions. Guard those with isChildrenBlock so element children render instead of being invoked as render props.
1 parent 35f2f4c commit 11f3be4

16 files changed

Lines changed: 139 additions & 22 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@octanejs/tanstack-pacer': patch
3+
'@octanejs/tanstack-table': patch
4+
---
5+
6+
Skip compiler-tagged children blocks in dual-mode `Subscribe` helpers so `.tsrx` element children render instead of being invoked as render props.

‎packages/tanstack-pacer/src/async-batcher/useAsyncBatcher.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useMemo, useState } from 'octane';
1+
import { useEffect, useMemo, useState, isChildrenBlock } from 'octane';
22
import type { OctaneNode } from 'octane';
33
import { AsyncBatcher } from '@tanstack/pacer/async-batcher';
44
import { shallow } from '@octanejs/tanstack-store';
@@ -81,7 +81,7 @@ export function useAsyncBatcher<TValue, TSelected = {}>(
8181
subscribeSlot,
8282
);
8383

84-
return typeof props.children === 'function'
84+
return typeof props.children === 'function' && !isChildrenBlock(props.children)
8585
? (props.children as (state: TSelected) => OctaneNode)(selected)
8686
: props.children;
8787
};

‎packages/tanstack-pacer/src/async-debouncer/useAsyncDebouncer.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useMemo, useState } from 'octane';
1+
import { useEffect, useMemo, useState, isChildrenBlock } from 'octane';
22
import type { OctaneNode } from 'octane';
33
import { AsyncDebouncer } from '@tanstack/pacer/async-debouncer';
44
import { shallow } from '@octanejs/tanstack-store';
@@ -88,7 +88,7 @@ export function useAsyncDebouncer<TFn extends AnyAsyncFunction, TSelected = {}>(
8888
subscribeSlot,
8989
);
9090

91-
return typeof props.children === 'function'
91+
return typeof props.children === 'function' && !isChildrenBlock(props.children)
9292
? (props.children as (state: TSelected) => OctaneNode)(selected)
9393
: props.children;
9494
};

‎packages/tanstack-pacer/src/async-queuer/useAsyncQueuer.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useMemo, useState } from 'octane';
1+
import { useEffect, useMemo, useState, isChildrenBlock } from 'octane';
22
import type { OctaneNode } from 'octane';
33
import { AsyncQueuer } from '@tanstack/pacer/async-queuer';
44
import { shallow } from '@octanejs/tanstack-store';
@@ -81,7 +81,7 @@ export function useAsyncQueuer<TValue, TSelected = {}>(
8181
subscribeSlot,
8282
);
8383

84-
return typeof props.children === 'function'
84+
return typeof props.children === 'function' && !isChildrenBlock(props.children)
8585
? (props.children as (state: TSelected) => OctaneNode)(selected)
8686
: props.children;
8787
};

‎packages/tanstack-pacer/src/async-rate-limiter/useAsyncRateLimiter.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useMemo, useState } from 'octane';
1+
import { useEffect, useMemo, useState, isChildrenBlock } from 'octane';
22
import type { OctaneNode } from 'octane';
33
import { AsyncRateLimiter } from '@tanstack/pacer/async-rate-limiter';
44
import { shallow } from '@octanejs/tanstack-store';
@@ -86,7 +86,7 @@ export function useAsyncRateLimiter<TFn extends AnyAsyncFunction, TSelected = {}
8686
subscribeSlot,
8787
);
8888

89-
return typeof props.children === 'function'
89+
return typeof props.children === 'function' && !isChildrenBlock(props.children)
9090
? (props.children as (state: TSelected) => OctaneNode)(selected)
9191
: props.children;
9292
};

‎packages/tanstack-pacer/src/async-throttler/useAsyncThrottler.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useMemo, useState } from 'octane';
1+
import { useEffect, useMemo, useState, isChildrenBlock } from 'octane';
22
import type { OctaneNode } from 'octane';
33
import { AsyncThrottler } from '@tanstack/pacer/async-throttler';
44
import { shallow } from '@octanejs/tanstack-store';
@@ -81,7 +81,7 @@ export function useAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}>(
8181
subscribeSlot,
8282
);
8383

84-
return typeof props.children === 'function'
84+
return typeof props.children === 'function' && !isChildrenBlock(props.children)
8585
? (props.children as (state: TSelected) => OctaneNode)(selected)
8686
: props.children;
8787
};

‎packages/tanstack-pacer/src/batcher/useBatcher.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useMemo, useState } from 'octane';
1+
import { useEffect, useMemo, useState, isChildrenBlock } from 'octane';
22
import type { OctaneNode } from 'octane';
33
import { Batcher } from '@tanstack/pacer/batcher';
44
import { shallow } from '@octanejs/tanstack-store';
@@ -74,7 +74,7 @@ export function useBatcher<TValue, TSelected = {}>(
7474
subscribeSlot,
7575
);
7676

77-
return typeof props.children === 'function'
77+
return typeof props.children === 'function' && !isChildrenBlock(props.children)
7878
? (props.children as (state: TSelected) => OctaneNode)(selected)
7979
: props.children;
8080
};

‎packages/tanstack-pacer/src/debouncer/useDebouncer.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useMemo, useState } from 'octane';
1+
import { useEffect, useMemo, useState, isChildrenBlock } from 'octane';
22
import type { OctaneNode } from 'octane';
33
import { Debouncer } from '@tanstack/pacer/debouncer';
44
import { shallow } from '@octanejs/tanstack-store';
@@ -88,7 +88,7 @@ export function useDebouncer<TFn extends AnyFunction, TSelected = {}>(
8888
subscribeSlot,
8989
);
9090

91-
return typeof props.children === 'function'
91+
return typeof props.children === 'function' && !isChildrenBlock(props.children)
9292
? (props.children as (state: TSelected) => OctaneNode)(selected)
9393
: props.children;
9494
};

‎packages/tanstack-pacer/src/queuer/useQueuer.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useMemo, useState } from 'octane';
1+
import { useEffect, useMemo, useState, isChildrenBlock } from 'octane';
22
import type { OctaneNode } from 'octane';
33
import { Queuer } from '@tanstack/pacer/queuer';
44
import { shallow } from '@octanejs/tanstack-store';
@@ -76,7 +76,7 @@ export function useQueuer<TValue, TSelected = {}>(
7676
subscribeSlot,
7777
);
7878

79-
return typeof props.children === 'function'
79+
return typeof props.children === 'function' && !isChildrenBlock(props.children)
8080
? (props.children as (state: TSelected) => OctaneNode)(selected)
8181
: props.children;
8282
};

‎packages/tanstack-pacer/src/rate-limiter/useRateLimiter.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useMemo, useState } from 'octane';
1+
import { useEffect, useMemo, useState, isChildrenBlock } from 'octane';
22
import type { OctaneNode } from 'octane';
33
import { RateLimiter } from '@tanstack/pacer/rate-limiter';
44
import { shallow } from '@octanejs/tanstack-store';
@@ -87,7 +87,7 @@ export function useRateLimiter<TFn extends AnyFunction, TSelected = {}>(
8787
subscribeSlot,
8888
);
8989

90-
return typeof props.children === 'function'
90+
return typeof props.children === 'function' && !isChildrenBlock(props.children)
9191
? (props.children as (state: TSelected) => OctaneNode)(selected)
9292
: props.children;
9393
};

0 commit comments

Comments
 (0)