Version 5.0: Major change from CRA to Vite and TypeScript with Google Civic Info API Representatives replacement#162
Open
jungshadow wants to merge 9 commits into
Open
Version 5.0: Major change from CRA to Vite and TypeScript with Google Civic Info API Representatives replacement#162jungshadow wants to merge 9 commits into
jungshadow wants to merge 9 commits into
Conversation
- Migrate from Create React App to Vite 8 - Upgrade React 16 → 19 (createRoot API) - Upgrade react-router-dom 5 → 7 (Routes/Navigate) - Upgrade framer-motion 2 → 12 - Replace moment.js with date-fns - Replace lodash with native implementations - Replace require() with ESM imports (Autocomplete) - Rename all .js → .jsx for Vite OXC parser - Add defensive guards for API failure handling - Switch to pnpm, add .npmrc and .node-version - Begin TypeScript migration: tsconfig, type defs, helpers.ts, analytics.ts - Replace CRA README with project-specific documentation - Configure 1Password CLI for secret management
…terfaces, remove PropTypes
…ix ElectionTitle crash on missing election
Replace ElectionSelect dropdown with ElectionPicker component that shows all upcoming elections grouped by date. When multiple elections match a voter's state (e.g. Texas Dem/Rep primary runoffs on the same day), an interstitial picker appears before loading results instead of silently auto-selecting one. After choosing an election, the picker persists inline on all results routes so voters can switch between elections without re-searching. - Add pendingElections/SET_PENDING_ELECTIONS to state and reducer - Intercept multi-election case in Search before calling getLocations - Create ElectionPicker component with grouped date display - Wire picker into Site (interstitial) and all Results routes (inline) - Guard Navigate in App.tsx against undefined redirect destination - Remove unused ElectionSelect component - Add tests for ElectionPicker and new reducer actions
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.
Version 5.0
@vitejs/plugin-reactreact-dom/client(createRoot)NavLinkclassName function API, noactiveClassNamepackageManagerfield enforced)lodashwith native JS,moment.jswithdate-fnsnode-sasswithsass(Dart Sass)framer-motionupgraded — removed deprecatedlayoutTransitionprop.js/.jsxfile converted to.ts/.tsxtsconfig.jsonwithstrict: true)src/types/)PropTypesremoved entirely — replaced by TypeScript interfacestsconfig.jsonandvite.config.jstypescript-eslint,react-hooks,prettier/people.geoRepresentativesApiResponseshapeElectionTitlecrash on missing election data (new Date('')→ Invalid Date)workflow_dispatch) — type check → lint → build → deploy to Pagesop run), prod uses GitHub Secrets.env.examplewith setup instructions@testing-library/react+@testing-library/jest-domhelpers(19),appReducer(5),ElectionTitle(3)pnpm test:unit,pnpm test:e2eprop-types,@types/prop-types,@types/mapbox-gl,ajv,gh-pagesprivacy.html,predeploy/deployscripts,browserslistimport React from 'react'statements