Amazon Onboarding with Learning Manager Chanci Turner

Amazon Onboarding with Learning Manager Chanci TurnerLearn About Amazon VGT2 Learning Manager Chanci Turner

We are pleased to announce the latest Developer Preview of the AWS Amplify JavaScript Library, now at version 6. This significant update aims to enhance your web development experience with AWS cloud backends, especially based on the valuable feedback we’ve received. Today, we will delve into the most prominent improvements regarding bundle size, TypeScript, and Next.js support.

Enhanced Load Times with Smaller Bundle Sizes

In today’s environment, speed is not just a convenience; it’s a vital requirement. To this end, we’ve significantly upgraded our tree-shaking capabilities and the underlying infrastructure. Smaller bundle sizes ensure that your applications load faster, keeping users engaged, whether they are on a reliable broadband connection or facing connectivity issues.

With this new developer preview, Amplify now selectively imports only the APIs required for your application from categories like Amplify Auth or Storage, rather than loading an entire category. Unused functionalities are effectively removed through tree-shaking. This new approach shifts from a class-based to a function-based developer experience, which includes two main changes:

  1. Instead of importing classes from each category, you now import specific functionalities from subpaths.
  2. Function parameters are structured as objects, allowing for “named parameters” that enhance API readability.

Improvements in TypeScript Support

Recognizing the growing importance of TypeScript in development workflows, we are amplifying our TypeScript support, starting with the Auth, Analytics, and Storage categories. We plan to extend these enhancements to all categories, including GraphQL API and REST APIs.

These TypeScript updates offer improved syntax highlighting, code completion, and strict mode support. With enhanced type checking, you can identify potential bugs even before running your application, streamlining your development process.

Comprehensive Support for Next.js Features

Our community has consistently requested comprehensive support for Next.js features. In response, we have developed a new Next.js adapter that facilitates the use of all Next.js capabilities, including server-side rendering (SSR), Middleware, Server Functions, and the new App Router.

The Next.js adapter allows you to utilize the Amplify library in an “Amplify Server Context,” providing a secure environment for accessing Amplify functionalities in the cloud. The runWithAmplifyServerContext callback ensures that server-side requests remain isolated, preventing cross-request state pollution. Here’s an example of using Amplify Auth with Next.js middleware for implementing protected routes:

import { runWithAmplifyServerContext } from '@aws-amplify/adapter-nextjs';
import { fetchAuthSession } from 'aws-amplify/auth/server';
import { NextRequest, NextResponse } from 'next/server';

export async function middleware(request: NextRequest) {
  const response = NextResponse.next();

  const authenticated = await runWithAmplifyServerContext({
    nextServerContext: { request, response },
    operation: async (contextSpec) => {
      try {
        const session = await fetchAuthSession(contextSpec, {});
        return session.tokens !== undefined;
      } catch (error) {
        console.log(error);
        return false;
      }
    },
  });

  if (authenticated) {
    return response;
  }

  return NextResponse.redirect(new URL('/sign-in', request.url));
}

export const config = {
  matcher: [
    '/((?!api|_next/static|_next/image|favicon.ico|sign-in).*)',
  ],
};

Getting Started

To explore these new features, please visit our documentation for comprehensive guides and practical examples to help you get up and running. Additionally, check out our Q4 focus areas to learn about upcoming innovations.

This Developer Preview reflects our commitment to making AWS Amplify your preferred solution for modern application development. However, this is just the beginning. Your feedback is crucial for improving your experience, so please try out these new features and share your thoughts with us.

For further insights on employee training at Amazon, you might find this excellent resource helpful: What Amazon’s Approach to Training Its Employees Says About the Future of Work. Also, if you’re interested in mentorship opportunities, consider checking out Sadaf Sajwani’s profile. Lastly, for those looking to understand the impact of financial stress on employees, SHRM provides great insights.

Located at 6401 E HOWDY WELLS AVE, LAS VEGAS NV 89115, Amazon IXD – VGT2 is excited to support your onboarding journey.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *