2022-11-14 Amplify JS release - aws-amplify@5.0.0
stocaaro
released this
14 Nov 17:15
·
2374 commits
to main
since this release
New Features:
@aws-amplify/api
,@aws-amplify/pubsub
- Automatic reconnect for GraphQL and pubsub subscriptions! PR 10235.
- More information about reconnection can be found on GraphQL subscriptions documentation and PubSub subscriptions documentation
@aws-amplify/storage
Storage.list
supports paginated results. You can also set a set page size by using thepageSize
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 authorfor
loops:
for await (const comment of post.comments) { console.log(comment) // iterates over each comment! }
- More information about DataStore lazy loading on the DataStore documentation
- 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:
- 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
- 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:
- PR 10477
- Lazy loading
- 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 paramaws-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 exportMqttProvidertOptions
fromMqttOverWSProvider
provider@aws-amplify/core
: RemovedJS
export from in favor of individual function exports #10528@aws-amplify/storage
:Storage.list
now acceptspageSize
instead ofmaxKeys
and also the return value is an object that hasresult
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)
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 withimportHelpers
option enabled
- Reduced by 10% on average when authentication (tested with
- Removed unnecessary artifacts from npm packages reducing installation size
All Changes
- feat(pubsub): Automated reconnect for IoT and API by @stocaaro in #10235
- chore: Merge from main by @stocaaro in #10397
- fix(pubsub): surface graphql connection failure error to observers by @AllanZhengYP in #10421
- feat(storage): updating naming for consistency across libraries by @katiegoines in #10414
- feat(@aws-amplify/storage): pagination for storage list api using Token by @kvramyasri7 in #10199
- fix(storage): Optimized storage category
sideEffects
to improve shake-ability by @jimblanc in #10375 - chore: Setup
tslib
&importHelpers
to improve bundle size by @jimblanc in #10435 - chore: Remove legacy UI packages by @jimblanc in #10433
- chore(core): deprecate hub remove fn by @haverchuck in #10420
- chore(core): remove deprecated mobilehub config parser class and rename to parseAWSExports by @AllanZhengYP in #10460
- fix: Restore
tslib
dependencies for v5 by @jimblanc in #10512 - chore: replace .npmignore to allow list of NPM artifacts by @AllanZhengYP in #10473
- chore: rename core/Parser.ts file & followup #10460 by @AllanZhengYP in #10513
- Migrate
auth
andamazon-cognito-identity-js
to use@aws-crypto/sha256-js
by @jimblanc in #10523 - chore: Remove (most) default exports by @jimblanc in #10461
- chore: Remove miscellaneous deprecated exports & prototypes by @jimblanc in #10528
- fix: Standardize
cache
named export to preserve interoperability with RN by @jimblanc in #10546 - chore: Expand * exports to optimize tree-shaking by @jimblanc in #10555
- feat: add a typescript coverage report mechanism by @israx in #10551
- chore: Update copyright notices by @jimblanc in #10556
- chore: Standardize copyright header format by @jimblanc in #10559
- feature(@aws-amplify/datastore): lazy loading and nested/related-model predicates by @svidgen in #10477
- chore: Move
cache
sideEffects to align with other packages by @jimblanc in #10562 - ci(datastore): add integ tests for lazy loading by @dpilch in #10529
- test(integ): remove vue 2 test on legacy Auth UI by @AllanZhengYP in #10576
- chore: remove sideeffects mark on non-code artifacts by @AllanZhengYP in #10578
- chore: Removing deprecated PubSub provider type by @elorzafe in #10585
- chore: use --ignore-engines option in CI by @AllanZhengYP in #10589
- chore: Remove crypto-js dependency from @aws-amplify/auth by @elorzafe in #10591
- fix: Lower
tslib
version to improve dependency flattening by @jimblanc in #10588 - ci(pubsub): add integ tests for reconnection by @stocaaro in #10580
- fix(@aws-amplify/datastore): remove predicate, AsyncCollection internals from public interfaces by @svidgen in #10594
- fix(@aws-amplify/core): Fix guest credentials without Auth module by @elorzafe in #10596
- fix(storage): Fix storage api to have correct typing of .list response by @stocaaro in #10607
- fix(@aws-amplify/datastore): fix join conditions on predicate not groups by @svidgen in #10610
- fix(@aws-amplify/datastore): Fix predicate group types by @svidgen in #10614
- feat: change unsupported codegen error message by @dpilch in #10563
- fix(aws-amplify): Fix remove side effect by @elorzafe in #10611
- test(integ): migrate react auth sample app to new UI by @AllanZhengYP in #10603
- fix(datastore): disconnected has one by @iartemiev in #10613
- fix: Remove
files
list fromaws-amplify-react-native
by @jimblanc in #10620 - fix: sync expression types and shorthand handling by @svidgen in #10623
- fix(storage): Storage.list receives nextToken to align with API by @stocaaro in #10626
- chore: V5 release from main by @stocaaro in #10633
Full Changelog: https://github.com/aws-amplify/amplify-js/compare/aws-amplify@4.3.43...aws-amplify@5.0.0