|
|
|
|
|
by ctvo
1190 days ago
|
|
> Stop assuming data is of the type you’re expecting. You know it is, period. > Know when you break compatability with the frontend, before even running it: TypeScript has your back. Do you? Your front-end and back-end, regardless if they use the same source for their interface contract, aren't deployed as a unit. At least not always, and not in the single page application use cases you're targeting. How do you handle versioning and protocol compatibility? Across all these frameworks, it feels like a footgun your users will discover on their own. |
|
We use Phero extensively in mobile apps projects, so we know the pain of maintaining API versions and backward compatibility hell.
Phero generates a declaration file with all functions you expose, and bundles dependent domain models (interfaces, type aliases, enums, etc) with it. Currently there's only one version. Our plan is to let users pin versions of this declaration file (we call it the manifest file).
Then we build cli commands to compare them and actually tell if they are compatible. This way you know if it's safe to deploy a new version of your API without breaking existing clients. These are all future plans of course, but in the scope of the project.