Skip to content

Releases: powersync-ja/powersync-js

@powersync/[email protected]

08 Aug 09:04
03831dc
Compare
Choose a tag to compare

Minor Changes

  • 7ad251a: Added CJS specific type declarations.

Patch Changes

  • 7609155: Marked AbstractPowerSyncDatabase.dispose method as deprecated. The AbstractPowerSyncDatabase.close method should be used instead.
  • 7f2c53d: Fix warning when reconnecting during CRUD uploads and using the Rust client.

@powersync/[email protected]

08 Aug 09:04
03831dc
Compare
Choose a tag to compare

Minor Changes

  • 7ad251a: Updated package exports to reflect ESM exports. Added CommonJS exports.

Patch Changes

@powersync/[email protected]

08 Aug 09:04
03831dc
Compare
Choose a tag to compare

Patch Changes

@powersync/[email protected]

31 Jul 14:30
47a2302
Compare
Choose a tag to compare

Patch Changes

  • 8cc3335: Updated sql-js upstream version to support rust sync implementation.
  • 074f4cd: Only calling db.export() if a persister is specified, otherwise it is no-op. Improves in-memory performance.

[email protected]

30 Jul 07:58
a95ccbb
Compare
Choose a tag to compare
  • Added a local development option with local Supabase and PowerSync services.
  • Updated Sync rules to use client parameters. Each client now only syncs document and document_updates for the document being edited.
  • Updated PowerSyncYjsProvider to use an incremental watched query for document_updates.

@powersync/[email protected]

30 Jul 07:58
a95ccbb
Compare
Choose a tag to compare

Minor Changes

  • 79acd89: Export AsyncDatabaseConnection (and related) types for internal use
  • c7d2b53: Improved query behaviour when client is closed. Pending requests will be aborted, future requests will be rejected with an Error. Fixed read and write lock requests not respecting timeout parameter.

Patch Changes

  • 319012e: Fixed bug where a WebSocket connection timeout could cause an uncaught exception.
  • 6b38551: Fix a warning about raw tables being used when they're not.
  • Updated dependencies [319012e]
  • Updated dependencies [c7d2b53]
  • Updated dependencies [6b38551]
  • Updated dependencies [a1abb15]

@powersync/[email protected]

30 Jul 07:58
a95ccbb
Compare
Choose a tag to compare

Minor Changes

  • c7d2b53: [Potentially breaking change] The useQuery hook results are now explicitly defined as readonly. These values should not be mutated.

    • Added the ability to limit re-renders by specifying a rowComparator for query results. The useQuery hook will only emit data changes when the data has changed.
    // The data here will maintain previous object references for unchanged items.
    const { data } = useQuery('SELECT * FROM lists WHERE name = ?', ['aname'], {
      rowComparator: {
        keyBy: (item) => item.id,
        compareBy: (item) => JSON.stringify(item)
      }
    });
    • Added the ability to subscribe to an existing instance of a WatchedQuery
    <script setup>
    import { useWatchedQuerySubscription } from '@powersync/vue';
    
    const listsQuery = powerSync
      .query({
        sql: `SELECT * FROM lists`
      })
      .differentialWatch();
    
    const { data, isLoading, isFetching, error } = useWatchedQuerySubscription(listsQuery);
    </script>
    
    <template>
      <div v-if="isLoading">Loading...</div>
      <div v-else-if="isFetching">Updating results...</div>
    
      <div v-if="error">{{ error }}</div>
      <ul v-else>
        <li v-for="l in data" :key="l.id">{{ l.name }}</li>
      </ul>
    </template>
  • c7d2b53: - [Internal] Updated implementation to use shared WatchedQuery implementation.

Patch Changes

@powersync/[email protected]

30 Jul 07:59
a95ccbb
Compare
Choose a tag to compare

Patch Changes

@powersync/[email protected]

30 Jul 07:58
a95ccbb
Compare
Choose a tag to compare

Minor Changes

  • c7d2b53: - [Internal] Updated implementation to use shared WatchedQuery implementation.

  • c7d2b53: - Added the ability to limit re-renders by specifying a rowComparator for query results. The useQuery hook will only emit data changes when the data has changed.

    // The data here will maintain previous object references for unchanged items.
    const { data } = useQuery('SELECT * FROM lists WHERE name = ?', ['aname'], {
      rowComparator: {
        keyBy: (item) => item.id,
        compareBy: (item) => JSON.stringify(item)
      }
    });
    • Added the ability to subscribe to an existing instance of a WatchedQuery
    import { useWatchedQuerySubscription } from '@powersync/react';
    
    const listsQuery = powerSync
      .query({
        sql: `SELECT * FROM lists`
      })
      .differentialWatch();
    
    export const ListsWidget = (props) => {
      const { data: lists } = useWatchedQuerySubscription(listsQuery);
    
      return (
        <div>
          {lists.map((list) => (
            <div key={list.id}>{list.name}</div>
          ))}
        </div>
      );
    };

Patch Changes

@powersync/[email protected]

30 Jul 07:59
a95ccbb
Compare
Choose a tag to compare

Patch Changes