Fork me on GitHub
#cljsrn
<
2019-07-26
>
Chris Swanson12:07:21

anyone using or experimented with aws amplify js in a re-natal app?

Chris Swanson12:07:55

looks like they've got their own internal event system (called Hub),; it's hooked into the rest of the framework, so i was hoping a small bridge to connect hub to re-frame might just make everything else useful in a more idiomatic way

scknkkrer12:07:55

@chrisjswanson, another amazing point. I’ll note that idea. We need that too.

🙂 4
👍 4
mdhaney15:07:15

I’ve been using Amplify for about 6 months, not with re-natal but with the shadow-cljs tooling, although that shouldn’t affect anything. Overall it’s pretty nice and saves a lot of time, but there are some warts. A couple of annoying things I’ve encountered: 1) it’s a bit buggy, and more than once things have broken on a version upgrade. And pinning your project to a known working version doesn’t always work. I did that and everything was fine, until we redeployed the back end on a new AWS account for production. My guess is they always use the latest cloud formation templates when you push the backend config, and the older versions of the libraries we were using were out of sync - lots of deprecated warnings and outright failures in the log. Updating the libraries fixed that, but introduced new bugs that broke our functionality and had to be worked around. 2) I use the Hub event system to drive a state machine controlling app startup and login. Works great except, there is no Hub event emitted when the app starts and the user is already logged in (Amplify does that for you automatically, which is nice otherwise). I was able to work around it using the state change listener on the Authenticator component, but it’s annoying from a design perspective - why have an event bus if you don’t use it consistently? To be fair, that may be the only instance and all the other modules report their events consistently, but given the number of bugs in the library, don’t be surprised if there are other places where events don’t show up. I’m not trying to be negative - overall it’s a useful library, and while I’ve had to spend a couple of days working around issues, it probably saved me at least 2 weeks vs writing the code myself, so still a win. It’s an ambitious library and still pretty immature, but it should get more stable over time (especially with Amazon’s resources behind it). It’s just not quite there yet, so be ready for a bit frustration.

Chris Swanson16:07:55

thanks @mdhaney that's very useful insight

Chris Swanson16:07:30

i wonder if i could just fork it and add the app start event to hub , spare the design wart