From 1ce92ebd19727ea09be6789854867440fd6e5ea6 Mon Sep 17 00:00:00 2001 From: Bannon Tanner Date: Tue, 28 Feb 2023 14:15:16 -0600 Subject: [PATCH 1/6] added callout for SSR that support was built for nextJS and middleware doesn't currently work --- src/fragments/lib/ssr/js/getting-started.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/fragments/lib/ssr/js/getting-started.mdx b/src/fragments/lib/ssr/js/getting-started.mdx index 15826c8ad3c..d01091c58b8 100644 --- a/src/fragments/lib/ssr/js/getting-started.mdx +++ b/src/fragments/lib/ssr/js/getting-started.mdx @@ -1,3 +1,9 @@ + + +SSR functionality in Amplify was primarily built for NextJS support and we cannot guarantee support on other frameworks. Additionally, it [does not work in a middleware context](https://github.com/aws-amplify/amplify-js/issues/9145) as it would in getServerSideProps. + + + To work well with server-rendered pages, Amplify JS requires slight modifications from how you would use it in a client-only environment. ## Amplify From 0e3cdfd5c41efd2e9c0b6c97d9ed08e3f1fff2da Mon Sep 17 00:00:00 2001 From: Bannon Tanner Date: Tue, 28 Feb 2023 15:12:40 -0600 Subject: [PATCH 2/6] changed wording to not call out broken/missing features --- src/fragments/lib/ssr/js/getting-started.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fragments/lib/ssr/js/getting-started.mdx b/src/fragments/lib/ssr/js/getting-started.mdx index d01091c58b8..5b0627b7555 100644 --- a/src/fragments/lib/ssr/js/getting-started.mdx +++ b/src/fragments/lib/ssr/js/getting-started.mdx @@ -1,6 +1,6 @@ -SSR functionality in Amplify was primarily built for NextJS support and we cannot guarantee support on other frameworks. Additionally, it [does not work in a middleware context](https://github.com/aws-amplify/amplify-js/issues/9145) as it would in getServerSideProps. +SSR functionality in Amplify was primarily built for compatibility with NextJS [page components](https://nextjs.org/docs/basic-features/pages), and their [getServerSideProps data fetching mechanism](https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props). Compatibility with other frameworks or NextJS features cannot be guaranteed. From 3ed4d435d48cce9ed2a07184653b212abd2c2b26 Mon Sep 17 00:00:00 2001 From: Bannon Tanner Date: Tue, 28 Feb 2023 15:13:22 -0600 Subject: [PATCH 3/6] changed NextJS to Next.js --- src/fragments/lib/ssr/js/getting-started.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fragments/lib/ssr/js/getting-started.mdx b/src/fragments/lib/ssr/js/getting-started.mdx index 5b0627b7555..911286daeb2 100644 --- a/src/fragments/lib/ssr/js/getting-started.mdx +++ b/src/fragments/lib/ssr/js/getting-started.mdx @@ -1,6 +1,6 @@ -SSR functionality in Amplify was primarily built for compatibility with NextJS [page components](https://nextjs.org/docs/basic-features/pages), and their [getServerSideProps data fetching mechanism](https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props). Compatibility with other frameworks or NextJS features cannot be guaranteed. +SSR functionality in Amplify was primarily built for compatibility with Next.js [page components](https://nextjs.org/docs/basic-features/pages), and their [getServerSideProps data fetching mechanism](https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props). Compatibility with other frameworks or NextJS features cannot be guaranteed. From 784802c2cff67e5637e7eb30d932518fb2ad571b Mon Sep 17 00:00:00 2001 From: Bannon Tanner Date: Tue, 28 Feb 2023 18:06:35 -0600 Subject: [PATCH 4/6] missed one Next.js --- src/fragments/lib/ssr/js/getting-started.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fragments/lib/ssr/js/getting-started.mdx b/src/fragments/lib/ssr/js/getting-started.mdx index 911286daeb2..bebdcb44a06 100644 --- a/src/fragments/lib/ssr/js/getting-started.mdx +++ b/src/fragments/lib/ssr/js/getting-started.mdx @@ -1,6 +1,6 @@ -SSR functionality in Amplify was primarily built for compatibility with Next.js [page components](https://nextjs.org/docs/basic-features/pages), and their [getServerSideProps data fetching mechanism](https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props). Compatibility with other frameworks or NextJS features cannot be guaranteed. +SSR functionality in Amplify was primarily built for compatibility with Next.js [page components](https://nextjs.org/docs/basic-features/pages), and their [getServerSideProps data fetching mechanism](https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props). Compatibility with other frameworks or Next.js features cannot be guaranteed. From 1635d8e45f080da8b453e4fc7675f495c8cdb463 Mon Sep 17 00:00:00 2001 From: Bannon Tanner Date: Tue, 28 Feb 2023 19:29:32 -0600 Subject: [PATCH 5/6] moved callout to its own fragment and added to the nextjs getting started guide --- src/fragments/lib/ssr/js/getting-started.mdx | 6 ++---- src/fragments/lib/ssr/js/next-js-callout.mdx | 5 +++++ src/fragments/start/getting-started/next/api.mdx | 4 ++++ 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 src/fragments/lib/ssr/js/next-js-callout.mdx diff --git a/src/fragments/lib/ssr/js/getting-started.mdx b/src/fragments/lib/ssr/js/getting-started.mdx index bebdcb44a06..d97785529a7 100644 --- a/src/fragments/lib/ssr/js/getting-started.mdx +++ b/src/fragments/lib/ssr/js/getting-started.mdx @@ -1,8 +1,6 @@ - - -SSR functionality in Amplify was primarily built for compatibility with Next.js [page components](https://nextjs.org/docs/basic-features/pages), and their [getServerSideProps data fetching mechanism](https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props). Compatibility with other frameworks or Next.js features cannot be guaranteed. +import nextcallout from "/src/fragments/lib/ssr/js/next-js-callout.mdx"; - + To work well with server-rendered pages, Amplify JS requires slight modifications from how you would use it in a client-only environment. diff --git a/src/fragments/lib/ssr/js/next-js-callout.mdx b/src/fragments/lib/ssr/js/next-js-callout.mdx new file mode 100644 index 00000000000..85fe4b6bafd --- /dev/null +++ b/src/fragments/lib/ssr/js/next-js-callout.mdx @@ -0,0 +1,5 @@ + + +SSR functionality in Amplify was primarily built for compatibility with Next.js [page components](https://nextjs.org/docs/basic-features/pages), and their [getServerSideProps data fetching mechanism](https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props). Compatibility with other frameworks or Next.js features cannot be guaranteed. + + \ No newline at end of file diff --git a/src/fragments/start/getting-started/next/api.mdx b/src/fragments/start/getting-started/next/api.mdx index 6b7af054237..68168e42209 100644 --- a/src/fragments/start/getting-started/next/api.mdx +++ b/src/fragments/start/getting-started/next/api.mdx @@ -206,6 +206,10 @@ query ListPosts { ## API with Server-Side Rendering (SSR) +import nextcallout from "/src/fragments/lib/ssr/js/next-js-callout.mdx"; + + + In this section you will create a way to list and create posts from the Next.js application. To do this, you will fetch & render the latest posts from the server as well as create a new post on the client. Ensure you have the following libraries installed: From 23e46acc9acee17557d947b8bcfee302cf513b74 Mon Sep 17 00:00:00 2001 From: Bannon Tanner Date: Tue, 28 Feb 2023 19:34:33 -0600 Subject: [PATCH 6/6] camelCase --- src/fragments/lib/ssr/js/getting-started.mdx | 4 ++-- src/fragments/start/getting-started/next/api.mdx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fragments/lib/ssr/js/getting-started.mdx b/src/fragments/lib/ssr/js/getting-started.mdx index d97785529a7..5a009120a5a 100644 --- a/src/fragments/lib/ssr/js/getting-started.mdx +++ b/src/fragments/lib/ssr/js/getting-started.mdx @@ -1,6 +1,6 @@ -import nextcallout from "/src/fragments/lib/ssr/js/next-js-callout.mdx"; +import nextCallout from "/src/fragments/lib/ssr/js/next-js-callout.mdx"; - + To work well with server-rendered pages, Amplify JS requires slight modifications from how you would use it in a client-only environment. diff --git a/src/fragments/start/getting-started/next/api.mdx b/src/fragments/start/getting-started/next/api.mdx index 68168e42209..18fec51f5a7 100644 --- a/src/fragments/start/getting-started/next/api.mdx +++ b/src/fragments/start/getting-started/next/api.mdx @@ -206,9 +206,9 @@ query ListPosts { ## API with Server-Side Rendering (SSR) -import nextcallout from "/src/fragments/lib/ssr/js/next-js-callout.mdx"; +import nextCallout from "/src/fragments/lib/ssr/js/next-js-callout.mdx"; - + In this section you will create a way to list and create posts from the Next.js application. To do this, you will fetch & render the latest posts from the server as well as create a new post on the client.