faustjs

Faust.js™ - The Headless WordPress Framework

OTHER License

Downloads
65.5K
Stars
1.3K
Committers
47

Bot releases are hidden (Show)

faustjs - plugin/faustwp/v0.7.7

Published by blakewilson over 2 years ago

Patch Changes

https://github.com/wpengine/faustjs/commit/6a7559376a15bab06e3fc1b0f537199810ea19e3: Fixes a PHP 8 warning that occured on post types not registered with WP GraphQL https://github.com/wpengine/faustjs/pull/812

faustjs - plugin/faustwp/v0.7.6

Published by josephfusco over 2 years ago

Patch Changes

faustjs - plugin/faustwp/v0.7.5

Published by apmatthews over 2 years ago

Patch Changes

  • b7af359: Simplify generation of preview links. Fixes an issue where preview links were missing slashes with certain permalink structures. Thanks @torounit!
  • 662c377: Plugin settings are now validated and sanitized before saving.
  • c730348: Disables access to the site editor when themes are disabled
faustjs - plugin/faustwp/v0.7.4

Published by apmatthews over 2 years ago

Patch Changes

  • 1dcd987: Removes unused event callbacks for rewrite rule and post status changes. The is_events_enabled() function has also been removed.
  • 5c69b68: ConditionalTags has been deprecated as it was introduced in an older version of the framework when routing was done from the NextTemplateLoader. Now that we are using Next.js pages for routing, conditionalTags are no longer needed.
  • 7d156ba: Add a documentation link that explains "Features" checkbox settings in more detail
faustjs - plugin/faustwp/v0.7.3

Published by josephfusco over 2 years ago

Patch Changes

  • ab4a661: Fixed issue where file editor was unable to save
faustjs - plugin/faustwp/v0.7.1

Published by blakewilson almost 3 years ago

Patch Changes

  • f948c04: Fixed plugin icon SVG display issue in Chrome #683
faustjs - plugin/faustwp/v0.7.0

Published by blakewilson almost 3 years ago

Minor Changes

  • Changed the plugin name to FaustWP.
  • Changed all internal PHP function names to use namespaces.
  • Changed the WP_HEADLESS_SECRET_KEY constant to FAUSTWP_SECRET_KEY.
  • Changed the authentication endpoint namespace from wpac/v1 to faustwp/v1
  • Changed settings option name from wpe_headless to faustwp_settings
  • Changed the following filter names:
    • wpe_headless_setting to faustwp_setting
    • wpe_headless_settings to faustwp_settings
    • wpe_headless_domain_replacement_enabled to faustwp_domain_replacement_enabled
  • Changed the text domain to faustwp.
  • Changed minimum required PHP version to 7.2.
  • Changed minimum required WordPress version to 5.7.
  • Changed the hook used for public route redirection.
  • Fixed the "headless post preview" link on the FaustWP settings page.
  • Fixed "unexpected output" error during plugin activation.
  • Fixed skipped domain replacement in GraphQL responses that include generalSettings.
  • Added LICENSE file.
faustjs - package/core/0.11.0

Published by blakewilson about 3 years ago

faustjs - package/core/0.10.2

Published by blakewilson about 3 years ago

faustjs -

Published by blakewilson about 3 years ago

faustjs - package/core/0.10.0

Published by blakewilson about 3 years ago

Release 0.10.0 of the NPM packages include BREAKING CHANGES. Existing users of Faust.js will need to make the following changes:

Step 1 - Update the WPE Headless Plugin

Ensure that you are on version 0.6.0 or later of the WPE Headless Plugin.

Step 2 - Update preview.tsx file

If you started from the next/getting-started example, replace the contents of src/pages/preview.tsx with the following:

import { PageComponent } from './[...pageUri]';
import { PostComponent } from './posts/[postSlug]';
import { client } from 'client';

export default function Preview() {
  const { usePreview } = client.auth;
  const result = usePreview();

  if (client.useIsLoading() || !result) {
    return <p>loading...</p>;
  }

  if (result.type === 'page') {
    if (!result.page) {
      return <>Not Found</>;
    }

    return <PageComponent page={result.page} />;
  }

  if (!result.post) {
    return <>Not Found</>;
  }

  return <PostComponent post={result.post} />;
}

Step 3 - Create next.config.js file

In the root of your project, alongside package.json, create a next.config.js file with the following contents:

const { withFaust } = require('@faustjs/next');

/**
 * @type {import('next').NextConfig}
 **/
module.exports = withFaust();

If you already have an existing next.config.js file, you can place it within the first argument of the withFaust function, like so:

const { withFaust } = require('@faustjs/next');

/**
 * @type {import('next').NextConfig}
 **/
module.exports = withFaust({
    // Your Next.js config here
});

Step 4 - Update gqty.config.js file

In the root of your project, alongside package.json, replace the gqty.config.js file with the following:

require('dotenv').config();

/**
 * @type {import("@gqty/cli").GQtyConfig}
 */
const config = {
  react: false,
  scalarTypes: { DateTime: 'string' },
  introspection: {
    endpoint: `${process.env.NEXT_PUBLIC_WORDPRESS_URL}/graphql`,
    headers: {},
  },
  destination: './src/client/index.ts',
  subscriptions: false,
  javascriptOutput: false,
};

console.log(`Using "${config.introspection.endpoint}" to generate schema...`);

module.exports = config;
faustjs - package/core/0.9.0

Published by blakewilson about 3 years ago

Release package/core/0.9.0

Release 0.9.0 of the NPM packages include BREAKING CHANGES. Existing users of Faust.js will need to update their faust.config.js file to use ESM syntax, opposed to CJS syntax.

For example, users will need to replace their current faust.config.js file:

const { headlessConfig } = require('@faustjs/core');

if (!process.env.NEXT_PUBLIC_WORDPRESS_URL) {
  console.error(
    'You must provide a NEXT_PUBLIC_WORDPRESS_URL environment variable, did you forget to load your .env file?',
  );
}

/**
 * @type {import("@faustjs/core").HeadlessConfig}
 */
module.exports = headlessConfig({
  wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL,
  apiClientSecret: process.env.WP_HEADLESS_SECRET,
});

With the following code:

import { headlessConfig } from '@faustjs/core';

if (!process.env.NEXT_PUBLIC_WORDPRESS_URL) {
  console.error(
    'You must provide a NEXT_PUBLIC_WORDPRESS_URL environment variable, did you forget to load your .env file?',
  );
}

/**
 * @type {import("@faustjs/core").HeadlessConfig}
 */
export default headlessConfig({
  wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL,
  apiClientSecret: process.env.WP_HEADLESS_SECRET,
});
faustjs - Headless Previews!

Published by matt-landers almost 4 years ago

In the first release of our headless framework for WordPress, we make previews simple.

What's in the release:

  • Headless Plugin for WordPress
    • Supports an OAuth flow for authentication
  • @wpengine/headless
    • Authorization handler to support the plugin OAuth flow
    • React hooks for retrieving posts via GQL
    • Next.js SSR support for retrieving data from GQL

Tryout Previews and give us feedback via discussions!