MathematicalMedicine / diver-issues

Semipublic tracking of issues for the DIVER front end
0 stars 0 forks source link

Typechecking in diverweb needs to be updated #242

Open Viqsi opened 5 months ago

Viqsi commented 5 months ago

While working on #51, it became clear that use of prop-types for typechecking is not just deprecated, it's arguably nonoperational and getting in the way. I'd been curious as to how it could possibly work since it's just assigning values to a constant outside of the component function, and those don't get checked in time to actually be used, but I figured it was largely harmless.

Well, it turns out that that's because that method of typechecking was for when React was class-based rather than function-based. And with the update to c-r-a 5 and associated dependencies, our attempts to use custom datatypes would raise exceptions rather than simply Maybe Not Working Properly; I had to completely disable typechecking in MathematicalMedicine/diverweb@2ec64a1 to eliminate those errors. And per react docs, the Proper Modern Way to do this stuff is... to use TypeScript.

My tentative plan (once I'm confident merging that in) is therefore to leave the prop-types info commented out for now, and gradually convert .js files to .tsx files as need be.