Skip to content

Releases: tobyzerner/json-api-models

Release 0.2.0-beta.9

22 Jan 04:44
5f0ea9e
Compare
Choose a tag to compare
Release 0.2.0-beta.9 Pre-release
Pre-release

Fixed

  • Fix reactivity systems not picking up when new properties are added

Release 0.2.0-beta.8

08 Dec 23:22
0d0eec1
Compare
Choose a tag to compare
Release 0.2.0-beta.8 Pre-release
Pre-release

Fixed

  • Fix Schemas not being passed through to Model.store

Release 0.2.0-beta.7

07 Dec 02:10
fe6871d
Compare
Choose a tag to compare
Release 0.2.0-beta.7 Pre-release
Pre-release

Fixed

  • Fix model typing

Release 0.2.0-beta.6

05 Dec 02:49
be62d81
Compare
Choose a tag to compare
Release 0.2.0-beta.6 Pre-release
Pre-release

Changed

  • Revert to non-proxy implementation of model fields

Fixed

  • Make model relationship fields optional

Release 0.2.0-beta.5

02 Oct 03:18
083c0fe
Compare
Choose a tag to compare
Release 0.2.0-beta.5 Pre-release
Pre-release

Fixed

  • Fix falsy attribute values not being returned

Release 0.2.0-beta.4

01 Oct 03:32
536b050
Compare
Choose a tag to compare
Release 0.2.0-beta.4 Pre-release
Pre-release

Changed

  • Remove index signature from Model

Release 0.2.0-beta.3

03 Sep 02:25
4b0df34
Compare
Choose a tag to compare
Release 0.2.0-beta.3 Pre-release
Pre-release

Added

  • Allow syncing null document data.
  • Add exports field to package.json.

Release 0.2.0-beta.1

14 May 06:47
c9661f9
Compare
Choose a tag to compare
Release 0.2.0-beta.1 Pre-release
Pre-release

⚠️ Breaking Changes

  • Rewrite TypeScript support to allow Intellisense based on JSON:API resource schema. For example:

    type UsersSchema = {
        type: 'users';
        id: string;
        attributes: {
            name: string;
        };
        relationships: {
            dog: { data?: { type: 'dogs'; id: string } | null };
        };
    };
    
    class User extends Model<UsersSchema> {}

    To type related resources, you can provide a collection of all models as the second generic.

    type DogsSchema = {
        // ...
    };
    
    type Schemas = {
        users: User;
        dogs: Dog;
    };
    
    class User extends Model<UsersSchema, Schemas> {}
    class Dog extends Model<DogsSchema, Schemas> {}
  • The Store now returns proxied Model instances to implement field getters, instead of Model depending on Store and defining getters for present fields.

  • Remove the Query helper. Use URLSearchParams instead.

  • Remove Model attribute casting functionality. Define getters instead:

    class User extends Model<UserSchema> {
        get createdAtDate() {
            return new Date(this.createdAt);
        }
    }
  • Remove the Model.getAttribute() and Model.getRelationship() methods.

  • Remove CJS and IIFE exports. Package is now only exported as an ES module.

Release 0.1.0-beta.8

05 Jun 02:29
4cb3441
Compare
Choose a tag to compare
Release 0.1.0-beta.8 Pre-release
Pre-release

Added

  • Support model type inference:
const store = new Store({ users: User });
store.find('users', '1') // User

Removed

  • Remove the Store.model method. Models must now be defined when the Store is constructed.

Release 0.1.0-beta.7

01 Sep 01:10
Compare
Choose a tag to compare
Release 0.1.0-beta.7 Pre-release
Pre-release

Fixed

  • Fix regression with attribute casting not handling dates correctly, and add more sophisticated handling of primitives, constructables, and callables.