Skip to content

Latest commit

 

History

History
266 lines (192 loc) · 8.96 KB

CHANGELOG.md

File metadata and controls

266 lines (192 loc) · 8.96 KB

vNext (TBD)

Deprecations

  • None

Enhancements

  • Add flag to keep realm open on unmount of RealmProvider. (#6023)

Fixed

  • <How to hit and notice issue? what was the impact?> (#????, since v?.?.?)
  • None

Compatibility

  • Realm >= 11.0.0

Internal

  • Added more documentation to provider params.

0.5.2 (2023-08-09)

Fixed

  • Fixed using @realm/react in jest tests, by providing a common js distribution. (#6049

Compatibility

  • React Native >= v0.71.4
  • Realm Studio v14.0.0.
  • File format: generates Realms with format v23 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

Internal

0.5.1 (2023-06-21)

Fixed

  • Include the src in the distributed package. This fixes a warning about source maps being not included.
  • Get the useAuth and useEmailPasswordAuth tsdoc to appear on hover over for LSP enabled IDEs.
  • useEmailPasswordAuth was crashing on v11 since there are no named exports on Realm.

Internal

  • Refactor useAuthOperation to use the reject callback rather than catch.
  • Refactor useAuthOperation to not return a result. All methods are void.

0.5.0 (2023-06-19)

Enhancements

  • Add authentication hooks, useAuth and useEmailPasswordAuth Usage example

  • Allow useQuery to be passed a query function where sorted and filtered methods can be called (#5471) Thanks for the contribution @levipro!

    Example:

     const SomeComponent = () => {
         const user = useUser();
         const items = useQuery(Item,
             (res) => res.filtered(`owner_id == "${user?.id}"`).sorted('createdAt'),
             [user]
         );
     };
  • Create a default context so the RealmProvider, useQuery, useRealm, and useObject can be directly imported from @realm/react (#5292)

    Example:

     // These imports are now available without calling `createRealmContext`
     import {RealmProvider, useQuery} from '@realm/react'
     //...
     // Provider your schema models directly to the realm provider
     <RealmProvider schema={[Item]}>
     	<SomeComponent/>
     </RealmProvider>
    
     const SomeComponent = () => {
     	const items = useQuery(Item)
    
     	//...
     }

    NOTE: If your app is using multiple Realms, then you should continue using createRealmContext

Fixed

  • useUser is now typed to never returned null #4973 Example:
     const user = useUser();
     // before
     console.log(user?.id); // Optional chaining required
     // now
     console.log(user.id); // No typing error
    

Compatibility

  • React Native >= v0.70.0
  • Atlas App Services.
  • Realm Studio v13.0.0.
  • File format: generates Realms with format v23 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

0.4.3 (2023-01-24)

Enhancements

  • Improve AppProvider and UserProvider rendering performance (#5215)

Fixed

  • Stabilized references for Collections, Lists and Objects (#5269)

0.4.2 (2023-1-11)

Enhancements

  • Immediately bind local Realm in the RealmProvider (#5074)

Fixed

  • Prime any list properties with an cachedCollection so that updates fire correctly (#5185)
  • Primary Keys as non-primative values would reset the cached objects, since their reference always changes
  • Create a listener on the collection if the object doesn't exist, and rerender when it is created (#4514)

Compatibility

  • File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

0.4.1 (2022-11-3)

Fixed

  • Fix crash when using useObject with a model containing a List of primitives (#5058)
  • Fix potential infinite rerender issue when using useUser and the UserProvider (#4967)

0.4.0 (2022-10-18)

Enhancements

Internal

  • Update devDependencies for testing:
    • react v18.1.0
    • react-native v0.70.1
      • react-test-renderer v18.1.0
      • @testing-library/react-native v11.2.0
      • @testing-library/jest-native v4.0.13
  • Refactor tests to use updated testing-library

0.4.0-rc.0 (2022-09-14)

Fixed

  • Fix realm collection and object typing to reflect changes to Class Based Models introduced in Realm 11.0.0 (#4905)

Internal

  • Upgrade dev dependency of React Native to 0.70.0 and any relevant packages effected by this upgrade
  • Migrate tests away from @testing-library/react-hooks which is now part of @testing-library/react-native

Compatibility

  • Realm >= v0.11.0

0.3.2 (2022-07-14)

Fixed

  • Fix peer dependency for Realm in package.json to support -rc branches of Realm (#4621)
  • Add generic type parameters to @realm/react hooks (#4716)

0.3.1 (2022-05-31)

Enhancements

  • Add realmRef property to RealmProvider to access the configured realm outside of the provider component (#4571)
    • Additionally appRef on AppProvider was added to provide access to Realm.App from outside the provider component

Fixed

  • Results from useQuery could not be passed to MutableSubscriptionSet.add/remove (#4507, since v0.1.0)

0.3.0 (2022-05-11)

Enhancements

  • Add UserProvider and useUser hook (#4557). Usage example:
import {AppProvider, UserProvider} from '@realm/react'
//...
// Wrap your RealmProvider with the AppProvider and provide an appId
<AppProvider id={appId}>
	<UserProvider fallback={LoginComponent}>
		{/* After login, user will be automatically populated in realm configuration */}
		<RealmProvider sync={{flexible: true}}>
		//...
		</RealmProvider>
	</UserProvider>
</AppProvider>

// Access the app instance using the useApp hook
import {useUser} from '@realm/react'

const SomeComponent = () => {
	const user = useUser()

	//...
}
  • Add AppProvider and useApp hook (#4470). Usage example:
import {AppProvider} from '@realm/react'
//...
// Wrap your RealmProvider with the AppProvider and provide an appId
<AppProvider id={appId}>
	<RealmProvider sync={{user, flexible: true}}>
	//...
	</RealmProvider>
</AppProvider>

// Access the app instance using the useApp hook
import {useApp} from '@realm/react'

const SomeComponent = () => {
	const app = useApp()

	//...
}

Fixed

  • Implicit children was removed from React.FC. Children has now been explicitly added to provider props. (#4565)
  • Fixed potential "Cannot create asynchronous query while in a write transaction" error with useObject due to adding event listeners while in a write transaction (#4375, since v0.1.0)

Compatibility

  • None.

Internal

  • Tests run with --forceExit to prevent them hanging (#4531)

0.2.1 (2022-03-24)

Enhancements

  • Allow createRealmContext to be called without an initial configuration
  • Add a fallback property to RealmProvider that is shown while realm is opening

Fixed

  • Fixed bug when trying to access a collection result with an out of bounds index.(#4416, since v0.2.0)

Compatibility

  • None

Internal

  • None

0.2.0 (2022-03-07)

Enhancements

  • Add ability to import Realm directly from @realm/react
  • Add cachedObject and cachedCollection
    • Ensures that React.Memo that have Realm.Object/Collection as a property only rerender on actual changes
    • Increased compatability with VirtualizedList/FlatList
  • Added more comprehensive documentation in the source code
  • List properties of a Realm.Object now rerender on change
  • Broadened test coverage for collections, lists and linked objects

0.1.0 (2021-11-10)

Enhancements

  • Initial release