Releases: wpengine/faustjs
Releases · wpengine/faustjs
@faustjs/react@0.15.1
@faustjs/next@0.15.1
Patch Changes
-
c74ce4f: Introduced the
usePreviewNode
hook to get preview data from any post type. You can use it like so:import type { Page, Post } from 'client'; import { client } from 'client'; export default function Preview() { const isLoading = client.useIsLoading(); const { typeName, node } = client.auth.usePreviewNode(); if (isLoading || node === undefined) { return <p>Loading...</p>; } if (node === null) { return <p>Post not found</p>; } switch (typeName) { case 'Page': { const page = node as Page; return ( <> <h1>{page.title()}</h1> <div dangerouslySetInnerHTML={{ __html: page.content() }} /> </> ); } case 'Post': { const post = node as Post; return ( <> <h1>{post.title()}</h1> <div dangerouslySetInnerHTML={{ __html: post.content() }} /> </> ); } // Add custom post types here as needed default: { throw new Error(`Unknown post type: ${typeName}`); } } }
With
usePreviewNode
, we have deprecated theusePreview
hook. It is still available, but it is recommended to useusePreviewNode
instead. -
Updated dependencies [3c1280b]
-
Updated dependencies [3c1280b]
- @faustjs/react@0.15.1
- @faustjs/core@0.15.1
@faustjs/core@0.15.1
Patch Changes
- 3c1280b: Updated
schema.generated.ts
to supportcontentNode
forusePreviewNode
usage.
@faustjs/react@0.15.0
@faustjs/next@0.15.0
@faustjs/core@0.15.0
Minor Changes
- a044a07: Add file extensions to import statements to fully support ES Modules. Support for Next.js 12 🎉
plugin/faustwp/v0.7.1
plugin/faustwp/v0.7.0
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
tofaustwp/v1
- Changed settings option name from
wpe_headless
tofaustwp_settings
- Changed the following filter names:
wpe_headless_setting
tofaustwp_setting
wpe_headless_settings
tofaustwp_settings
wpe_headless_domain_replacement_enabled
tofaustwp_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/react@0.14.0
Patch Changes
- Updated dependencies [dc936a5]
- @faustjs/core@0.14.0
@faustjs/next@0.14.0
Patch Changes
- Updated dependencies [dc936a5]
- @faustjs/core@0.14.0
- @faustjs/react@0.14.0