Hacker News new | ask | show | jobs
by sattoshi 1693 days ago
Usually new versions excite me, but with React Router I can only wonder: how much of a re-write will I need to do?
2 comments

Seriously, the upgrades are always such a massive pain.

The v5 -> v6 doc is already making me dizzy just from how long it is https://reactrouter.com/docs/en/v6/upgrading/v5

People should really take Next.js as an example here.

They make sure it's backwards compatible as much a possible and when it's not they provide a codemod or the app tells you what's wrong (and how to fix it!) when you try to run it.

If course the latter is hard/impossible with a lower level library like this but the former is def. possible.

Emotion css decided to rename/reshuffle all their packages and imports in v11 which was a massive pain, but with the provided codemod that migration was not too painful.

How is this sustainable?
Write fewer tests and change quickly.
> Write fewer tests

Sold.

Write end-to-end tests that test behavior instead of implementation.
I think it's time to start testing tests. The first test will be metrics how often tests are changed when the things they test are changed. If it's close at all to 1 to 1 then the test fails.
It is only sustainable for large businesses, which increasingly are the only businesses.