AWS is updating its Amplify JavaScript library to version 6, adding Next.js support, stronger TypeScript support, and smaller code bundles. The company has also said it will introduce an Enterprise tier for its CodeWhisperer AI coding service.
Amplify is both a JavaScript library and a tool for building applications, thanks to Amplify CLI (command line interface) for configuring backend resources, Amplify Studio, a visual interface builder that integrates with the Figma design tool, and Amplify hosting service for rapid deployment. The idea is that developers can use any or all of these features for rapid application development.
The Amplify 6 library, now in preview, is a major update with three main areas of focus. The first is to reduce bundle sizes with tree shaking, which means removing unused code. In order to enable this, the library has a more granular approach to importing code, based on functions rather than classes. The example given in the introductory post shows how:
import { Auth } from 'aws-amplify'
is replaced with
import { signIn } from 'aws-amplify/auth'
Second, Amplify is getting improved TypeScript support, initially for Auth, Analytics and Storage but promised for “all of our categories, including GraphQL API and REST APIs.” This will include strict mode support, which enforces type checking before code will compile.
Third, there is new support for the Next.js framework, including server-side rendering, middleware, and server functions – though the docs warn that “with the v6 developer preview, only a subset of APIs are usable on the server side of a Next.js project. More categories and APIs support to follow.”
AWS said that Next.js support was “a frequent ask from our community,” perhaps reflecting that the framework is further ahead with some new React features than others.
On the surface Amplify looks like a compelling choice for building a full stack application that will run on AWS. That said, some developers have found that it suffers from a flaw to which rapid application development tools are vulnerable: easy to get started but difficult once an application becomes large and more complex. “AWS Amplify is actively harmful, primarily because of its database choice,” claimed developer Sam Thorogood, who found the dependence on GraphQL models and a DynamoDB database restrictive and inefficient. “Part of the problem is, once you’re in production using a database—whatever database, not just DynamoDB—it’s hard to get out,” he said.
Others are more positive, the key being to tread carefully and use Amplify for what it is best at. “I use Amplify in lots of projects. It is a nice wrapper for the auth and registration stuff. We also use it for some frontend ci/cd. Nothing else though,” said one. “Would I rather have a good and easy to use serverless Postgres db that played well with AWS lambda. Yes. Am I going to switch away because I have to plan my access patterns and indices out carefully… no.”
AWS has also introduced new AI features for CodeWhisperer, its AI-powered coding assistant. The idea is to train the AI on an organization’s private code, while also ensuring that it remains private. “An administrator connects to their private code repository from a source, such as GitLab or Amazon Simple Storage Service (Amazon S3), and schedules a job to create their own customization,” an introductory post explains. This capability is coming in preview “within the next few weeks as part of a new CodeWhisperer Enterprise Tier.”