Skip to content

2022-11-14 Amplify JS release - aws-amplify@5.0.0

Compare
Choose a tag to compare
@stocaaro stocaaro released this 14 Nov 17:15
· 2374 commits to main since this release

New Features:

  • @aws-amplify/api, @aws-amplify/pubsub
  • @aws-amplify/storage
    • Storage.list supports paginated results. You can also set a set page size by using the pageSize attribute.
    • More information about Storage.list on the Storage documentation
  • @aws-amplify/datastore
    • Lazy loading
      • You can now asynchronously fetch related data in one-line of code. For example: if a post has many comments, you can lazy load comments using the async toArray() function:await post.comments.toArray(). You can also lazy load hasOne relationships, for example: await post.author. DataStore also takes advantage of JavaScript’s built-in async iterator support to make it easier for you to author for loops:
          for await (const comment of post.comments) {
           console.log(comment) // iterates over each comment!
          }
      
    • Nested predicates
      • You can now query based on conditions of related models. For example, if you only want to get the comments of posts with a title starting with “Amplify”, you can now do the following:
        await DataStore.query(Comment, c => c.post.title.beginsWith(“Amplify”)
      • More information about DataStore nested predicates on the DataStore documentation
    • PR 10477
  • New Notifications category @aws-amplify/notifications with support for AWS Pinpoint In-App Messaging channel.
    • You can setup contextual UI messages that can you can show your users when users trigger specific events. PR 10430
    • More information about In-App Messaging on In-App Messaging documentation

Breaking changes:

  • Default exports removed from, e.g.import Auth from '@aws-amplify/auth' is no longer supported
    • @aws-amplify/analytics
    • @aws-amplify/api-rest
    • @aws-amplify/api-graphql
    • @aws-amplify/api
    • @aws-amplify/cache
    • @aws-amplify/datastore
    • @aws-amplify/geo
    • @aws-amplify/interactions
    • @aws-amplify/predictions
    • @aws-amplify/pub
    • @aws-amplify/storage
    • @aws-amplify/xr
    • aws-amplify
  • @aws-amplify/api, @aws-amplify/pubsub: Network subscriptions are automatically reconnected and observables stays available (previously observables were closed after network issues)
  • @aws-amplify/analytics: Analytics.record no longer accepts string as its first param
  • aws-amplify
    • Amplify.Auth,Amplify.Cache, Amplify.ServiceWorker static members are no longer available on Amplify singleton #10562
    • Removed CSS modules export
  • @aws-amplify/pubsub: Removed misspelled type export MqttProvidertOptions from MqttOverWSProvider provider
  • @aws-amplify/core: Removed JS export from in favor of individual function exports #10528
  • @aws-amplify/storage: Storage.list now accepts pageSize instead of maxKeys and also the return value is an object that has result and pagination info.
  • Deprecated legacy UI packages (You can migrate to the new UI packages by following this link):
    • @aws-amplify/ui-vue@"< 1.x"
    • @aws-amplify/ui-react@"< 1.x"
    • @aws-amplify/ui-angular@"< 1.x"
    • @aws-amplify/ui-components@"< 1.x"
    • aws-amplify-vue (all versions)
    • aws-amplify-angular (all versions)
    • aws-amplify-react (all versions)

Breaking change upgrade notes

Other changes:

  • Bundle size reduction:
    • Reduced by 10% on average when authentication (tested with create-react-app)
    • Reduced by 35% on average when unauthenticated (guest) users (tested with create-react-app)
    • Replaced dependencies with smaller alternatives
    • Optimize bundle size for unauthenticated use cases, e.g. recording events or loading images for guests users
    • tslib is used across all the packages with importHelpers option enabled
  • Removed unnecessary artifacts from npm packages reducing installation size

All Changes

Full Changelog: https://github.com/aws-amplify/amplify-js/compare/aws-amplify@4.3.43...aws-amplify@5.0.0