data-client

Async State Management without the Management

APACHE-2.0 License

Downloads
44.4K
Stars
1.9K
Committers
37

Bot releases are visible (Hide)

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • 664d3eacff Thanks @ntucker! - Remove dev warning for old versions of client

  • #2799 26a3843d1b Thanks @ntucker! - Removed some forms of automatic entity validation

    • Now allow missing schemas making it easier to declare partials
    • Removed logic for certain keys found out of defaults

    We are generally trying to be more lax and focus on catching
    clearly wrong signals. A lot of help comes from network response
    form detection.

  • Updated dependencies [664d3eacff, 26a3843d1b]:

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

  • 664d3eacff Thanks @ntucker! - Remove dev warning for old versions of client

  • #2799 26a3843d1b Thanks @ntucker! - Removed some forms of automatic entity validation

    • Now allow missing schemas making it easier to declare partials
    • Removed logic for certain keys found out of defaults

    We are generally trying to be more lax and focus on catching
    clearly wrong signals. A lot of help comes from network response
    form detection.

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Minor Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Minor Changes

  • #2784 c535f6c0ac Thanks @ntucker! - BREAKING CHANGES:

    • DELETE removed -> INVALIDATE
    • drop all support for legacy schemas
      • entity.expiresAt removed
      • Collections.infer does entity check
      • all Entity overrides for backcompat are removed - operates just like EntitySchema, except with extra validation
  • #2795 79e286109b Thanks @ntucker! - BREAKING: Schema Serializers must support function calls

    This means Date will no longer work like before. Possible migrations:

    class Ticker extends Entity {
      trade_id = 0;
      price = 0;
      time = Temporal.Instant.fromEpochSeconds(0);
    
      pk(): string {
        return `${this.trade_id}`;
      }
      static key = 'Ticker';
    
      static schema = {
        price: Number,
        time: Temporal.Instant.from,
      };
    }
    

    or to continue using Date:

    class Ticker extends Entity {
      trade_id = 0;
      price = 0;
      time = Temporal.Instant.fromEpochSeconds(0);
    
      pk(): string {
        return `${this.trade_id}`;
      }
      static key = 'Ticker';
    
      static schema = {
        price: Number,
        time: (iso: string) => new Date(iso),
      };
    }
    
  • #2792 35ccedceb5 Thanks @ntucker! - BREAKING: Serializer schemas are only processed during denormalization

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Minor Changes

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Minor Changes

  • f65cf832f0 Thanks @ntucker! - BREAKING: Remove all /next exports

  • #2790 3f36f56939 Thanks @ntucker! - Remove support for non-Collection pagination

    BREAKING CHANGE: RestEndpoint with Arrays no longer support .paginated()

  • #2789 440d415bc8 Thanks @ntucker! - getPage,push,unshift,assign should not match name of parent

    const getTodos = new RestEndpoint({
      urlPrefix: 'https://jsonplaceholder.typicode.com',
      path: '/todos',
      schema: new schema.Collection([Todo]),
      name: 'gettodos',
    });
    
    getTodos.getPage.name === 'gettodos.getPage';
    getTodos.push.name === 'gettodos.create';
    getTodos.unshift.name === 'gettodos.create';
    
  • #2795 79e286109b Thanks @ntucker! - BREAKING: Schema Serializers must support function calls

    This means Date will no longer work like before. Possible migrations:

    class Ticker extends Entity {
      trade_id = 0;
      price = 0;
      time = Temporal.Instant.fromEpochSeconds(0);
    
      pk(): string {
        return `${this.trade_id}`;
      }
      static key = 'Ticker';
    
      static schema = {
        price: Number,
        time: Temporal.Instant.from,
      };
    }
    

    or to continue using Date:

    class Ticker extends Entity {
      trade_id = 0;
      price = 0;
      time = Temporal.Instant.fromEpochSeconds(0);
    
      pk(): string {
        return `${this.trade_id}`;
      }
      static key = 'Ticker';
    
      static schema = {
        price: Number,
        time: (iso: string) => new Date(iso),
      };
    }
    

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Minor Changes

  • f65cf832f0 Thanks @ntucker! - BREAKING: Remove all /next exports

  • #2787 8ec35d7143 Thanks @ntucker! - Remove makeCacheProvider

    Current testing version is already using the provider Component directly

    import { CacheProvider } from '@data-client/react';
    const renderDataClient = makeRenderDataClient(CacheProvider);
    
  • #2785 c6a2071178 Thanks @ntucker! - Add className to error boundary and errorClassName to AsyncBoundary

    <AsyncBoundary errorClassName="error">
      <Stuff/>
    </AsyncBounary>
    
    <NetworkErrorBoundary className="error">
      <Stuff />
    </NetworkErrorBoundary>
    
  • #2784 c535f6c0ac Thanks @ntucker! - BREAKING CHANGES:

    • DELETE removed -> INVALIDATE
    • drop all support for legacy schemas
      • entity.expiresAt removed
      • Collections.infer does entity check
      • all Entity overrides for backcompat are removed - operates just like EntitySchema, except with extra validation
  • #2782 d3343d42b9 Thanks @ntucker! - Remove all 'receive' action names (use 'set' instead)

    BREAKING CHANGE:

    • remove ReceiveAction
    • ReceiveTypes -> SetTypes
    • remove Controller.receive Controller.receiveError
    • NetworkManager.handleReceive -> handleSet
  • #2791 a726d9178a Thanks @ntucker! - CacheProvider elements no longer share default managers

    New export: getDefaultManagers()

    BREAKING CHANGE: Newly mounted CacheProviders will have new manager
    objects when default is used

  • #2795 79e286109b Thanks @ntucker! - BREAKING: Schema Serializers must support function calls

    This means Date will no longer work like before. Possible migrations:

    class Ticker extends Entity {
      trade_id = 0;
      price = 0;
      time = Temporal.Instant.fromEpochSeconds(0);
    
      pk(): string {
        return `${this.trade_id}`;
      }
      static key = 'Ticker';
    
      static schema = {
        price: Number,
        time: Temporal.Instant.from,
      };
    }
    

    or to continue using Date:

    class Ticker extends Entity {
      trade_id = 0;
      price = 0;
      time = Temporal.Instant.fromEpochSeconds(0);
    
      pk(): string {
        return `${this.trade_id}`;
      }
      static key = 'Ticker';
    
      static schema = {
        price: Number,
        time: (iso: string) => new Date(iso),
      };
    }
    
  • #2781 5ff1d65eb5 Thanks @ntucker! - Prefix action types with 'rdc'

    BREAKING CHANGE: Action types have new names

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Minor Changes

  • 837cf57883 Thanks @ntucker! - Remove newActions export

    (All members continue to be exported at top level)

  • f65cf832f0 Thanks @ntucker! - BREAKING: Remove all /next exports

  • #2786 c865415ce5 Thanks @ntucker! - Middleware no longer gets controller prop.

    The entire API is controller itself:
    ({controller}) => next => async action => {} ->
    (controller) => next => async action => {}

    class LoggingManager implements Manager {
      getMiddleware = (): Middleware => controller => next => async action => {
        console.log('before', action, controller.getState());
        await next(action);
        console.log('after', action, controller.getState());
      };
    
      cleanup() {}
    }
    

    Note this has been possible for some time this simply drops
    legacy compatibility.

  • #2784 c535f6c0ac Thanks @ntucker! - BREAKING CHANGES:

    • DELETE removed -> INVALIDATE
    • drop all support for legacy schemas
      • entity.expiresAt removed
      • Collections.infer does entity check
      • all Entity overrides for backcompat are removed - operates just like EntitySchema, except with extra validation
  • #2782 d3343d42b9 Thanks @ntucker! - Remove all 'receive' action names (use 'set' instead)

    BREAKING CHANGE:

    • remove ReceiveAction
    • ReceiveTypes -> SetTypes
    • remove Controller.receive Controller.receiveError
    • NetworkManager.handleReceive -> handleSet
  • #2781 5ff1d65eb5 Thanks @ntucker! - Prefix action types with 'rdc'

    BREAKING CHANGE: Action types have new names

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Minor Changes

  • #2784 c535f6c0ac Thanks @ntucker! - BREAKING CHANGES:

    • DELETE removed -> INVALIDATE
    • drop all support for legacy schemas
      • entity.expiresAt removed
      • Collections.infer does entity check
      • all Entity overrides for backcompat are removed - operates just like EntitySchema, except with extra validation
  • #2795 79e286109b Thanks @ntucker! - BREAKING: Schema Serializers must support function calls

    This means Date will no longer work like before. Possible migrations:

    class Ticker extends Entity {
      trade_id = 0;
      price = 0;
      time = Temporal.Instant.fromEpochSeconds(0);
    
      pk(): string {
        return `${this.trade_id}`;
      }
      static key = 'Ticker';
    
      static schema = {
        price: Number,
        time: Temporal.Instant.from,
      };
    }
    

    or to continue using Date:

    class Ticker extends Entity {
      trade_id = 0;
      price = 0;
      time = Temporal.Instant.fromEpochSeconds(0);
    
      pk(): string {
        return `${this.trade_id}`;
      }
      static key = 'Ticker';
    
      static schema = {
        price: Number,
        time: (iso: string) => new Date(iso),
      };
    }
    

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] about 1 year ago

Patch Changes