Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Next.js #3485

Merged
merged 372 commits into from
Aug 16, 2021
Merged

Migrate to Next.js #3485

merged 372 commits into from
Aug 16, 2021

Conversation

jakeburden
Copy link
Contributor

@jakeburden jakeburden commented Aug 16, 2021

Preview URL:

https://next-docs.amplify.aws/

Description of changes:

  • Moved away from using Capi/Stencil as our docs build system.
  • Moved to using Next.js and React, utilizing continuously improving open source tools.
  • By utilizing React + Next.js, we also enable more contributions, a faster development feedback loop, and more feature-rich improvements to the site.
  • Docs markdown is now parsed with MDX - meaning you can use React components in markdown files.
  • As Amplify Console natively supports Next.js Server-Side Rendering (SSR), we’ll be able to leverage our own product to add more advancements to the docs site such as internationalization (i18N) and image optimization.
  • By utilizing Next.js/MDX we can fine-tune and have greater control over meta information parsed by search engines to help with SEO ranking. We can do this by passing SEO friendly meta-data to the next/head component. Since all content is static generated (and SSR in the future), search engines will be able to parse all content immediately.
  • Next.js enables us to choose which pages will be statically generated for speed and performance, and which pages will be server-side generated to provide more feature-rich experiences that require a sever runtime.

The content authoring experience should remain mostly the same, with three key differences:

  1. Rather than using <inline-fragment> we now use <Fragments>, and those fragments live in the /src/fragments directory.
    Example:
    import js from "/src/fragments/lib/datastore/js/conflict.mdx";
    
    <Fragments fragments={{js: js}} />;
  2. Rather than using <amplify-block> and <amplify-block-switcher> we now use <Block> and <BlockSwitcher>
    Example:
    <BlockSwitcher>
    
    <Block name="JavaScript">
    
    ```js
    const a = "a";
    ```
    
    </Block>
    
    <Block name="TypeScript">
    
    ```ts
    const a: "a" = "a";
    ```
    
    </Block>
    
    <Block name="Rust">
    
    ```rust
    let mut a = String::from("a");
    ```
    
    </Block>
    
    </BlockSwitcher>
  3. Rather than using <ui-component-props>, we now use <UiComponentProps>
    Example:
    <UiComponentProps tag="amplify-s3-image" propType="attr" useTableHeaders />

Thomas Leing and others added 30 commits August 16, 2021 10:03
…e (currently fake) directory into its own file
- transition to exportPathMap over getStaticPaths because gSP can't support multiple dynamic routes
- transition from `platform` everywhere to `filterKey` because `platform`, `integration` and `framework` can all occur
- note: currently not supporting Stencil architecture where recently selected `platform`s, `integration`s and `framework`s are saved and loaded from local storage -- can occur later (we have to deal with redirects eventually) [would have to revert changes to filter-data.ts and secondarynav/index.tsx]
- stub UI directory
- moved fragments to mirror page directory structure
- fixed bug where codeblocks with no language attached failed to parse
@jakeburden jakeburden requested a review from a team August 16, 2021 18:20
@jakeburden jakeburden requested a review from a team as a code owner August 16, 2021 18:20
@lgtm-com
Copy link

lgtm-com bot commented Aug 16, 2021

This pull request introduces 5 alerts when merging 52c986b into 373be37 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class
  • 1 for Useless assignment to local variable
  • 1 for Useless conditional
  • 1 for String instead of regular expression

@lgtm-com
Copy link

lgtm-com bot commented Aug 16, 2021

This pull request introduces 5 alerts when merging 128ca04 into 373be37 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class
  • 1 for Useless assignment to local variable
  • 1 for Useless conditional
  • 1 for String instead of regular expression

@lgtm-com
Copy link

lgtm-com bot commented Aug 16, 2021

This pull request introduces 5 alerts when merging 9cf51ef into 373be37 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class
  • 1 for Useless assignment to local variable
  • 1 for Useless conditional
  • 1 for String instead of regular expression

Copy link
Member

@mauerbac mauerbac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed offline. Approved

@lgtm-com
Copy link

lgtm-com bot commented Aug 16, 2021

This pull request introduces 3 alerts when merging 04f9ac6 into 373be37 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable
  • 1 for Useless conditional
  • 1 for String instead of regular expression

@jakeburden jakeburden merged commit 6cb5528 into main Aug 16, 2021
@jakeburden jakeburden deleted the next branch August 16, 2021 22:59
@reesscot reesscot restored the next branch September 1, 2021 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants