Skip to content

fix(search): exclude Configure from devtools source injection#841

Merged
tannerlinsley merged 1 commit intomainfrom
taren/fix-search-devtools-attr
Apr 21, 2026
Merged

fix(search): exclude Configure from devtools source injection#841
tannerlinsley merged 1 commit intomainfrom
taren/fix-search-devtools-attr

Conversation

@tannerlinsley
Copy link
Copy Markdown
Member

@tannerlinsley tannerlinsley commented Apr 21, 2026

Summary

  • react-instantsearch's <Configure> widget forwards all JSX props to Algolia's search parameters.
  • The @tanstack/devtools-vite plugin injects data-tsd-source="file:line:col" onto every JSX element in dev.
  • Those two combined meant the attribute leaked into the request body, Algolia returned {"message":"Unknown parameter: data-tsd-source","status":400}, and InstantSearch silently circuit-broke — typing in the site search produced no results in dev.

Pass injectSource.ignore.components: ['Configure'] so the devtools plugin leaves <Configure> alone. Dev-only change; prod builds already strip the attribute (so prod search was unaffected).

Test plan

  • In dev, search opens and returns results when typing
  • Verified against both shim and real React (via NO_SHIM=1) — both now return 20 hits for "useQuery"
  • pnpm husky passes (format + tsc + lint + smoke: 4/4)

Isolated from the site-search symptom: the shim also had a latent bug where event.nativeEvent was undefined on dispatched handlers (react-instantsearch reads event.nativeEvent.isComposing). That was fixed upstream in the shim repo: TanStack/react@1c71ed6.

Summary by CodeRabbit

  • Chores
    • Updated development environment tooling configuration settings.

react-instantsearch's <Configure> widget forwards all of its JSX props
to Algolia's search parameters. The @tanstack/devtools-vite plugin
injects `data-tsd-source="file:line:col"` onto every JSX element in dev,
and Configure's pass-through meant the attribute ended up in the request
body. Algolia responded with:

    {"message":"Unknown parameter: data-tsd-source","status":400}

and InstantSearch silently circuit-broke — typing in the docsearch
modal produced no results.

Pass `injectSource.ignore.components: ['Configure']` so the devtools
plugin leaves <Configure> alone. Dev-only change; prod builds already
strip the attribute.
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 21, 2026

Deploy Preview for tanstack ready!

Name Link
🔨 Latest commit 539bc5c
🔍 Latest deploy log https://app.netlify.com/projects/tanstack/deploys/69e6e3f96b4e9e0007aefd08
😎 Deploy Preview https://deploy-preview-841--tanstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 51 (🟢 up 1 from production)
Accessibility: 90 (no change from production)
Best Practices: 83 (🔴 down 9 from production)
SEO: 97 (no change from production)
PWA: 70 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c1fd03a0-83ce-40a4-8311-0966e7c1177e

📥 Commits

Reviewing files that changed from the base of the PR and between 6752c0d and 539bc5c.

📒 Files selected for processing (1)
  • vite.config.ts

📝 Walkthrough

Walkthrough

The vite.config.ts file was updated to configure the TanStack devtools plugin with additional options in development environments. The plugin now includes injectSource configuration and an ignore rule that excludes the Configure component from source injection.

Changes

Cohort / File(s) Summary
Vite Plugin Configuration
vite.config.ts
Updated tanstackDevtools plugin instantiation to include injectSource option with enabled: true and an ignore rule that excludes the Configure component from source injection.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A config tweak, so small yet fine,
The devtools now with rules align,
Ignore Configure, keep things clean,
The finest injection ever seen!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: excluding the Configure component from devtools source injection in the vite.config.ts file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch taren/fix-search-devtools-attr

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

@tannerlinsley tannerlinsley merged commit 8f9a65e into main Apr 21, 2026
8 checks passed
@tannerlinsley tannerlinsley deleted the taren/fix-search-devtools-attr branch April 21, 2026 03:01
tannerlinsley added a commit that referenced this pull request Apr 21, 2026
Picks up:
- fix(react-dom): alias event.nativeEvent on dispatched handlers — fixes
  react-instantsearch site search (onChange throws on
  event.nativeEvent.isComposing without the alias, silently swallowing
  every keystroke).
- fix(react-dom): fire onChange on every keystroke for text inputs
  (onChange → native input event for text-like inputs).
- perf(react-dom): renderFiber pointer-table dispatch.
- feat(react): dev-mode hint pointing at "use client" when a hooks
  error fires during RSC render.

Combined with the Configure source-injection fix from #841, this
restores in-dev site search.
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.

1 participant