Frontend client indicating its backend source branch

It would be nice if the generated encore client could specify which branch it is generated from at the top of the file as a comment. When working on larger feature branches this could speed up some debugging and reviewing PR:s where the client is updated.

To do the same thing today you would need to find something in the client that should be mutually exclusive between branches.

Might be some other metadata that would be nice to add at the same time but this came to mind because we had an explicit question of “did you generate the client from branch x or branch y?” since it was not obvious from the PR.

Great point, definitely there’s something to be improved here.
But is the real problem knowing that the generated client is in sync with the rest of the changes?
If so, perhaps a bigger improvement would be to have Encore automatically generate the client when necessary.

I guess it’s a part of that problem - not entirely sure how you would solve it though, especially if it’s two different repositories. At least having the source branch and the date it was generated at the top of the file would go a fair bit of the way to solving the issues for us.

The drawback of having that information in the file is that it causes merge conflicts even if nothing has changed in the client.

But if it’s an optional feature it is at least expected.
We’ll have a think about this!