Upgrade React to 16.14.0, TypeScript to 4.9.5, and refresh browserslist#304
Conversation
Remove the dead IE-only msMaxTouchPoints check in isTouchEnabled (removed from lib.dom.d.ts in TS 4+; IE11 was EOL'd in 2022 and is already excluded by the project browserslist).
abettermap
left a comment
There was a problem hiding this comment.
Hi @ankit0504, thanks for your interest in contributing! Full disclosure I have a full time job and not a lot of time to review/test PRs. So, for these initial dependency/upgrade housekeeping PRs, I will review code but trust that you are testing the output and builds!
As far as the upgrades go, my vote would be to go as far as you can (not in one PR of course, but gradually and piecemeal). I wrote this code nearly 5 years ago and am aware it is massively outdated, so if you can get us all the way to React 19, and newest versions of the big stuff (tanstack query, react router, material UI, mapbox, Airtable, etc.), that would be huge.
In terms of actual feature additions, like the time series, I would prefer if the ELA guys (Ross and Dan) test that before we merge. Once we get your other housekeeping PRs in, we should once again have interim/temporary Netlify deployments for them to test. When they say it's cool, we'll merge!
Let me know what you think of that and I'm happy to merge this first one.
Hello @abettermap! Thanks for your response :) We are totally aligned on this. I also have a full daytime job and won't be spending a ton of time on this either hahah I'm in contact with Ross about major features like the time slider. My idea was to build some prototypes and send him screen recordings and only submit PRs when I have his green light. For these initial ones since the product isn't changing I haven't really looped him in. I have a stack already and I'll build off that to keep PR's small and manageable for review. I'm running everything locally and testing it as I submit PR's. I stopped for now where I couldn't test without access to the Airflow data. Ross just shared that with me so I should be good to go from here! I'm looking forward to working on this! |
Sounds good. I also gave you a As for this branch, I'm going to merge it along with the others if they're working for me. Really looking forward to Vite, CRA is soooo slow! |
Issues resolved by this pull request
None — this is phase 1 of a broader staged upgrade effort, not tied to a specific issue. Eventual goal is to add a component that allows you to see the map in different years.
Prerequisites
yarn installafter checking out the branch, sinceyarn.lockchanged.yarn startcontinues torequire
NODE_OPTIONS=--openssl-legacy-provideruntil CRA is replaced.This PR does not change that; it will be addressed in a later phase.
Review type
What to review
package.json/yarn.lock: React16.13.1→16.14.0, TypeScript3.9.5→4.9.5, and an updatedcaniuse-lite(vianpx update-browserslist-db@latest, nopackage.jsonentry).src/utils.tsandsrc/components/map/utils.ts: removed thenavigator.msMaxTouchPointsfallback inisTouchEnabled. This propertywas removed from
lib.dom.d.tsin TypeScript 4+ and only applied toIE11, which has been EOL'd since 2022 and is already excluded by the
project's
browserslistconfig.Verification
npx tsc --noEmit— passes clean.yarn build— production build succeeds.yarn start— dev server compiles successfully on Node 22 with thelegacy-openssl flag.
What's next (out of scope for this PR)
Subsequent phases I'd like to propose in follow-up PRs:
createRoot, strict mode).material-tableandreact-swipeable-views(both abandoned).react-map-gl 5 → 7, replace
react-map-gl-geocoder.