Skip to content

Redux-ORM type declarations #274

Open

Description

@tomasz-zablocki

Redux-ORM repository is the most likely place where people ask questions regarding this topic.

Currently they are scattered around several places, but funneling them into one place would help typescript users with Redux-ORM.

Until we have a full-fledged docs up, this will be the place where I'll put relevant information whenever a @types/redux-orm update is released. There's currently no way of doing this within DefinitelyTyped environment.

Activity

  1. tomasz-zablocki commented on Jul 25, 2019

    @tomasz-zablocki
    CollaboratorAuthor

    typings update

    @types/redux-orm 0.13.4
    redux-orm compatibility ^0.13.3
    DefinitelyTyped PR 37108

    Changes

    • fix toModelArray and toRefArray incorrectly present on Model class
    • add missing param to Model.exists, invalid signature was copied from QuerySet
    • fix argument inference for Model.create - providing values for many fields should not be mandatory
    • various mapped type optimizations - there should be a noticeable improvement in IDE experience

    Type declaration diagnostics

    @types/redux-orm 0.13.3 vs 0.13.4      
    Memory usage (MiB) 44.2 52.8 +19.5%
    Type count 12257 9513 -22.4%
    Assignability cache size 4814 3893 -19.1%
    getCompletionsAtPosition      
    Mean duration (ms) 182.7 148.8 -18.6%
    Median duration (ms) 273.4 178.5 -34.7%
    getQuickInfoAtPosition      
    Mean duration (ms) 197.5 157.0 -20.5%
    Median duration (ms) 278.5 188.7 -32.2%

    Intellisense times reduced by roughly 50% since 0.13.2.

  2. changed the title [-]Redux-ORM type declarations thread[/-] [+]Redux-ORM type declarations[/+] on Jul 25, 2019
  3. tomasz-zablocki commented on Aug 5, 2019

    @tomasz-zablocki
    CollaboratorAuthor

    typings update

    @types/redux-orm 0.13.5
    redux-orm compatibility ^0.13.3
    DefinitelyTyped PR 37293

    Changes

    • fix incorrect type of many arg's throughFields property
  4. pbjorklund commented on Sep 25, 2019

    @pbjorklund

    Much ❤️ for the typings @tomasz-zablocki!

    Is typings for 0.14 in the works or should we roll our own if we need to upgrade in the next day or 2? Saw that you had a 0.14 branch in your typings repo but seemed to be pretty old.

  5. tomasz-zablocki commented on Oct 1, 2019

    @tomasz-zablocki
    CollaboratorAuthor

    @pbjorklund I'll be working on the typings for 0.14 this weekend and next week

  6. tomasz-zablocki commented on Oct 1, 2019

    @tomasz-zablocki
    CollaboratorAuthor

    @haveyaseen I'm back, sorry for the lack of activity - been working hard on ditching my experience and going full-blown node 💪

    Great work on releasing 0.14 and first docs batch. I have a full user guide on descriptors ready soon.

    Additionally, the TypeScript guide is almost done, but I've been reflecting on adding code tabs and relevant typescript snippets to each JS snippet in the guide. This benefit would be a single learning flow for both JS and TS developers.

    What do you think about it ?

  7. tomasz-zablocki commented on Oct 1, 2019

    @tomasz-zablocki
    CollaboratorAuthor

    @pbjorklund you're obviously welcome to contribute to 0.14 branch, the only thing is that I'd rather polish them up in a separate repository (like redux-orm-types) before taking them up to DefinitelyTyped.

    Previously I wanted to suggest moving types to redux-orm package, but this approach has several downsides, so unless there's some rationale for moving them they'll probably remain a part of DT.

  8. pbjorklund commented on Oct 28, 2019

    @pbjorklund

    Well all we added was

    export interface ORMOpts {
            createDatabase?: (schemaSpec: SchemaSpec) => any;
            stateSelector: (state: IAppState) => ORMCommonState;
        }
    

    Writing definitions is not something I do every day :)

  9. tomasz-zablocki commented on Oct 31, 2019

    @tomasz-zablocki
    CollaboratorAuthor

    Added this myself on 0.15 branch, this won't help with new selectors unfortunately

  10. kirbycool commented on Nov 4, 2019

    @kirbycool
    Collaborator

    @tomasz-zablocki How far along are the 0.15 types? I'm going to start using the 0.15 branch in a project and can hopefully help with fixes.

  11. tomasz-zablocki commented on Nov 5, 2019

    @tomasz-zablocki
    CollaboratorAuthor

    @kirbydcool Selectors and support for aliasing fields with as is missing, with the latter being definitely harder among the two. There's a lot of optimization in them, but it comes with a breaking change (vs. 0.13.X) in how Model is declared (via interface and class merging).

    Supporting as seems to be the most difficult thing to type, since it will rack up type complexity quite a lot. As for selectors I haven't honestly thought this through yet.

    I'll go through the changes required for 0.15 compatibility and groom the issue backlog on redux-orm-types, it should be ready before upcoming weekend.

  12. talolard commented on Nov 21, 2019

    @talolard

    Hi @tomasz-zablocki,
    Thanks a lot for your work on this. We're planning to adopt this as soon as it's out. Any sense of an ETA so we can plan accordingly ? Could we be of help in getting this moving ?
    Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions