Skip to content

Conversation

@kellenmace
Copy link
Collaborator

@kellenmace kellenmace commented Feb 6, 2025

Add tutorial, make a few tweaks to the basic setup doc. Some notes are belowl.

Not-yet-working example project URL

The example app used for this tutorial doesn't exist yet. The PR to add it is here: wpengine/faustjs#2040. Until that gets merged, instead of

npx create-next-app \
    -e https://github.com/wpengine/faustjs/tree/canary \
    --example-path examples/next/tutorial \
    --use-npm

like the tutorial says, you can instead use this to install the example app from the feature/tutorial branch:

npx create-next-app \
    -e https://github.com/wpengine/faustjs/tree/feature/tutorial \
    --example-path examples/next/tutorial \
    --use-npm

Broken post previews feature

The auth & post previews steps in this tutorial don't actually work when you follow the steps in the tutorial! Can you please help me troubleshoot why that is? Is a steps incorrect or missing, perhaps?

You can compare the steps in the tutorial with those on the old Faust site (https://faustjs.org/guide/how-to-setup-post-and-page-previews), as well as those on the /docs/how-to/post-previews/ page of our new Faust site.


@headless-platform-by-wp-engine

Check out the recent updates to your Headless Platform preview environment:

App Environment URL Build
faustjs.org preview-env-feature/tutorial https://hm…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

@headless-platform-by-wp-engine

Check out the recent updates to your Headless Platform preview environment:

App Environment URL Build
faustjs.org preview-env-feature/tutorial https://hm…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

@headless-platform-by-wp-engine

Check out the recent updates to your Headless Platform preview environment:

App Environment URL Build
faustjs.org preview-env-feature/tutorial https://hm…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

Copy link
Contributor

@Fran-A-Dev Fran-A-Dev left a comment

Choose a reason for hiding this comment

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

Please consider the changes requested. This is a grammar and sentence flow review.

Copy link
Member

@moonmeister moonmeister left a comment

Choose a reason for hiding this comment

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

I'm seeing lots of large sections with multiple steps within a "step". I'm concerned those sub-points will get missed. Maybe it'd be helpful to add some kind of MDX tooling to have multiple pages of this tutorial to further simplify the structure. Or just add sub-step labels (a., b., c., etc)

@Fran-A-Dev Fran-A-Dev self-requested a review February 11, 2025 12:50
@Fran-A-Dev Fran-A-Dev self-requested a review February 11, 2025 16:58
Copy link
Contributor

@Fran-A-Dev Fran-A-Dev left a comment

Choose a reason for hiding this comment

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

@kellenmace Add a section titled "Update the Next Config" with an explanation of the code in this file and then have this in a code block in their next.config.js file. Also had a sentence telling the user to npm i next-secure-headers:

const { createSecureHeaders } = require("next-secure-headers");

/**
 * @type {import('next').NextConfig}
 **/
module.exports = withFaust({
  reactStrictMode: true,
  sassOptions: {
    includePaths: ["node_modules"],
  },
  images: {
    domains: [getWpHostname()],
  },

  async headers() {
    return [
      {
        source: "/:path*",
        headers: createSecureHeaders({
          xssProtection: false,
        }),
      },
    ];
  },
});

@Fran-A-Dev
Copy link
Contributor

@kellenmace Add a section titled "Update the Next Config" with an explanation of the code in this file and then have this in a code block in their next.config.js file. Also had a sentence telling the user to npm i next-secure-headers:

const { createSecureHeaders } = require("next-secure-headers");

/**
 * @type {import('next').NextConfig}
 **/
module.exports = withFaust({
  reactStrictMode: true,
  sassOptions: {
    includePaths: ["node_modules"],
  },
  images: {
    domains: [getWpHostname()],
  },

  async headers() {
    return [
      {
        source: "/:path*",
        headers: createSecureHeaders({
          xssProtection: false,
        }),
      },
    ];
  },
});

@kellenmace as discussed lets just add this in the example app and not have this as a step in the tutorial

@headless-platform-by-wp-engine

Check out the recent updates to your Headless Platform preview environment:

App Environment URL Build
faustjs.org preview-env-feature/tutorial https://hm…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

@headless-platform-by-wp-engine

Check out the recent updates to your Headless Platform preview environment:

App Environment URL Build
faustjs.org preview-env-feature/tutorial https://hm…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

@Fran-A-Dev
Copy link
Contributor

@kellenmace LGTM!

@moonmeister any last thoughts before we merge?

@headless-platform-by-wp-engine

Check out the recent updates to your Headless Platform preview environment:

App Environment URL Build
faustjs.org preview-env-feature/tutorial https://hm…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

@moonmeister moonmeister merged commit 14bc6c0 into toolkit Feb 19, 2025
4 checks passed
@moonmeister moonmeister deleted the feature/tutorial branch February 19, 2025 21:32
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.

4 participants