Skip to content

#78 - Constrain nested model generics - #153

Closed
esitarz wants to merge 1 commit into
masterfrom
feat/78-model-type-params
Closed

esitarz wants to merge 1 commit into
masterfrom
feat/78-model-type-params

Conversation

@esitarz

@esitarz esitarz commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Nested xp parameters are no longer hoisted onto the parent. A model's own xp stays the first parameter (Order<MyOrderXp>, Category<MyCategoryXp>). Each nested model that contributed xp parameters is now one parameter constrained to that model (TFromUser extends OrderUser, TLineItem extends LineItem).
  • OrderWorksheet goes from 17 xp parameters to one parameter per nested property. Order<MyOrderXp, MyFromUserXp> and OrderWorksheet<SomeXp> stop compiling.
  • This is the model half of 14.0.0. Review it here. It will be merged into the 14.0.0 branch so that release contains it with the auth break. Merging this pull request to master does not publish, because package.json stays at 13.0.0.

Refs #78

Test plan

  • npx tsc -p tests/tsconfig.model-types.json passes, including the @ts-expect-error cases for the old call shapes
  • Order, LineItem, and OrderWorksheet signatures match the migration guide
  • Category and Product stay a single xp parameter

Hoisting every nested xp made OrderWorksheet take 17 parameters.
Own xp stays first. Each nested model is now one parameter
constrained to that model, so Order<MyOrderXp> still works.

Refs #78
@esitarz esitarz linked an issue Sep 28, 2026 that may be closed by this pull request
@esitarz esitarz changed the title Constrain nested model generics #78 - Constrain nested model generics Sep 28, 2026
@esitarz esitarz mentioned this pull request Sep 28, 2026
6 of 7 tasks
@esitarz esitarz closed this Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant