refactor(web): full frontend architecture overhaul#540
Draft
eoaksnes wants to merge 1 commit intostack/02-apifrom
Draft
refactor(web): full frontend architecture overhaul#540eoaksnes wants to merge 1 commit intostack/02-apifrom
eoaksnes wants to merge 1 commit intostack/02-apifrom
Conversation
Tooling:
- eslint flat config + biome update
- yarn .yarnrc + sdks for editor support
- package.json + yarn.lock dependency bumps
- tsconfig, vite, vitest, openapi-ts config refresh
- mise: add lint:web:query task (TanStack Query lint)
- .gitattributes: mark routeTree.gen.ts and api-generated/ as linguist-generated
- docker-compose.override: pass VITE_AUTH + VITE_TELEMETRY into dev SPA
Generated SDK:
- Move api/generated -> api-generated
- Add @tanstack/react-query.gen.ts (query/mutation hooks)
- Add zod.gen.ts (runtime schema validation)
Shared platform foundation:
- shared/platform/api: configureApiClient, query client factory, ApiError
- shared/platform/auth: current/anonymous user, reauth flow, session watcher
- shared/platform/telemetry: AppInsights/console/noop backends + error boundary
- shared/platform/{theme,toast,feature-flags,access-control}
- shared/components: EmptyState, ErrorPanel, IconButton, LoadingState, PageHeader, Popover
- config/: env, accessControl, featureFlags
- mocks/: MSW server + handlers
- setupTests.ts updated
App shell + Todos cutover:
- app/bootstrap: Providers, ApplicationError, createQueryClient
- app/error-pages: Forbidden/NotFound/StatusPage/RouteErrorBoundary/UnexpectedError
- app/layout: RootLayout, Header, VersionText
- app/routes + routeTree.gen.ts (TanStack Router)
- app/styles, app/auth/SessionExpiredDialog
- features/todos: api (queries/mutations/keys/invalidations/schema), pages/TodosPage with NewTodoForm, TodoItem, TodoList, TodosFilter
- index.tsx + index.html: new bootstrap
- Removed legacy: App.tsx, router.tsx, auth.ts, common/components/*, contexts/TodoContext, hooks/useTodoAPI, pages/TodoListPage, features/todos/todo-list/*
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack 3/4 — base: `stack/02-api` (#539)
Complete frontend rewrite: tooling, generated SDK, shared platform foundation, and TanStack Router app shell + Todos cutover.
Stack
This pull request introduces significant improvements to the web application's frontend development workflow, focusing on code quality, maintainability, and modern tooling. The changes include the integration of TanStack Query and Router, enhanced linting with ESLint for TanStack Query best practices, improved handling of generated files, and updates to dependencies and configuration for a more robust developer experience.
Linting and Code Quality Enhancements
eslint.config.mts) to enforce TanStack Query usage rules and project-specific import boundaries, supplementing Biome for comprehensive linting.package.json,.mise/tasks/lint.toml) to include a newlint:querycommand and ensure TanStack Query rules are checked during lint runs. [1] [2]Generated Files and Tooling
src/api-generatedand include plugins for TanStack Query and Zod, enabling type-safe API hooks and schema validation.src/api-generated/@tanstack/react-query.gen.ts) for type-safe API queries and mutations.Dependency and Configuration Updates
Developer Experience Improvements
index.htmlto prevent flashes of incorrect theme before React mounts, improving perceived performance.Cleanup and Refactoring
App.tsxand deleted the outdatedApp.test.tsx, preparing the codebase for the new TanStack Router and Query integration. [1] [2]These changes collectively modernize the frontend stack, enforce best practices, and streamline the development workflow for future features and maintenance.