You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't have a minimally reproducible example, but here's what happens in our project:
Generate the *.schema.ts output of type react-query from some OpenAPI schema.
Add a new component in the OpenAPI schema.
Re-generate *.schemas.ts.
What happens?
The newly added component correctly appears as a new type in the generated schema. However, the order of the other types in the generated schema changes unnecessarily, and seemingly at random. As a result, the diff of the schema is noisy, and it significantly increases the size of the PRs with schema changes.
What were you expecting to happen?
I expected the new type to appear in the generated schemas.ts file, with the order of the other types staying the same.
Any logs, error output, etc?
No specific log output, but here's a screenshot of it happening in our project: Types moved around, even though they had nothing to do with the change to the OpenAPI schema.
Any other comments?
I don't know how orval is implemented. But I suspect that the instability could come from modelling the component names as a hash set, where the order is not stable.
The text was updated successfully, but these errors were encountered:
severinh
changed the title
Types in generated react-query schema have unstable/non-deterministic order, creating noisy diffs
Types in generated react-query schema have unstable order, creating noisy diffs
May 17, 2024
severinh
changed the title
Types in generated react-query schema have unstable order, creating noisy diffs
Types in generated react-query schema have unstable order, causing noisy diffs
May 17, 2024
What are the steps to reproduce this issue?
I don't have a minimally reproducible example, but here's what happens in our project:
*.schema.ts
output of typereact-query
from some OpenAPI schema.*.schemas.ts
.What happens?
The newly added component correctly appears as a new type in the generated schema. However, the order of the other types in the generated schema changes unnecessarily, and seemingly at random. As a result, the diff of the schema is noisy, and it significantly increases the size of the PRs with schema changes.
What were you expecting to happen?
I expected the new type to appear in the generated
schemas.ts
file, with the order of the other types staying the same.Any logs, error output, etc?
No specific log output, but here's a screenshot of it happening in our project: Types moved around, even though they had nothing to do with the change to the OpenAPI schema.
Any other comments?
I don't know how orval is implemented. But I suspect that the instability could come from modelling the component names as a hash set, where the order is not stable.
What versions are you using?
Operating System: MacOS 14.4.1
Package Version: 6.26.0
Browser Version: Node.js 20
The text was updated successfully, but these errors were encountered: