Here's a ๐งต on why I bet big on @statelyai for the rewrite of @AWSAmplify's cross-platform, cross-framework <Authenticator>๐
#xstate #react #angular #vue #reactnative
Rewrites are scary!
An estimated 80% of Amplify's customer apps rely on Auth & our Authenticator. ๐ณ
Why rebuild what's working? ๐ค
(We event rewrote it with Web Components the previous year!)
As documented in the RFC, the WC implementation was largely a lateral move that improved development, but at the cost of CX:
๐ We only had to write our UIs once!
๐ค But they didn't work with RN
๐ค Logic was tightly coupled to UI
https://github.com/aws-amplify/amplify-ui/discussions/200
Customer issues came down to
Correctness โ Auth is complex! Getting it wrong means losing customers, revenue, & breaking trust.
Escape hatches โ When customers need to go beyond what our Authenticator provides, did they lose all that functionality? (spoiler: yes)
To make matters worse, we didn't have a "source of truth" for how the UI was supposed to work โ no exhaustive spec, no flow chart.
Just internal experts and a history of edge-cases.
This is where #xstate shines โ getting complexity out of our heads and into a visualization:
We could finally see what we've missed, where gaps in behavior were, and re-use it across all JS runtimes!
Previously, rolling your own Authenticator meant losing out on correctness โ can you imagine everyone writing this logic each time??
Today, customers can `useAuthenticator()`
and get access to a wrapper around our state machine.
Finally, testing the machine's transitions aren't enough when we have framework-specific UIs built on top of them.
Rather than testing the machine alone, we created BDD-style Cucumber specs that validates the same behavior across all supported frameworks:
Thanks to @kieranbosgood for the tweet that prompted this ๐
https://twitter.com/kieranbosgood/status/1538059246838898688
Resources:
0
Thread