Skip to content

Fix angular input + API consistency#161

Open
benjavicente wants to merge 8 commits into
TanStack:mainfrom
benjavicente:fix-angular-input
Open

Fix angular input + API consistency#161
benjavicente wants to merge 8 commits into
TanStack:mainfrom
benjavicente:fix-angular-input

Conversation

@benjavicente
Copy link
Copy Markdown

@benjavicente benjavicente commented Feb 22, 2026

🎯 Changes

This PR does 2 things, both in injectQueuedValue:

  • value could be called on component initialization, causing injectQueuedValue to throw. I added a tests first to demonstrate the issue and then I added a commit to fix it. There was an example that tested against that error, but where the path where of the value() call wasn't reached (maybeSelector is not undefined).

    protected readonly queued = injectQueuedValue(this.value, null, { wait: 500 }, (state) => ({
    items: state.items,
    }))
    >(
    value: Signal<TValue>,
    initialValueOrOptions?: TValue | QueuerOptions<TValue>,
    initialOptionsOrSelector?:
    | QueuerOptions<TValue>
    | ((state: QueuerState<TValue>) => TSelected),
    maybeSelector?: (state: QueuerState<TValue>) => TSelected,
    ): QueuedSignal<TValue, TSelected> {
    const hasSelector = typeof initialOptionsOrSelector === 'function'
    const hasInitialValue =
    (initialOptionsOrSelector !== undefined && !hasSelector) ||
    maybeSelector !== undefined
    const initialValue = hasInitialValue
    ? (initialValueOrOptions as TValue)
    : value()

  • The injectQueuedValue was returning an array instead of a queued value. I guess that was a mistake, so I aligned the function to behave similar to the React api.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • New Features

    • injectQueuedValue now returns a callable queued-value object with built-in addItem() and queuer properties (replacing the prior tuple-style return).
  • Documentation

    • Updated Angular reference docs to reflect the new return shape and adjusted option types across related APIs; new QueuedValueSignal docs added; examples updated to match usage.
  • Tests

    • Added comprehensive tests covering usage, queue behavior, timing, and Angular integration.
  • Chores

    • Updated dev/test tooling and configs (test setup, TS and lint/test configs, dev dependencies).

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 22, 2026

🦋 Changeset detected

Latest commit: e2eb851

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tanstack/angular-pacer Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@benjavicente benjavicente marked this pull request as ready for review February 22, 2026 21:12
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Feb 27, 2026

View your CI Pipeline Execution ↗ for commit c8d1f5f

Command Status Duration Result
nx run-many --targets=build --exclude=examples/** ✅ Succeeded 18s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-27 19:14:20 UTC

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 27, 2026

More templates

@tanstack/angular-pacer

npm i https://pkg.pr.new/@tanstack/angular-pacer@161

@tanstack/pacer

npm i https://pkg.pr.new/@tanstack/pacer@161

@tanstack/pacer-devtools

npm i https://pkg.pr.new/@tanstack/pacer-devtools@161

@tanstack/pacer-lite

npm i https://pkg.pr.new/@tanstack/pacer-lite@161

@tanstack/preact-pacer

npm i https://pkg.pr.new/@tanstack/preact-pacer@161

@tanstack/preact-pacer-devtools

npm i https://pkg.pr.new/@tanstack/preact-pacer-devtools@161

@tanstack/react-pacer

npm i https://pkg.pr.new/@tanstack/react-pacer@161

@tanstack/react-pacer-devtools

npm i https://pkg.pr.new/@tanstack/react-pacer-devtools@161

@tanstack/solid-pacer

npm i https://pkg.pr.new/@tanstack/solid-pacer@161

@tanstack/solid-pacer-devtools

npm i https://pkg.pr.new/@tanstack/solid-pacer-devtools@161

commit: acc7d9f

@theVedanta
Copy link
Copy Markdown
Contributor

theVedanta commented Mar 3, 2026

ahh makes sense. Thank you for fixing this, I had missed it

@KevinVandy
Copy link
Copy Markdown
Member

I'll get this in soon

@theVedanta
Copy link
Copy Markdown
Contributor

My effort to resolve the lockfile in the UI was a bad commit. Can you please resolve them locally?

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 14, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

injectQueuedValue now returns a callable QueuedValueSignal (callable getter + addItem + queuer). Many Angular wrapper option types were renamed to Angular-prefixed generics; docs, examples, tests, TypeScript configs, ESLint, and Vitest setup were updated accordingly.

Changes

QueuedValueSignal & API

Layer / File(s) Summary
Core implementation: QueuedValueSignal and injectQueuedValue
packages/angular-pacer/src/queuer/injectQueuedValue.ts
Adds QueuedValueSignal<TValue, TSelected> callable interface; injectQueuedValue overloads now return QueuedValueSignal and use linkedSignal/untracked; return value is Object.assign(queuedValue, { addItem: ..., queuer }).

Documentation & Examples

Layer / File(s) Summary
QueuedValueSignal docs and injectQueuedValue reference
docs/framework/angular/reference/interfaces/QueuedValueSignal.md, docs/framework/angular/reference/functions/injectQueuedValue.md, docs/framework/angular/reference/index.md, .changeset/big-jobs-call.md
Adds QueuedValueSignal interface doc, updates injectQueuedValue docs to describe callable return shape and AngularQueuerOptions usage, and adds changeset entry.
QueuedSignal / AsyncQueuedSignal param docs
docs/framework/angular/reference/interfaces/QueuedSignal.md, docs/framework/angular/reference/interfaces/AsyncQueuedSignal.md
Make addItem parameters position and runOnItemsChange required and document default runOnItemsChange = true.
Examples updated
examples/angular/injectQueuedValue/src/app/*
Templates and inline docs read queue length via queued.queuer.state().items.length and describe queued() vs queuer state.

Tests & Test Setup

Layer / File(s) Summary
Test suite and setup
packages/angular-pacer/tests/queuer/injectQueuedValue.spec.ts, packages/angular-pacer/tests/test-setup.ts
Adds tests for injectQueuedValue behavior (basic queue, timing with fake timers, Angular integration) and a test setup file to initialize TestBed for Angular tests.

TypeScript, Lint, and Build

Layer / File(s) Summary
TypeScript project refs and tsconfigs
packages/angular-pacer/tsconfig*.json, packages/angular-pacer/tsdown.config.ts
Introduce tsconfig.base.json, tsconfig.lib.json, tsconfig.spec.json, switch package tsconfig to project references, and wire tsdown to use tsconfig.lib.json.
Vitest + ESLint + deps
packages/angular-pacer/vitest.config.ts, packages/angular-pacer/eslint.config.js, packages/angular-pacer/package.json
Add @analogjs Angular plugin to Vitest, switch test env to jsdom and add setupFiles; add ESLint tsconfigRootDir + typescript-project entry; add devDependencies for Angular testing and jsdom.

Angular wrapper option migrations

Layer / File(s) Summary
Wrapper option type updates across package
packages/angular-pacer/src/* (batcher, debouncer, queuer, rate-limiter, throttler, async-*)
Many inject* wrappers now import and use Angular-prefixed option generics (e.g., AngularDebouncerOptions, AngularQueuerOptions, AngularRateLimiterOptions, etc.) and update function signatures to tie option generics to TSelected where applicable.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped through queues both long and spry,
I made a signal that can speak and try,
With addItem, queuer, a callable bruise,
The angular-pacer hums and queues, not twos,
A tiny rabbit cheers: hop on, apply!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 78.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix angular input + API consistency' clearly summarizes the two main changes: fixing an Angular input issue and aligning the API, directly reflecting the primary objectives of the PR.
Description check ✅ Passed The description adequately covers both fixes with clear explanations, provides links to relevant code, completes the checklist, and confirms a changeset was generated as required.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/angular-pacer/src/queuer/injectQueuedValue.ts (1)

75-92: ⚠️ Potential issue | 🟠 Major

The 2-arg initialValue overload has a runtime detection bug.

Line 77 never marks hasInitialValue for the 2-arg form injectQueuedValue(signal, initialValue), so the initial value is treated as options (line 81) and skipped (line 91). This contradicts the overload declared at lines 49–60.

While the codebase currently uses only the 3-arg form injectQueuedValue(signal, options) with full test coverage, the dormant 2-arg overload exposes an API that breaks at runtime. Fix by either (a) correcting the detection logic to distinguish TValue from QueuerOptions, or (b) removing the unused 2-arg overload.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/angular-pacer/src/queuer/injectQueuedValue.ts` around lines 75 - 92,
The runtime detection for the 2-arg overload is wrong; change the
hasInitialValue check to detect when the second argument (initialValueOrOptions)
is present and is not a function (i.e. typeof initialValueOrOptions !==
'function') instead of inspecting initialOptionsOrSelector — update
hasInitialValue to: (initialValueOrOptions !== undefined && typeof
initialValueOrOptions !== 'function') || maybeSelector !== undefined, and keep
the subsequent uses of initialOptions, selector, and queuedValue (symbols:
initialOptionsOrSelector, maybeSelector, initialValueOrOptions, hasInitialValue,
initialOptions, selector, queuedValue, injectQueuedValue) consistent with that
corrected detection so the 2-arg overload treats the second param as the initial
TValue rather than options.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/framework/angular/reference/interfaces/AsyncQueuedSignal.md`:
- Line 36: The addItem signature in the AsyncQueuedSignal interface should mark
the position and runOnItemsChange parameters as optional to match the
implementation; update the type signature for addItem to use position? and
runOnItemsChange? and update the corresponding parameter documentation entries
for position and runOnItemsChange in the AsyncQueuedSignal doc block so they
indicate optionality and align with packages/pacer/src/async-queuer.ts behavior.

In `@docs/framework/angular/reference/interfaces/QueuedSignal.md`:
- Line 36: Update the documented TypeScript signatures in the QueuedSignal
interface to mark parameters with defaults as optional: change addItem's
signature to reflect that position and runOnItemsChange are optional (with
defaults coming from packages/pacer/src/queuer.ts) and update the parameter
headers/descriptions accordingly; apply the same optional-parameter adjustments
to the other documented methods referenced around lines 58-64 so the docs match
the implementation in queuer.ts and clearly state default values for those
optional parameters.

In `@docs/framework/angular/reference/interfaces/QueuedValueSignal.md`:
- Around line 46-50: The example under the QueuedValueSignal interface uses the
wrong receiver name; update the usage examples to call queued.addItem(...)
instead of queuer.addItem(...). Locate the example block showing addItem and
replace calls to queuer.addItem with queued.addItem so the documented API
(QueuedValueSignal and its addItem method) matches actual usage.

In `@packages/angular-pacer/tsconfig.json`:
- Around line 3-5: The referenced tsconfig files (tsconfig.lib.json and
tsconfig.spec.json) are missing the required composite setting for TypeScript
project references; add "compilerOptions": { "composite": true } to both
tsconfig.lib.json and tsconfig.spec.json so they declare composite mode
(ensuring they can be referenced by the root tsconfig.json "references" array
and allowing tsc --build to succeed).

In `@packages/angular-pacer/tsconfig.spec.json`:
- Line 4: Update the test TypeScript config so it doesn't emit declaration
files: in tsconfig.spec.json change the compiler option "noEmit" from false to
true to override the root "declaration": true and prevent tsc from emitting
.d.ts during vitest runs; locate the "noEmit" setting in tsconfig.spec.json and
set it to true.

---

Outside diff comments:
In `@packages/angular-pacer/src/queuer/injectQueuedValue.ts`:
- Around line 75-92: The runtime detection for the 2-arg overload is wrong;
change the hasInitialValue check to detect when the second argument
(initialValueOrOptions) is present and is not a function (i.e. typeof
initialValueOrOptions !== 'function') instead of inspecting
initialOptionsOrSelector — update hasInitialValue to: (initialValueOrOptions !==
undefined && typeof initialValueOrOptions !== 'function') || maybeSelector !==
undefined, and keep the subsequent uses of initialOptions, selector, and
queuedValue (symbols: initialOptionsOrSelector, maybeSelector,
initialValueOrOptions, hasInitialValue, initialOptions, selector, queuedValue,
injectQueuedValue) consistent with that corrected detection so the 2-arg
overload treats the second param as the initial TValue rather than options.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 54576736-ac89-4730-81f5-a1148dfce5e4

📥 Commits

Reviewing files that changed from the base of the PR and between f04f730 and e2eb851.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • .changeset/big-jobs-call.md
  • docs/framework/angular/reference/functions/injectQueuedValue.md
  • docs/framework/angular/reference/index.md
  • docs/framework/angular/reference/interfaces/AsyncQueuedSignal.md
  • docs/framework/angular/reference/interfaces/QueuedSignal.md
  • docs/framework/angular/reference/interfaces/QueuedValueSignal.md
  • examples/angular/injectQueuedValue/src/app/app.html
  • examples/angular/injectQueuedValue/src/app/app.ts
  • examples/angular/injectQueuedValue/src/app/inputapp.ts
  • packages/angular-pacer/eslint.config.js
  • packages/angular-pacer/package.json
  • packages/angular-pacer/src/queuer/injectQueuedValue.ts
  • packages/angular-pacer/tests/queuer/injectQueuedValue.spec.ts
  • packages/angular-pacer/tests/test-setup.ts
  • packages/angular-pacer/tsconfig.base.json
  • packages/angular-pacer/tsconfig.docs.json
  • packages/angular-pacer/tsconfig.json
  • packages/angular-pacer/tsconfig.lib.json
  • packages/angular-pacer/tsconfig.spec.json
  • packages/angular-pacer/tsdown.config.ts
  • packages/angular-pacer/vitest.config.ts


```ts
addItem: (item, position?, runOnItemsChange?) => boolean;
addItem: (item, position, runOnItemsChange) => boolean;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Implementation (defaulted params) ==="
sed -n '470,477p' packages/pacer/src/async-queuer.ts
sed -n '9,15p' packages/angular-pacer/src/async-queuer/injectAsyncQueuedSignal.ts

echo
echo "=== Current docs (required params) ==="
rg -n -C2 'addItem: \(item, position, runOnItemsChange\) => boolean;|##### position\??|##### runOnItemsChange\??' \
  docs/framework/angular/reference/interfaces/AsyncQueuedSignal.md

Repository: TanStack/pacer

Length of output: 780


Mark position and runOnItemsChange parameters as optional in the addItem type signature and parameter documentation sections.

Line 36 and lines 50-56 should use the optional parameter notation (?) to match the default values in the implementation (packages/pacer/src/async-queuer.ts).

Suggested fix
-addItem: (item, position, runOnItemsChange) => boolean;
+addItem: (item, position?, runOnItemsChange?) => boolean;

-##### position
+##### position?

-##### runOnItemsChange
+##### runOnItemsChange?
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/framework/angular/reference/interfaces/AsyncQueuedSignal.md` at line 36,
The addItem signature in the AsyncQueuedSignal interface should mark the
position and runOnItemsChange parameters as optional to match the
implementation; update the type signature for addItem to use position? and
runOnItemsChange? and update the corresponding parameter documentation entries
for position and runOnItemsChange in the AsyncQueuedSignal doc block so they
indicate optionality and align with packages/pacer/src/async-queuer.ts behavior.

Comment thread docs/framework/angular/reference/interfaces/QueuedSignal.md
Comment on lines +46 to +50
Example usage:
```ts
queuer.addItem('task');
queuer.addItem('task2', 'front');
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

addItem example uses the wrong receiver name.

This interface documents QueuedValueSignal, so the example should call queued.addItem(...), not queuer.addItem(...), to avoid API confusion.

✏️ Suggested doc fix
 Example usage:
 ```ts
-queuer.addItem('task');
-queuer.addItem('task2', 'front');
+queued.addItem('task')
+queued.addItem('task2', 'front')
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
Example usage:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/framework/angular/reference/interfaces/QueuedValueSignal.md` around
lines 46 - 50, The example under the QueuedValueSignal interface uses the wrong
receiver name; update the usage examples to call queued.addItem(...) instead of
queuer.addItem(...). Locate the example block showing addItem and replace calls
to queuer.addItem with queued.addItem so the documented API (QueuedValueSignal
and its addItem method) matches actual usage.

Comment on lines +3 to +5
"references": [
{ "path": "./tsconfig.lib.json" },
{ "path": "./tsconfig.spec.json" }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# 1) Confirm project references were added.
rg -nP '"references"\s*:\s*\[' packages/angular-pacer/tsconfig.json

# 2) Check whether referenced projects are composite.
rg -nP '"composite"\s*:\s*true' packages/angular-pacer/tsconfig.lib.json packages/angular-pacer/tsconfig.spec.json packages/angular-pacer/tsconfig.base.json tsconfig.json

# 3) Detect build-mode TypeScript invocations in repo scripts.
fd package.json | xargs -I{} rg -nP 'tsc\s+(-b|--build)' {}

Repository: TanStack/pacer

Length of output: 79


🏁 Script executed:

#!/bin/bash
# First, list files in packages/angular-pacer/ to see what tsconfig files exist
echo "=== Files in packages/angular-pacer/ ==="
find packages/angular-pacer -name "tsconfig*.json" -type f | head -20

# Check the full content of packages/angular-pacer/tsconfig.json
echo -e "\n=== packages/angular-pacer/tsconfig.json ==="
cat -n packages/angular-pacer/tsconfig.json

# Check if the referenced files exist
echo -e "\n=== Checking referenced config files ==="
for file in packages/angular-pacer/tsconfig.lib.json packages/angular-pacer/tsconfig.spec.json; do
  if [ -f "$file" ]; then
    echo "File exists: $file"
  else
    echo "File NOT found: $file"
  fi
done

Repository: TanStack/pacer

Length of output: 667


🏁 Script executed:

#!/bin/bash
# Check composite setting in referenced files
echo "=== packages/angular-pacer/tsconfig.lib.json ==="
cat -n packages/angular-pacer/tsconfig.lib.json

echo -e "\n=== packages/angular-pacer/tsconfig.spec.json ==="
cat -n packages/angular-pacer/tsconfig.spec.json

# Search for tsc --build or tsc -b in all package.json files
echo -e "\n=== Searching for tsc --build usage ==="
find . -name package.json -type f | xargs grep -n "tsc\s\+.*-b\|tsc\s\+.*--build" 2>/dev/null || echo "No matches found"

Repository: TanStack/pacer

Length of output: 2107


🏁 Script executed:

#!/bin/bash
# Search for tsc in actual repo package.json files (excluding node_modules)
echo "=== Searching in repo package.json files (not node_modules) ==="
find . -path ./node_modules -prune -o -name package.json -type f -print | while read file; do
  if grep -q "tsc" "$file" 2>/dev/null; then
    echo "=== File: $file ==="
    grep -n "tsc" "$file"
  fi
done

# Also check the root package.json specifically
echo -e "\n=== Root package.json ==="
if [ -f ./package.json ]; then
  cat -n ./package.json | head -50
fi

Repository: TanStack/pacer

Length of output: 14358


Add "composite": true to referenced TypeScript configs.

Project references at lines 3-5 reference tsconfig.lib.json and tsconfig.spec.json, but neither has "composite": true in compilerOptions. While the repo currently doesn't use tsc --build in its scripts, the configuration is incomplete: if tsc --build is executed (manually or in future CI), it will fail without this setting. Per TypeScript's project references specification, all referenced configs must declare composite mode.

Fix by adding "compilerOptions": { "composite": true } to both tsconfig.lib.json and tsconfig.spec.json.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/angular-pacer/tsconfig.json` around lines 3 - 5, The referenced
tsconfig files (tsconfig.lib.json and tsconfig.spec.json) are missing the
required composite setting for TypeScript project references; add
"compilerOptions": { "composite": true } to both tsconfig.lib.json and
tsconfig.spec.json so they declare composite mode (ensuring they can be
referenced by the root tsconfig.json "references" array and allowing tsc --build
to succeed).

{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"noEmit": false,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# 1) Inspect scripts that invoke TypeScript builds/typechecks.
fd package.json | xargs -I{} rg -nP '"(build|typecheck|test|lint)"\s*:\s*".*tsc' {}

# 2) Look specifically for build-mode usage.
fd package.json | xargs -I{} rg -nP 'tsc\s+(-b|--build)' {}

# 3) Inspect effective emit-related options across angular-pacer tsconfigs.
rg -nP '"(noEmit|declaration|composite)"\s*:' packages/angular-pacer/tsconfig*.json tsconfig.json

Repository: TanStack/pacer

Length of output: 200


🏁 Script executed:

cat -n packages/angular-pacer/tsconfig.spec.json

Repository: TanStack/pacer

Length of output: 432


🏁 Script executed:

cat -n tsconfig.json | head -30

Repository: TanStack/pacer

Length of output: 1066


🏁 Script executed:

rg -nP '\bpackages/angular-pacer' --type json | head -20

Repository: TanStack/pacer

Length of output: 622


🏁 Script executed:

find packages/angular-pacer -name "tsconfig*.json" -type f

Repository: TanStack/pacer

Length of output: 261


🏁 Script executed:

cat packages/angular-pacer/tsconfig.base.json

Repository: TanStack/pacer

Length of output: 96


🏁 Script executed:

cat packages/angular-pacer/tsconfig.lib.json

Repository: TanStack/pacer

Length of output: 183


🏁 Script executed:

# Check if spec artifacts are referenced or used anywhere
rg -nP '(dist|build|out)/.*spec' packages/angular-pacer/

# Check for any emit-related behavior in build configs
fd -e "vite.config" -e "vitest.config" -e "build" packages/angular-pacer/ | head -5

# Check package.json build scripts
cat packages/angular-pacer/package.json | grep -A 30 '"scripts"'

Repository: TanStack/pacer

Length of output: 1384


🏁 Script executed:

# Check if vitest or tsconfig uses composite builds
rg -nP 'composite|references' packages/angular-pacer/tsconfig*.json

# Check vitest config
find packages/angular-pacer -name "vitest.config*" -exec cat {} \;

# Verify what tsc does with the spec config - check if lib.json references spec
rg -nP '"references"' packages/angular-pacer/tsconfig*.json

Repository: TanStack/pacer

Length of output: 752


Change "noEmit": false to "noEmit": true in the spec configuration.

The test-only configuration inherits "declaration": true from the root and explicitly sets "noEmit": false, which causes TypeScript to emit declaration files during type checking. Since the build process uses tsdown (not tsc), vitest runs tests directly without consuming compiled spec artifacts, and no build output depends on spec declarations, emitting here is unnecessary.

Suggested change
-    "noEmit": false,
+    "noEmit": true,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"noEmit": false,
"noEmit": true,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/angular-pacer/tsconfig.spec.json` at line 4, Update the test
TypeScript config so it doesn't emit declaration files: in tsconfig.spec.json
change the compiler option "noEmit" from false to true to override the root
"declaration": true and prevent tsc from emitting .d.ts during vitest runs;
locate the "noEmit" setting in tsconfig.spec.json and set it to true.

@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​analogjs/​vite-plugin-angular@​2.6.010010010096100
Added@​analogjs/​vitest-angular@​2.6.010010010096100

View full report

@benjavicente
Copy link
Copy Markdown
Author

Rebased to newer changes and bumped some dependencies that had issues after the rebase.

I added a small third thing: Now utilities use the type defined in the Angular package instead of the core one, so options like onUnmount are typed everywhere it's available.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/angular-pacer/src/queuer/injectQueuedValue.ts`:
- Around line 76-82: The overload discriminator misdetects the two-argument form
of injectQueuedValue: change the hasInitialValue logic so the second argument
(initialOptionsOrSelector) is treated as an initialValue when maybeSelector is
undefined and the second arg does not look like AngularQueuerOptions; implement
a small type-guard (e.g., isAngularQueuerOptions) that checks for known option
keys (bufferSize/delay/etc.) and use it in the condition for hasInitialValue and
the subsequent selection of initialOptions vs initialValue (references:
hasInitialValue, initialOptionsOrSelector, maybeSelector, initialValueOrOptions,
selector, injectQueuedValue); apply the same discriminator fix to the analogous
block at lines 88–91 so two-argument calls use the provided initialValue rather
than treating it as options.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d03d4784-22b2-4e46-8b8e-5a9f8dcc1533

📥 Commits

Reviewing files that changed from the base of the PR and between e2eb851 and 55025ad.

📒 Files selected for processing (41)
  • .changeset/big-jobs-call.md
  • docs/framework/angular/reference/functions/injectAsyncBatchedCallback.md
  • docs/framework/angular/reference/functions/injectAsyncDebouncedCallback.md
  • docs/framework/angular/reference/functions/injectAsyncQueuedSignal.md
  • docs/framework/angular/reference/functions/injectAsyncRateLimitedCallback.md
  • docs/framework/angular/reference/functions/injectAsyncThrottledCallback.md
  • docs/framework/angular/reference/functions/injectBatchedCallback.md
  • docs/framework/angular/reference/functions/injectDebouncedCallback.md
  • docs/framework/angular/reference/functions/injectDebouncedSignal.md
  • docs/framework/angular/reference/functions/injectDebouncedValue.md
  • docs/framework/angular/reference/functions/injectQueuedSignal.md
  • docs/framework/angular/reference/functions/injectQueuedValue.md
  • docs/framework/angular/reference/functions/injectRateLimitedCallback.md
  • docs/framework/angular/reference/functions/injectRateLimitedSignal.md
  • docs/framework/angular/reference/functions/injectRateLimitedValue.md
  • docs/framework/angular/reference/functions/injectThrottledCallback.md
  • docs/framework/angular/reference/functions/injectThrottledSignal.md
  • docs/framework/angular/reference/functions/injectThrottledValue.md
  • docs/framework/angular/reference/index.md
  • docs/framework/angular/reference/interfaces/AsyncQueuedSignal.md
  • docs/framework/angular/reference/interfaces/QueuedSignal.md
  • docs/framework/angular/reference/interfaces/QueuedValueSignal.md
  • examples/angular/injectQueuedValue/src/app/app.html
  • examples/angular/injectQueuedValue/src/app/app.ts
  • examples/angular/injectQueuedValue/src/app/inputapp.ts
  • packages/angular-pacer/eslint.config.js
  • packages/angular-pacer/package.json
  • packages/angular-pacer/src/async-batcher/injectAsyncBatchedCallback.ts
  • packages/angular-pacer/src/async-debouncer/injectAsyncDebouncedCallback.ts
  • packages/angular-pacer/src/async-queuer/injectAsyncQueuedSignal.ts
  • packages/angular-pacer/src/async-rate-limiter/injectAsyncRateLimitedCallback.ts
  • packages/angular-pacer/src/async-throttler/injectAsyncThrottledCallback.ts
  • packages/angular-pacer/src/batcher/injectBatchedCallback.ts
  • packages/angular-pacer/src/debouncer/injectDebouncedCallback.ts
  • packages/angular-pacer/src/debouncer/injectDebouncedSignal.ts
  • packages/angular-pacer/src/debouncer/injectDebouncedValue.ts
  • packages/angular-pacer/src/queuer/injectQueuedSignal.ts
  • packages/angular-pacer/src/queuer/injectQueuedValue.ts
  • packages/angular-pacer/src/rate-limiter/injectRateLimitedCallback.ts
  • packages/angular-pacer/src/rate-limiter/injectRateLimitedSignal.ts
  • packages/angular-pacer/src/rate-limiter/injectRateLimitedValue.ts
✅ Files skipped from review due to trivial changes (9)
  • packages/angular-pacer/src/debouncer/injectDebouncedCallback.ts
  • docs/framework/angular/reference/index.md
  • docs/framework/angular/reference/functions/injectAsyncRateLimitedCallback.md
  • .changeset/big-jobs-call.md
  • docs/framework/angular/reference/functions/injectAsyncQueuedSignal.md
  • examples/angular/injectQueuedValue/src/app/inputapp.ts
  • examples/angular/injectQueuedValue/src/app/app.ts
  • docs/framework/angular/reference/functions/injectAsyncThrottledCallback.md
  • docs/framework/angular/reference/functions/injectRateLimitedValue.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • examples/angular/injectQueuedValue/src/app/app.html
  • packages/angular-pacer/package.json
  • docs/framework/angular/reference/interfaces/QueuedSignal.md
  • docs/framework/angular/reference/interfaces/AsyncQueuedSignal.md
  • packages/angular-pacer/eslint.config.js
  • docs/framework/angular/reference/functions/injectQueuedValue.md

Comment on lines 76 to 82
const hasInitialValue =
(initialOptionsOrSelector !== undefined && !hasSelector) ||
maybeSelector !== undefined

const initialValue = hasInitialValue
? (initialValueOrOptions as TValue)
: value()
const initialOptions = hasInitialValue
? (initialOptionsOrSelector as QueuerOptions<TValue>)
: (initialValueOrOptions as QueuerOptions<TValue>)
? (initialOptionsOrSelector as AngularQueuerOptions<TValue, TSelected>)
: (initialValueOrOptions as AngularQueuerOptions<TValue, TSelected>)
const selector = hasInitialValue
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Two-argument initialValue overload is misparsed and ignored.

hasInitialValue is never true for injectQueuedValue(value, initialValue) (no arg3/arg4), so the second argument is treated as options and the linked signal initializes from value() instead of initialValue.

Suggested discriminator fix
-  const hasInitialValue =
-    (initialOptionsOrSelector !== undefined && !hasSelector) ||
-    maybeSelector !== undefined
+  const hasInitialValue =
+    maybeSelector !== undefined ||
+    (initialOptionsOrSelector !== undefined && !hasSelector) ||
+    // 2-arg form: injectQueuedValue(value, initialValue)
+    (initialOptionsOrSelector === undefined &&
+      (initialValueOrOptions === null ||
+        typeof initialValueOrOptions !== 'object'))

Also applies to: 88-91

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/angular-pacer/src/queuer/injectQueuedValue.ts` around lines 76 - 82,
The overload discriminator misdetects the two-argument form of
injectQueuedValue: change the hasInitialValue logic so the second argument
(initialOptionsOrSelector) is treated as an initialValue when maybeSelector is
undefined and the second arg does not look like AngularQueuerOptions; implement
a small type-guard (e.g., isAngularQueuerOptions) that checks for known option
keys (bufferSize/delay/etc.) and use it in the condition for hasInitialValue and
the subsequent selection of initialOptions vs initialValue (references:
hasInitialValue, initialOptionsOrSelector, maybeSelector, initialValueOrOptions,
selector, injectQueuedValue); apply the same discriminator fix to the analogous
block at lines 88–91 so two-argument calls use the provided initialValue rather
than treating it as options.

@benjavicente
Copy link
Copy Markdown
Author

benjavicente commented Jun 6, 2026

Regarding CoreRabbit comment: it looks like injectQueuedValue needs a breaking change to stop supporting the injectQueuedValue(value, initialValue) signature to fix the issue. I made a stacked PR here with a change for it, benjavicente#1. That new API has the same shape as the React one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants