Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Version Packages #3425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Version Packages #3425

wants to merge 1 commit into from

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Mar 20, 2025

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

Releases

@data-client/[email protected]

Minor Changes

  • #3449 1f491a9 Thanks @ntucker! - BREAKING CHANGE: schema.normalize(...args, addEntity, getEntity, checkLoop) -> schema.normalize(...args, delegate)

    We consolidate all 'callback' functions during recursion calls into a single 'delegate' argument.

    /** Helpers during schema.normalize() */
    export interface INormalizeDelegate {
      /** Action meta-data for this normalize call */
      readonly meta: { fetchedAt: number; date: number; expiresAt: number };
      /** Gets any previously normalized entity from store */
      getEntity: GetEntity;
      /** Updates an entity using merge lifecycles when it has previously been set */
      mergeEntity(
        schema: Mergeable & { indexes?: any },
        pk: string,
        incomingEntity: any,
      ): void;
      /** Sets an entity overwriting any previously set values */
      setEntity(
        schema: { key: string; indexes?: any },
        pk: string,
        entity: any,
        meta?: { fetchedAt: number; date: number; expiresAt: number },
      ): void;
      /** Returns true when we're in a cycle, so we should not continue recursing */
      checkLoop(key: string, pk: string, input: object): boolean;
    }

    Before

    addEntity(this, processedEntity, id);

    After

    delegate.mergeEntity(this, id, processedEntity);
  • #3451 4939456 Thanks @ntucker! - state.entityMeta -> state.entitiesMeta

  • #3394 d44d36a Thanks @ntucker! - Change NetworkManager bookkeeping data structure for inflight fetches

    BREAKING CHANGE: NetworkManager.fetched, NetworkManager.rejectors, NetworkManager.resolvers, NetworkManager.fetchedAt
    -> NetworkManager.fetching

    Before

    if (action.key in this.fetched)

    After

    if (this.fetching.has(action.key))
  • #3449 1f491a9 Thanks @ntucker! - BREAKING CHANGE: schema.queryKey(args, queryKey, getEntity, getIndex) -> schema.queryKey(args, unvisit, delegate)
    BREAKING CHANGE: delegate.getIndex() returns the index directly, rather than object.

    We consolidate all 'callback' functions during recursion calls into a single 'delegate' argument.

    Our recursive call is renamed from queryKey to unvisit, and does not require the last two arguments.

    /** Accessors to the currently processing state while building query */
    export interface IQueryDelegate {
      getEntity: GetEntity;
      getIndex: GetIndex;
    }

    Before

    queryKey(args, queryKey, getEntity, getIndex) {
      getIndex(schema.key, indexName, value)[value];
      getEntity(this.key, id);
      return queryKey(this.schema, args, getEntity, getIndex);
    }

    After

    queryKey(args, unvisit, delegate) {
      delegate.getIndex(schema.key, indexName, value);
      delegate.getEntity(this.key, id);
      return unvisit(this.schema, args);
    }

Patch Changes

@data-client/[email protected]

Minor Changes

  • #3461 939a4b0 Thanks @ntucker! - Add delegate.INVALID to queryKey

    This is used in schema.All.queryKey().

    Before

    queryKey(args: any, unvisit: any, delegate: IQueryDelegate): any {
      if (!found) return INVALID;
    }

    After

    queryKey(args: any, unvisit: any, delegate: IQueryDelegate): any {
      if (!found) return delegate.INVALID;
    }
  • #3461 939a4b0 Thanks @ntucker! - Add delegate.invalidate() to normalization

    Before

    normalize(
      input: any,
      parent: any,
      key: string | undefined,
      args: any[],
      visit: (...args: any) => any,
      delegate: INormalizeDelegate,
    ): string {
      delegate.setEntity(this as any, pk, INVALID);
    }

    After

    normalize(
      input: any,
      parent: any,
      key: string | undefined,
      args: any[],
      visit: (...args: any) => any,
      delegate: INormalizeDelegate,
    ): string {
      delegate.invalidate(this as any, pk);
    }
  • #3449 1f491a9 Thanks @ntucker! - BREAKING CHANGE: schema.normalize(...args, addEntity, getEntity, checkLoop) -> schema.normalize(...args, delegate)

    We consolidate all 'callback' functions during recursion calls into a single 'delegate' argument.

    /** Helpers during schema.normalize() */
    export interface INormalizeDelegate {
      /** Action meta-data for this normalize call */
      readonly meta: { fetchedAt: number; date: number; expiresAt: number };
      /** Gets any previously normalized entity from store */
      getEntity: GetEntity;
      /** Updates an entity using merge lifecycles when it has previously been set */
      mergeEntity(
        schema: Mergeable & { indexes?: any },
        pk: string,
        incomingEntity: any,
      ): void;
      /** Sets an entity overwriting any previously set values */
      setEntity(
        schema: { key: string; indexes?: any },
        pk: string,
        entity: any,
        meta?: { fetchedAt: number; date: number; expiresAt: number },
      ): void;
      /** Returns true when we're in a cycle, so we should not continue recursing */
      checkLoop(key: string, pk: string, input: object): boolean;
    }

    Before

    addEntity(this, processedEntity, id);

    After

    delegate.mergeEntity(this, id, processedEntity);
  • #3461 939a4b0 Thanks @ntucker! - Remove INVALID symbol export

    Schemas can use delegate.invalidate() in normalize() or return delegate.INVALID in queryKey().

  • #3449 1f491a9 Thanks @ntucker! - BREAKING CHANGE: schema.queryKey(args, queryKey, getEntity, getIndex) -> schema.queryKey(args, unvisit, delegate)
    BREAKING CHANGE: delegate.getIndex() returns the index directly, rather than object.

    We consolidate all 'callback' functions during recursion calls into a single 'delegate' argument.

    Our recursive call is renamed from queryKey to unvisit, and does not require the last two arguments.

    /** Accessors to the currently processing state while building query */
    export interface IQueryDelegate {
      getEntity: GetEntity;
      getIndex: GetIndex;
    }

    Before

    queryKey(args, queryKey, getEntity, getIndex) {
      getIndex(schema.key, indexName, value)[value];
      getEntity(this.key, id);
      return queryKey(this.schema, args, getEntity, getIndex);
    }

    After

    queryKey(args, unvisit, delegate) {
      delegate.getIndex(schema.key, indexName, value);
      delegate.getEntity(this.key, id);
      return unvisit(this.schema, args);
    }

Patch Changes

@data-client/[email protected]

Minor Changes

  • #3461 939a4b0 Thanks @ntucker! - Add delegate.INVALID to queryKey

    This is used in schema.All.queryKey().

    Before

    queryKey(args: any, unvisit: any, delegate: IQueryDelegate): any {
      if (!found) return INVALID;
    }

    After

    queryKey(args: any, unvisit: any, delegate: IQueryDelegate): any {
      if (!found) return delegate.INVALID;
    }
  • #3461 939a4b0 Thanks @ntucker! - Add delegate.invalidate() to normalization

    Before

    normalize(
      input: any,
      parent: any,
      key: string | undefined,
      args: any[],
      visit: (...args: any) => any,
      delegate: INormalizeDelegate,
    ): string {
      delegate.setEntity(this as any, pk, INVALID);
    }

    After

    normalize(
      input: any,
      parent: any,
      key: string | undefined,
      args: any[],
      visit: (...args: any) => any,
      delegate: INormalizeDelegate,
    ): string {
      delegate.invalidate(this as any, pk);
    }
  • #3449 1f491a9 Thanks @ntucker! - BREAKING CHANGE: schema.normalize(...args, addEntity, getEntity, checkLoop) -> schema.normalize(...args, delegate)

    We consolidate all 'callback' functions during recursion calls into a single 'delegate' argument.

    /** Helpers during schema.normalize() */
    export interface INormalizeDelegate {
      /** Action meta-data for this normalize call */
      readonly meta: { fetchedAt: number; date: number; expiresAt: number };
      /** Gets any previously normalized entity from store */
      getEntity: GetEntity;
      /** Updates an entity using merge lifecycles when it has previously been set */
      mergeEntity(
        schema: Mergeable & { indexes?: any },
        pk: string,
        incomingEntity: any,
      ): void;
      /** Sets an entity overwriting any previously set values */
      setEntity(
        schema: { key: string; indexes?: any },
        pk: string,
        entity: any,
        meta?: { fetchedAt: number; date: number; expiresAt: number },
      ): void;
      /** Returns true when we're in a cycle, so we should not continue recursing */
      checkLoop(key: string, pk: string, input: object): boolean;
    }

    Before

    addEntity(this, processedEntity, id);

    After

    delegate.mergeEntity(this, id, processedEntity);
  • #3461 939a4b0 Thanks @ntucker! - Remove INVALID symbol export

    Schemas can use delegate.invalidate() in normalize() or return delegate.INVALID in queryKey().

  • #3449 1f491a9 Thanks @ntucker! - BREAKING CHANGE: schema.queryKey(args, queryKey, getEntity, getIndex) -> schema.queryKey(args, unvisit, delegate)
    BREAKING CHANGE: delegate.getIndex() returns the index directly, rather than object.

    We consolidate all 'callback' functions during recursion calls into a single 'delegate' argument.

    Our recursive call is renamed from queryKey to unvisit, and does not require the last two arguments.

    /** Accessors to the currently processing state while building query */
    export interface IQueryDelegate {
      getEntity: GetEntity;
      getIndex: GetIndex;
    }

    Before

    queryKey(args, queryKey, getEntity, getIndex) {
      getIndex(schema.key, indexName, value)[value];
      getEntity(this.key, id);
      return queryKey(this.schema, args, getEntity, getIndex);
    }

    After

    queryKey(args, unvisit, delegate) {
      delegate.getIndex(schema.key, indexName, value);
      delegate.getEntity(this.key, id);
      return unvisit(this.schema, args);
    }

Patch Changes

@data-client/[email protected]

Minor Changes

Patch Changes

@data-client/[email protected]

Minor Changes

  • #3421 246cde6 Thanks @ntucker! - BREAKING CHANGE: Denormalize always transforms immutablejs entities into the class

    Previously using ImmutableJS structures when calling denormalize() would maintain
    nested schemas as immutablejs structures still. Now everything is converted to normal JS.
    This is how the types have always been specified.

  • #3461 939a4b0 Thanks @ntucker! - Add delegate.INVALID to queryKey

    This is used in schema.All.queryKey().

    Before

    queryKey(args: any, unvisit: any, delegate: IQueryDelegate): any {
      if (!found) return INVALID;
    }

    After

    queryKey(args: any, unvisit: any, delegate: IQueryDelegate): any {
      if (!found) return delegate.INVALID;
    }
  • #3461 939a4b0 Thanks @ntucker! - Add delegate.invalidate() to normalization

    Before

    normalize(
      input: any,
      parent: any,
      key: string | undefined,
      args: any[],
      visit: (...args: any) => any,
      delegate: INormalizeDelegate,
    ): string {
      delegate.setEntity(this as any, pk, INVALID);
    }

    After

    normalize(
      input: any,
      parent: any,
      key: string | undefined,
      args: any[],
      visit: (...args: any) => any,
      delegate: INormalizeDelegate,
    ): string {
      delegate.invalidate(this as any, pk);
    }
  • #3454 66e1906 Thanks @ntucker! - BREAKING CHANGE: MemoCache.query() and MemoCache.buildQueryKey() take state as one argument

    Before

    this.memo.buildQueryKey(schema, args, state.entities, state.indexes, key);

    After

    this.memo.buildQueryKey(schema, args, state, key);

    Before

    this.memo.query(schema, args, state.entities, state.indexes);

    After

    this.memo.query(schema, args, state);
  • #3449 1f491a9 Thanks @ntucker! - BREAKING CHANGE: schema.normalize(...args, addEntity, getEntity, checkLoop) -> schema.normalize(...args, delegate)

    We consolidate all 'callback' functions during recursion calls into a single 'delegate' argument.

    /** Helpers during schema.normalize() */
    export interface INormalizeDelegate {
      /** Action meta-data for this normalize call */
      readonly meta: { fetchedAt: number; date: number; expiresAt: number };
      /** Gets any previously normalized entity from store */
      getEntity: GetEntity;
      /** Updates an entity using merge lifecycles when it has previously been set */
      mergeEntity(
        schema: Mergeable & { indexes?: any },
        pk: string,
        incomingEntity: any,
      ): void;
      /** Sets an entity overwriting any previously set values */
      setEntity(
        schema: { key: string; indexes?: any },
        pk: string,
        entity: any,
        meta?: { fetchedAt: number; date: number; expiresAt: number },
      ): void;
      /** Returns true when we're in a cycle, so we should not continue recursing */
      checkLoop(key: string, pk: string, input: object): boolean;
    }

    Before

    addEntity(this, processedEntity, id);

    After

    delegate.mergeEntity(this, id, processedEntity);
  • #3451 4939456 Thanks @ntucker! - state.entityMeta -> state.entitiesMeta

  • #3372 25b153a Thanks @ntucker! - MemoCache.query returns { data, paths } just like denormalize. data could be INVALID

    Before

    return this.memo.query(schema, args, state);

    After

    const { data } = this.memo.query(schema, args, state);
    return typeof data === 'symbol' ? undefined : (data as any);
  • #3449 1f491a9 Thanks @ntucker! - BREAKING CHANGE: schema.queryKey(args, queryKey, getEntity, getIndex) -> schema.queryKey(args, unvisit, delegate)
    BREAKING CHANGE: delegate.getIndex() returns the index directly, rather than object.

    We consolidate all 'callback' functions during recursion calls into a single 'delegate' argument.

    Our recursive call is renamed from queryKey to unvisit, and does not require the last two arguments.

    /** Accessors to the currently processing state while building query */
    export interface IQueryDelegate {
      getEntity: GetEntity;
      getIndex: GetIndex;
    }

    Before

    queryKey(args, queryKey, getEntity, getIndex) {
      getIndex(schema.key, indexName, value)[value];
      getEntity(this.key, id);
      return queryKey(this.schema, args, getEntity, getIndex);
    }

    After

    queryKey(args, unvisit, delegate) {
      delegate.getIndex(schema.key, indexName, value);
      delegate.getEntity(this.key, id);
      return unvisit(this.schema, args);
    }

@data-client/[email protected]

Minor Changes

  • #3459 997ca20 Thanks @ntucker! - BREAKING CHANGE: useDebounce() returns [val, isPending]

    This was previously exported in @data-client/react/next to make migrations easy. This will
    still be available there.

    Before

    import { useDebounce } from '@data-client/react';
    const debouncedQuery = useDebounce(query, 100);

    After

    import { useDebounce } from '@data-client/react';
    const [debouncedQuery] = useDebounce(query, 100);

    Before

    import { useDebounce } from '@data-client/react/next';
    const [debouncedQuery, isPending] = useDebounce(query, 100);

    After

    import { useDebounce } from '@data-client/react';
    const [debouncedQuery, isPending] = useDebounce(query, 100);
  • #3449 1f491a9 Thanks @ntucker! - BREAKING CHANGE: schema.normalize(...args, addEntity, getEntity, checkLoop) -> schema.normalize(...args, delegate)

    We consolidate all 'callback' functions during recursion calls into a single 'delegate' argument.

    /** Helpers during schema.normalize() */
    export interface INormalizeDelegate {
      /** Action meta-data for this normalize call */
      readonly meta: { fetchedAt: number; date: number; expiresAt: number };
      /** Gets any previously normalized entity from store */
      getEntity: GetEntity;
      /** Updates an entity using merge lifecycles when it has previously been set */
      mergeEntity(
        schema: Mergeable & { indexes?: any },
        pk: string,
        incomingEntity: any,
      ): void;
      /** Sets an entity overwriting any previously set values */
      setEntity(
        schema: { key: string; indexes?: any },
        pk: string,
        entity: any,
        meta?: { fetchedAt: number; date: number; expiresAt: number },
      ): void;
      /** Returns true when we're in a cycle, so we should not continue recursing */
      checkLoop(key: string, pk: string, input: object): boolean;
    }

    Before

    addEntity(this, processedEntity, id);

    After

    delegate.mergeEntity(this, id, processedEntity);
  • #3451 4939456 Thanks @ntucker! - state.entityMeta -> state.entitiesMeta

  • #3449 1f491a9 Thanks @ntucker! - BREAKING CHANGE: schema.queryKey(args, queryKey, getEntity, getIndex) -> schema.queryKey(args, unvisit, delegate)
    BREAKING CHANGE: delegate.getIndex() returns the index directly, rather than object.

    We consolidate all 'callback' functions during recursion calls into a single 'delegate' argument.

    Our recursive call is renamed from queryKey to unvisit, and does not require the last two arguments.

    /** Accessors to the currently processing state while building query */
    export interface IQueryDelegate {
      getEntity: GetEntity;
      getIndex: GetIndex;
    }

    Before

    queryKey(args, queryKey, getEntity, getIndex) {
      getIndex(schema.key, indexName, value)[value];
      getEntity(this.key, id);
      return queryKey(this.schema, args, getEntity, getIndex);
    }

    After

    queryKey(args, unvisit, delegate) {
      delegate.getIndex(schema.key, indexName, value);
      delegate.getEntity(this.key, id);
      return unvisit(this.schema, args);
    }

Patch Changes

@data-client/[email protected]

Minor Changes

  • #3461 939a4b0 Thanks @ntucker! - Add delegate.INVALID to queryKey

    This is used in schema.All.queryKey().

    Before

    queryKey(args: any, unvisit: any, delegate: IQueryDelegate): any {
      if (!found) return INVALID;
    }

    After

    queryKey(args: any, unvisit: any, delegate: IQueryDelegate): any {
      if (!found) return delegate.INVALID;
    }
  • #3461 939a4b0 Thanks @ntucker! - Add delegate.invalidate() to normalization

    Before

    normalize(
      input: any,
      parent: any,
      key: string | undefined,
      args: any[],
      visit: (...args: any) => any,
      delegate: INormalizeDelegate,
    ): string {
      delegate.setEntity(this as any, pk, INVALID);
    }

    After

    normalize(
      input: any,
      parent: any,
      key: string | undefined,
      args: any[],
      visit: (...args: any) => any,
      delegate: INormalizeDelegate,
    ): string {
      delegate.invalidate(this as any, pk);
    }
  • #3449 1f491a9 Thanks @ntucker! - BREAKING CHANGE: schema.normalize(...args, addEntity, getEntity, checkLoop) -> schema.normalize(...args, delegate)

    We consolidate all 'callback' functions during recursion calls into a single 'delegate' argument.

    /** Helpers during schema.normalize() */
    export interface INormalizeDelegate {
      /** Action meta-data for this normalize call */
      readonly meta: { fetchedAt: number; date: number; expiresAt: number };
      /** Gets any previously normalized entity from store */
      getEntity: GetEntity;
      /** Updates an entity using merge lifecycles when it has previously been set */
      mergeEntity(
        schema: Mergeable & { indexes?: any },
        pk: string,
        incomingEntity: any,
      ): void;
      /** Sets an entity overwriting any previously set values */
      setEntity(
        schema: { key: string; indexes?: any },
        pk: string,
        entity: any,
        meta?: { fetchedAt: number; date: number; expiresAt: number },
      ): void;
      /** Returns true when we're in a cycle, so we should not continue recursing */
      checkLoop(key: string, pk: string, input: object): boolean;
    }

    Before

    addEntity(this, processedEntity, id);

    After

    delegate.mergeEntity(this, id, processedEntity);
  • #3461 939a4b0 Thanks @ntucker! - Remove INVALID symbol export

    Schemas can use delegate.invalidate() in normalize() or return delegate.INVALID in queryKey().

  • #3449 1f491a9 Thanks @ntucker! - BREAKING CHANGE: schema.queryKey(args, queryKey, getEntity, getIndex) -> schema.queryKey(args, unvisit, delegate)
    BREAKING CHANGE: delegate.getIndex() returns the index directly, rather than object.

    We consolidate all 'callback' functions during recursion calls into a single 'delegate' argument.

    Our recursive call is renamed from queryKey to unvisit, and does not require the last two arguments.

    /** Accessors to the currently processing state while building query */
    export interface IQueryDelegate {
      getEntity: GetEntity;
      getIndex: GetIndex;
    }

    Before

    queryKey(args, queryKey, getEntity, getIndex) {
      getIndex(schema.key, indexName, value)[value];
      getEntity(this.key, id);
      return queryKey(this.schema, args, getEntity, getIndex);
    }

    After

    queryKey(args, unvisit, delegate) {
      delegate.getIndex(schema.key, indexName, value);
      delegate.getEntity(this.key, id);
      return unvisit(this.schema, args);
    }

Patch Changes

@data-client/[email protected]

Minor Changes

  • #3394 d44d36a Thanks @ntucker! - Change NetworkManager bookkeeping data structure for inflight fetches

    BREAKING CHANGE: NetworkManager.fetched, NetworkManager.rejectors, NetworkManager.resolvers, NetworkManager.fetchedAt
    -> NetworkManager.fetching

    Before

    if (action.key in this.fetched)

    After

    if (this.fetching.has(action.key))
  • 769cb78 Thanks @ntucker! - Support 0.15 of @data-client/react

[email protected]

Patch Changes

[email protected]

Patch Changes

[email protected]

Patch Changes

[email protected]

Patch Changes

[email protected]

Patch Changes

[email protected]

Patch Changes

Copy link

codecov bot commented Mar 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.78%. Comparing base (fdfb34d) to head (b20a706).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3425   +/-   ##
=======================================
  Coverage   98.78%   98.78%           
=======================================
  Files         123      123           
  Lines        2221     2221           
  Branches      462      462           
=======================================
  Hits         2194     2194           
  Misses         13       13           
  Partials       14       14           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions bot force-pushed the changeset-release/master branch 8 times, most recently from a3af779 to f4a1ecb Compare March 26, 2025 10:00
@github-actions github-actions bot force-pushed the changeset-release/master branch 2 times, most recently from dfd0c0a to 4e94531 Compare March 29, 2025 09:52
@github-actions github-actions bot force-pushed the changeset-release/master branch 14 times, most recently from 6a59f74 to 349fdd8 Compare April 2, 2025 16:00
@github-actions github-actions bot force-pushed the changeset-release/master branch 3 times, most recently from 4e84af9 to 6e4be2f Compare April 7, 2025 16:55
@github-actions github-actions bot force-pushed the changeset-release/master branch 14 times, most recently from 7a8b955 to 8025909 Compare April 10, 2025 10:43
@github-actions github-actions bot force-pushed the changeset-release/master branch 3 times, most recently from ae30f9d to cc7219a Compare April 16, 2025 17:53
@github-actions github-actions bot force-pushed the changeset-release/master branch 6 times, most recently from ea80337 to 979ef31 Compare April 24, 2025 10:33
@github-actions github-actions bot force-pushed the changeset-release/master branch 4 times, most recently from b239f3e to fb6828f Compare May 1, 2025 05:41
@github-actions github-actions bot force-pushed the changeset-release/master branch from fb6828f to 94ff095 Compare May 1, 2025 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants