4 ms·
When you need to make a backward incompatible change, do it in three steps: 1. Add new stuff to API in a backwards compatible manner (without removing or chang
by boronine 7y ago
When you need to make a backward incompatible change, do it in three steps:
1. Add new stuff to API in a backwards compatible manner (without removing or changing old stuff). When you need to add fields it is usually safe to do it within existing functions. When you need to modify fields, I recommend simply copying and pasting your API function and exposing the new one with a number suffix, e.g. get_messages_2
2. Update the client code to use new versions of functions and to stop using old versions.
3. Once the new client is deployed, wait a while longer and then remove old versions of functions like get_messages_1
You can also use a single global version which will allow your client to detect when it has gone stale and reload.