-
Notifications
You must be signed in to change notification settings - Fork 257
feat(amplify_core): initial commit for amplify-flutter #2
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to commit the jar files in packages/core/lib/kotlin-*.jar? We should also write unit tests for iOS and android code.
..._core/android/src/main/kotlin/com/amplifyframework/flutter/amplify_core/AmplifyCorePlugin.kt
Outdated
Show resolved
Hide resolved
..._core/android/src/main/kotlin/com/amplifyframework/flutter/amplify_core/AmplifyCorePlugin.kt
Outdated
Show resolved
Hide resolved
..._core/android/src/main/kotlin/com/amplifyframework/flutter/amplify_core/AmplifyCorePlugin.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💥🌟✨ Looks fantastic! Ship it! 🚀🚀🚀
Let's update the commit message while merging and squashing to follow conventional commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀 🚢
feat(datastore) Allow configure DataStore with custom configuration
Before ``` flutter: ERROR | SignUpStateMachine | Emitted error flutter: ERROR | Authenticator | Error in AuthBloc ``` After ``` flutter: ERROR | SignUpStateMachine | Emitted error: InvalidParameterException [Attributes did not conform to the schema: email: The attribute is required, null, null] #0 HttpOperation.deserializeOutput package:smithy/…/http/http_operation.dart:278 <asynchronous suspension> #1 AWSRetryer.retry package:smithy_aws/…/retry/aws_retryer.dart:160 <asynchronous suspension> #2 WrappedCognitoIdentityProviderClient.signUp package:amplify_auth_cognito_dart/…/sdk/sdk_bridge.dart:516 <asynchronous suspension> #3 SignUpStateMachine.onInitiate package:amplify_auth_cognito_dart/…/machines/sign_up_state_machine.dart:42 <asynchronous suspension> #4 SignUpStateMachineBase.resolve package:amplify_auth_cognito_dart/…/generated/sign_up_state_machine_base.dart:39 <asynchronous suspension> #5 StateMachine._listenForEvents package:amplify_core/…/state_machine/state_machine.dart:171 <asynchronous suspension> flutter: ERROR | Authenticator | Error in AuthBloc: InvalidParameterException [Attributes did not conform to the schema: email: The attribute is required, null, null] ```
Errors originating within state machines lose context when thrown since there is an asynchronous gap between adding an event to a state machine and when it eventually gets processed. For example, consider the following exception thrown from a state machine: ``` ERROR | MyStateMachine | Emitted error: Exception #0 MyStateMachine.doWork (file:///Users/nydillon/dev/amplify-dart/packages/amplify_core/test/state_machine/my_state_machine.dart:82:7) <asynchronous suspension> #1 MyStateMachine.resolve (file:///Users/nydillon/dev/amplify-dart/packages/amplify_core/test/state_machine/my_state_machine.dart:100:9) <asynchronous suspension> #2 StateMachine._listenForEvents (package:amplify_core/src/state_machine/state_machine.dart:237:9) <asynchronous suspension> ``` The trace ends at `listenForEvents` in the state machine, which is where the event was popped off the internal queue. But what happened before? With chaining, we get the following which provides the whole picture: ``` ERROR | MyStateMachine | Emitted error: Exception test/state_machine/my_state_machine.dart 82:7 MyStateMachine.doWork test/state_machine/my_state_machine.dart 100:9 MyStateMachine.resolve package:amplify_core/src/state_machine/state_machine.dart 238:9 StateMachine._listenForEvents ===== asynchronous gap =========================== package:amplify_core/src/state_machine/event.dart 41:47 new EventCompleter package:amplify_core/src/state_machine/state_machine.dart 127:23 StateMachineManager.accept test/state_machine/state_machine_test.dart 47:30 main.<fn>.<fn> package:test_api/src/backend/declarer.dart 215:19 Declarer.test.<fn>.<fn> package:test_api/src/backend/declarer.dart 213:7 Declarer.test.<fn> package:test_api/src/backend/invoker.dart 258:9 Invoker._waitForOutstandingCallbacks.<fn> ``` Now we can see that the exception originated due to an event which was created by calling `StateMachineManager.accept` within a test. Much better!
Errors originating within state machines lose context when thrown since there is an asynchronous gap between adding an event to a state machine and when it eventually gets processed. For example, consider the following exception thrown from a state machine: ``` ERROR | MyStateMachine | Emitted error: Exception #0 MyStateMachine.doWork (file:///Users/nydillon/dev/amplify-dart/packages/amplify_core/test/state_machine/my_state_machine.dart:82:7) <asynchronous suspension> #1 MyStateMachine.resolve (file:///Users/nydillon/dev/amplify-dart/packages/amplify_core/test/state_machine/my_state_machine.dart:100:9) <asynchronous suspension> #2 StateMachine._listenForEvents (package:amplify_core/src/state_machine/state_machine.dart:237:9) <asynchronous suspension> ``` The trace ends at `listenForEvents` in the state machine, which is where the event was popped off the internal queue. But what happened before? With chaining, we get the following which provides the whole picture: ``` ERROR | MyStateMachine | Emitted error: Exception test/state_machine/my_state_machine.dart 82:7 MyStateMachine.doWork test/state_machine/my_state_machine.dart 100:9 MyStateMachine.resolve package:amplify_core/src/state_machine/state_machine.dart 238:9 StateMachine._listenForEvents ===== asynchronous gap =========================== package:amplify_core/src/state_machine/event.dart 41:47 new EventCompleter package:amplify_core/src/state_machine/state_machine.dart 127:23 StateMachineManager.accept test/state_machine/state_machine_test.dart 47:30 main.<fn>.<fn> package:test_api/src/backend/declarer.dart 215:19 Declarer.test.<fn>.<fn> package:test_api/src/backend/declarer.dart 213:7 Declarer.test.<fn> package:test_api/src/backend/invoker.dart 258:9 Invoker._waitForOutstandingCallbacks.<fn> ``` Now we can see that the exception originated due to an event which was created by calling `StateMachineManager.accept` within a test. Much better!
Errors originating within state machines lose context when thrown since there is an asynchronous gap between adding an event to a state machine and when it eventually gets processed. For example, consider the following exception thrown from a state machine: ``` ERROR | MyStateMachine | Emitted error: Exception #0 MyStateMachine.doWork (file:///Users/nydillon/dev/amplify-dart/packages/amplify_core/test/state_machine/my_state_machine.dart:82:7) <asynchronous suspension> #1 MyStateMachine.resolve (file:///Users/nydillon/dev/amplify-dart/packages/amplify_core/test/state_machine/my_state_machine.dart:100:9) <asynchronous suspension> #2 StateMachine._listenForEvents (package:amplify_core/src/state_machine/state_machine.dart:237:9) <asynchronous suspension> ``` The trace ends at `listenForEvents` in the state machine, which is where the event was popped off the internal queue. But what happened before? With chaining, we get the following which provides the whole picture: ``` ERROR | MyStateMachine | Emitted error: Exception test/state_machine/my_state_machine.dart 82:7 MyStateMachine.doWork test/state_machine/my_state_machine.dart 100:9 MyStateMachine.resolve package:amplify_core/src/state_machine/state_machine.dart 238:9 StateMachine._listenForEvents ===== asynchronous gap =========================== package:amplify_core/src/state_machine/event.dart 41:47 new EventCompleter package:amplify_core/src/state_machine/state_machine.dart 127:23 StateMachineManager.accept test/state_machine/state_machine_test.dart 47:30 main.<fn>.<fn> package:test_api/src/backend/declarer.dart 215:19 Declarer.test.<fn>.<fn> package:test_api/src/backend/declarer.dart 213:7 Declarer.test.<fn> package:test_api/src/backend/invoker.dart 258:9 Invoker._waitForOutstandingCallbacks.<fn> ``` Now we can see that the exception originated due to an event which was created by calling `StateMachineManager.accept` within a test. Much better!
Errors originating within state machines lose context when thrown since there is an asynchronous gap between adding an event to a state machine and when it eventually gets processed. For example, consider the following exception thrown from a state machine: ``` ERROR | MyStateMachine | Emitted error: Exception #0 MyStateMachine.doWork (file:///Users/nydillon/dev/amplify-dart/packages/amplify_core/test/state_machine/my_state_machine.dart:82:7) <asynchronous suspension> #1 MyStateMachine.resolve (file:///Users/nydillon/dev/amplify-dart/packages/amplify_core/test/state_machine/my_state_machine.dart:100:9) <asynchronous suspension> #2 StateMachine._listenForEvents (package:amplify_core/src/state_machine/state_machine.dart:237:9) <asynchronous suspension> ``` The trace ends at `listenForEvents` in the state machine, which is where the event was popped off the internal queue. But what happened before? With chaining, we get the following which provides the whole picture: ``` ERROR | MyStateMachine | Emitted error: Exception test/state_machine/my_state_machine.dart 82:7 MyStateMachine.doWork test/state_machine/my_state_machine.dart 100:9 MyStateMachine.resolve package:amplify_core/src/state_machine/state_machine.dart 238:9 StateMachine._listenForEvents ===== asynchronous gap =========================== package:amplify_core/src/state_machine/event.dart 41:47 new EventCompleter package:amplify_core/src/state_machine/state_machine.dart 127:23 StateMachineManager.accept test/state_machine/state_machine_test.dart 47:30 main.<fn>.<fn> package:test_api/src/backend/declarer.dart 215:19 Declarer.test.<fn>.<fn> package:test_api/src/backend/declarer.dart 213:7 Declarer.test.<fn> package:test_api/src/backend/invoker.dart 258:9 Invoker._waitForOutstandingCallbacks.<fn> ``` Now we can see that the exception originated due to an event which was created by calling `StateMachineManager.accept` within a test. Much better!
Errors originating within state machines lose context when thrown since there is an asynchronous gap between adding an event to a state machine and when it eventually gets processed. For example, consider the following exception thrown from a state machine: ``` ERROR | MyStateMachine | Emitted error: Exception #0 MyStateMachine.doWork (file:///Users/nydillon/dev/amplify-dart/packages/amplify_core/test/state_machine/my_state_machine.dart:82:7) <asynchronous suspension> #1 MyStateMachine.resolve (file:///Users/nydillon/dev/amplify-dart/packages/amplify_core/test/state_machine/my_state_machine.dart:100:9) <asynchronous suspension> #2 StateMachine._listenForEvents (package:amplify_core/src/state_machine/state_machine.dart:237:9) <asynchronous suspension> ``` The trace ends at `listenForEvents` in the state machine, which is where the event was popped off the internal queue. But what happened before? With chaining, we get the following which provides the whole picture: ``` ERROR | MyStateMachine | Emitted error: Exception test/state_machine/my_state_machine.dart 82:7 MyStateMachine.doWork test/state_machine/my_state_machine.dart 100:9 MyStateMachine.resolve package:amplify_core/src/state_machine/state_machine.dart 238:9 StateMachine._listenForEvents ===== asynchronous gap =========================== package:amplify_core/src/state_machine/event.dart 41:47 new EventCompleter package:amplify_core/src/state_machine/state_machine.dart 127:23 StateMachineManager.accept test/state_machine/state_machine_test.dart 47:30 main.<fn>.<fn> package:test_api/src/backend/declarer.dart 215:19 Declarer.test.<fn>.<fn> package:test_api/src/backend/declarer.dart 213:7 Declarer.test.<fn> package:test_api/src/backend/invoker.dart 258:9 Invoker._waitForOutstandingCallbacks.<fn> ``` Now we can see that the exception originated due to an event which was created by calling `StateMachineManager.accept` within a test. Much better!
Description of changes:
Initial commit for aws-amplify-flutter, including amplify_core and amplify_core_plugin_interface packages.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.