Adopt generic data-layer record types in example apps#874
Draft
amcclain wants to merge 1 commit into
Draft
Conversation
* Threaded record types through the generic `GridModel<T>` / `StoreRecord<T>` in the portfolio, recalls, and todo examples (`Position`, `Recall`, `Task`). * Moved exported business-concept interfaces (`Position`, `PricedRawPosition`, `Task`) to the top of their files with one-line doc comments, and documented `Recall`. * Used `import type` for the type-only interface imports. * Strengthened typing across the todo example: typed all service/model method signatures, added a `DueDateGroup` union and modeled the persisted `StoredTask` shape separately from the domain `Task`, and annotated the boundaries where framework callbacks (`RecordAction`, `CellContext`, ag-Grid events, `FormModel.values`) cannot yet carry the record type. * Enabled the local hoist-react `paths` mapping in `tsconfig.json` for the duration of this branch so the app type-checks against the generic data layer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to xh/hoist-react#4458 — exercises the new generic
GridModel<T>/StoreRecord<T>/Store<T>record types in Toolbox's example apps and tightens their typing along the way.Changes
GridModel<T>/StoreRecord<T>in the portfolio, recalls, and todo examples (Position,Recall,Task).Position,PricedRawPosition,Task) to the top of their files with one-line doc comments; documentedRecall.import typefor the type-only interface imports.DueDateGroupunion, modeled the persistedStoredTaskshape separately from the domainTask, and annotated the boundaries where framework callbacks (RecordAction,CellContext, ag-Grid events,FormModel.values) cannot yet carry the record type.tsconfig.jsonhas the local hoist-reactpathsmapping enabled so the app type-checks against the generic data layer in the companion branch. To be reverted once those types ship in a published@xh/hoistsnapshot.as Taskcasts are needed) exist to highlight where the framework could push generics further. Expected to be trimmed before merge.Depends on xh/hoist-react#4458.