Skip to content

Releases: DavidDuwaer/Coloquent

v3.0.1-beta

03 Feb 08:24
Compare
Choose a tag to compare

New major version 3.x

  • All configuration now happens with static properties, making it more uniform and reducing runtime memory usage
  • The Model.httpClient is now a property that one can override

Breaking changes | How to upgrade from v2.x

  • The configuratioof your models, namely setting the jsonApiBaseUrl and setting jsonApiType has been slightly altered, moving to exclusive use of static properties. Check the readme to see for how they are set now.

v2.4.1

03 Jan 19:01
Compare
Choose a tag to compare

Fixes

  • It now becomes possible to wrap Coloquent models in proxies

v2.4.0

22 May 09:26
Compare
Choose a tag to compare

Improvements

  • #86 Type hints no longer needed when building a query from the model class. E.g.
    Artist
        .get() // Now a Promise<PluralResult<Artist>>, no longer a
               //       Promise<PluralResult<Model>>

v2.3.0

18 May 09:39
Compare
Choose a tag to compare

Improvements

  • #79 Better cross-platform automatic relation name detection by using error-stack-parser under the hood
  • #80 Possibility to specify generics on relationships and models, that will enable Typescript to infer which model types are returned by all query methods
  • #80 Whether the .get() method returns a SingularResponse or a PluralResponse is now known by the type system, so no more casting is needed

v2.2.0

01 Mar 10:07
Compare
Choose a tag to compare

Features

  • #74 The .query() method on the model is now statically available

Fixes

  • #72 The .fresh() method was not reloading nested relations

v2.1.0

27 Nov 19:04
Compare
Choose a tag to compare
  • A .fresh() method has been added, which can be called on any Model instance to obtain a fresh version of that model from the API
  • A .limit() method has been added to the query builder, which allows you to limit the number of results returned by a query.

Updated all dependencies

28 Oct 21:05
Compare
Choose a tag to compare
v2.0.2

Updated all dependencies & bumped version

Added .query() method to get a query builder from a model instance

28 Oct 20:56
Compare
Choose a tag to compare

Immutable API

26 Oct 11:50
Compare
Choose a tag to compare
  • Query building method chain is now immutable
    For instance, from now on we can do this:
    const allStudentsQuery = Student
        .with('university');
    const firstYearStudentsQuery = allStudentsQuery
        .where('year', 1);
    In version <2, the second statement would have mutated allStudentsQuery as well, and both queries would have been exactly the same. From this release, both allStudentsQuery and firstYearStudentsQuery are what their names describe them to be.

v1.2.8

23 Aug 07:00
Compare
Choose a tag to compare
  • Fixed: wrong URL was generated when querying relations