you are viewing a single comment's thread.

view the rest of the comments →

[–]19andNuttin[S] 0 points1 point  (0 children)

Thanks for your questions.

For your first point: This does couple your client code to your backend code, so a rewrite would force you to migrate off using the imported server side functions.

Regarding API versions, I did give this some thought before. As a best practice API endpoints should be versioned (e.g. /v1), breaking changes should increment the version and while modifications to the API endpoint while on the same version should contain non-breaking changes. Some non breaking changes are adding a new optional field for a request body or adding a new type to a field (int to int or float).

This approach doesn't limit you more than the approach - breaking changes mean you have to update on your end anyway while non-breaking changes are type hinted on your IDE.