Skip to content

Commit df74342

Browse files
authored
chore(release): 1.4.14
Add TanStack Showcase example with 6 interactive side-by-side comparison pages (Query vs useEffect, Table vs manual, Virtual vs render-all, Form vs useState, Store vs Context, Pacer vs setTimeout). Each page demonstrates why the TanStack approach is better with working interactive code. Fix nested <button> accessibility violation in presets panel — outer element changed to <div role="button"> with keyboard handler. Add CLI validation for TanStack AI (React/Solid only) and TanStack Showcase (TanStack Router/Start only) frontend compatibility. Update TanStack Fullstack preset to include all ecosystem libraries: Query, Table, Virtual, Pacer, Store, Form, AI, plus the showcase example. 22 new tests covering TanStack AI compatible/incompatible frontends with dependency assertions, and TanStack Showcase generation and validation.
1 parent 89275c0 commit df74342

23 files changed

Lines changed: 47485 additions & 41496 deletions

File tree

apps/cli/src/utils/compatibility-rules.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,16 @@ export function validateExamplesCompatibility(
581581
const examplesArr = examples ?? [];
582582
if (examplesArr.length === 0 || examplesArr.includes("none")) return;
583583

584+
if (examplesArr.includes("tanstack-showcase")) {
585+
const showcaseFrontends: Frontend[] = ["tanstack-router", "tanstack-start"];
586+
const hasShowcaseFrontend = (frontend ?? []).some((f) => showcaseFrontends.includes(f));
587+
if (!hasShowcaseFrontend) {
588+
exitWithError(
589+
"The 'tanstack-showcase' example requires TanStack Router or TanStack Start frontend.",
590+
);
591+
}
592+
}
593+
584594
if (examplesArr.includes("ai") && (frontend ?? []).includes("solid")) {
585595
exitWithError("The 'ai' example is not compatible with the Solid frontend.");
586596
}
@@ -644,6 +654,31 @@ export function validateExamplesCompatibility(
644654
}
645655
}
646656

657+
/**
658+
* Validates that TanStack AI is only used with compatible frontends (React or Solid).
659+
* Server-side @tanstack/ai core works anywhere, but client adapters only exist for React and Solid.
660+
*/
661+
export function validateAIFrontendCompatibility(
662+
ai: AI | undefined,
663+
frontends: Frontend[] = [],
664+
) {
665+
if (!ai || ai !== "tanstack-ai") return;
666+
667+
const compatibleFrontends: Frontend[] = [
668+
"tanstack-router", "react-router", "react-vite", "tanstack-start", "next", "redwood",
669+
"solid", "solid-start",
670+
];
671+
672+
const hasCompatible = frontends.some((f) => compatibleFrontends.includes(f));
673+
674+
if (!hasCompatible) {
675+
exitWithError(
676+
"TanStack AI requires React or Solid frontend (no Vue/Svelte/Angular adapter yet). " +
677+
"Please use a React-based frontend (Next.js, TanStack Router, React Router, etc.) or Solid.",
678+
);
679+
}
680+
}
681+
647682
/**
648683
* Validates that a UI library is compatible with the selected frontend(s)
649684
*/

apps/cli/src/utils/config-validation.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
validateUILibraryCSSFrameworkCompatibility,
1616
validateUILibraryFrontendCompatibility,
1717
validateWebDeployRequiresWebFrontend,
18+
validateAIFrontendCompatibility,
1819
validateWorkersCompatibility,
1920
} from "./compatibility-rules";
2021
import { isSilent } from "./context";
@@ -657,6 +658,8 @@ export function validateFullConfig(
657658
config.frontend ?? [],
658659
);
659660

661+
validateAIFrontendCompatibility(config.ai, config.frontend ?? []);
662+
660663
validateUILibraryFrontendCompatibility(
661664
config.uiLibrary,
662665
config.frontend ?? [],
@@ -694,6 +697,8 @@ export function validateConfigForProgrammaticUse(config: Partial<ProjectConfig>)
694697
config.ai,
695698
);
696699

700+
validateAIFrontendCompatibility(config.ai, config.frontend ?? []);
701+
697702
validateUILibraryFrontendCompatibility(
698703
config.uiLibrary,
699704
config.frontend ?? [],

0 commit comments

Comments
 (0)