Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
7 New Things in AWS Amplify for Serverless
AWS signals a bold direction for Amplify
Edit: Corrected a error about the âamplify codegenâ command (via Ricardo)
tl;dr
Amplify is Amazonâs open source library for building and integrating Serverless backends. Upcoming features hint at a very exciting vision for developers.
Backstory
If Serverless is the crown atop Amazon Web Servicesâ strategy, Amplify is shaping up to be the crown jewel. Amplify is an open source library for Serverless development. Amplify makes it easier to build a Serverless backend and integrate with your front end. It launched last November at re:Invent 2017.
In June of this year I noticed commits that appeared to be part of a major refactoring. Then, two weeks ago, some major new features started to drop. Now that MobileHub docs point to Amplify, itâs pretty clear whatâs going on.
Amplify is going to be a key developer relations tool for on-boarding new serverless projects.
Amplify is changing. I list seven of the most exciting new changes below.
1. Amplify CLIÂ Plugins
If youâre familiar with Serverless Framework you no doubt leverage plugins. AWS SAM currently lacks plugin support. Amplify will not. Amplify plugins will allow you to add commands or extensions. Extensions can affect the majority of the functionality used by Amplify.
This will put Amplify in direct competition with Serverless Framework. Whereas Serverless Framework benefits from a healthy ecosystem of plugins and components, its plugin system also suffers from a leaky abstraction of CloudFormation and the AWS SDK. Thus, many Serverless Framework plugins use the SDK when CloudFormation would be more idempotent. Amplify is heavily CloudFormation focused and provides a nice wrapper around template generation. This will be a win for teams practicing CI/CD.
2. GraphQL Transforms
Wouldnât it be nice if you could write a GraphQL schema and generate all the necessary resources at the click of a button? If youâre familiar with Ruby on Rails and ActiveRecord this is a no-brainer. AppSync has always had a feature that does this, but it was only useful as a kick-start.
Amplify now has GraphQL transforms. You annotate your schema with directives such as @model or @searchable. For instance @model will create you a DyanmoDB table, @searchable will stream your objects to ElasticSearch.
When you run amplify push it generates your backend resources as a CloudFormation template and provisions them in the cloud. CloudFormation templates mean sane migrations for generated resources.
Running amplify codegen will take your GraphQL schema, along with query documents, and create strongly typed classes (Swift, TypeScript) for apps to use.
The current transforms handle DynamoDB, Authentication, Model Connections (cardinality), ElasticSearch, and Model Versioning.
The function that produces this CloudFormation template is a stand-alone Npm module. This means you can integrate it in your development workflow even if you arenât using Amplify. đ
3. Custom Transforms
The Amplify CLI also provides an API for writing your own GraphQL Transforms. For instance, Iâm currently exploring a transform that will make CQRS easier. Tagging a GraphQL Type with @CQRS would add the necessary plumbing to your CloudFormation template. This should be exciting! đ
4. Angular and Ionic Support
When Amplify launched the only supported frameworks were React and ReactNative. Angular and Ionic documentation saw their first commits in April of this year. They now get first class treatment in the docs. On the new Amplify site youâll also find Angular components for Authenticator, Photo Picker, Album, and bot interactions.
Some areas of documentation still skew towards React. An example of this is âUsing GraphQL Endpointsâ, React Components have a section but Angular is absent. I was only able to find one official sample app for Angular/Ionic, yet React and ReactNative samples abound. Since this is open source and pull requests are welcome, I expect we will see much more for Angular and Ionic devs.
5. Visual Studio Code Plugin
Visual Studio Marketplace page for AWS Amplify VS Code Extension
Released August 3rd, the AWS Amplify VS Code Extension provides a ton of snippets. Manual config of Amplify can be confusing at times. GraphQL query declarations can be lengthy. Having snippets handy for tasks such as these will increase developer ease. In total I counted 246 snippets.
Snippet for Amplify Using Amazon Cognito User Pools
You can check out all 246 snippets here.
6. More UI Components?
Amplify launched with several React and ReactNative UI components. These helped with things like Cognito auth, and rendering lists of images from an S3 bucket. Their recent promotion to the top nav of Amplifyâs homepage makes me think thereâs more to come.
UI Components get the hero treatment. More to come?
7. Amplify in the AWSÂ Console?
Currently the MobileHub docs point you to Amplify. New Amplify projects do not create a project in MobileHub like aws-mobile CLI did. This leads me to believe either MobileHub will sunset, or Amplify is going to get its own place in the AWSÂ Console.
Why would MobileHub direct you to Amplify?
Conclusion
The ground is being laid for some exciting improvements to Amplify. Expect some big announcements.
Shameless Plug đ
My Serverless Kickstart Workshop đ is everything your team needs to get going on AWS and serverless. If your company is considering a move to serverless architecture Iâd like to help. đđ You can reach me at ryan@thestack.io
7 New things in AWS Amplify was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.