Faust.js™ - The Headless WordPress Framework
OTHER License
Bot releases are visible (Hide)
Published by github-actions[bot] about 1 year ago
a1b6fc0: Introduced a new API handler for App router projects called faustRouteHandler
. It can be used by creating a file /app/api/faust/[route]/route.js
with the following contents:
// /app/api/faust/[route]/route.js
import { faustRouteHandler } from '@faustwp/experimental-app-router';
const { GET, POST } = faustRouteHandler;
export { GET, POST };
a1b6fc0: Created getAuthClient
for making authenticated server side requests in the Next.js App Router. It can be used like:
import { getAuthClient } from '@faustwp/experimental-app-router';
// app/my-account/posts/page.js
export default async function Page() {
const client = await getAuthClient();
if (!client) {
return <>You must be authenticated to view this page!</>;
}
const { data } = await client.query({
query: gql`
query GetMyPosts {
viewer {
posts {
nodes {
id
title
}
}
}
}
`,
});
return(
<>
<h2>My posts</h2>
<ul>
{data.viewer.posts.nodes.map((post) => (
<li key={post.id}>{post.title}</li>
))}
</ul>
</>
)
Note: Our login/logout utils are still in the works.
Updated dependencies [a419252]
Updated dependencies [cf887d3]
Updated dependencies [795d956]
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
getClient
export that can be used to fetch data from your WordPress sitePublished by github-actions[bot] about 1 year ago
176bc82: Feat: Add registerFaustBlock
helper that wraps edit
and save
functions used to register new blocks in Gutenberg.
Usage:
import metadata from './block.json';
import MyFirstBlock from './MyFirstBlock';
import { registerFaustBlock } from '@faustwp/block-editor-utils';
import Edit from './edit';
import save from './save';
registerFaustBlock(MyFirstBlock, {
blockJson: metadata,
editFn: Edit,
saveFn: save,
});
d8c93fa: Feat: Added a default EditFunction.
import metadata from './block.json';
import MyFirstBlock from './MyFirstBlock';
import { registerFaustBlock } from '@faustwp/block-editor-utils';
registerFaustBlock(MyFirstBlock, { blockJson: metadata });
Published by github-actions[bot] about 1 year ago
Published by josephfusco about 1 year ago
188bd75: Auto-update enqueued asset versions whenenever the plugin is updated.
Published by blakewilson about 1 year ago
Published by github-actions[bot] about 1 year ago
f308cc5: Allow passing extra parameters in Page.variables(). This is allowed in getNextStaticProps
, getServerSideProps
and getWordPressProps
:
Ex:
export function getStaticProps(ctx) {
return getWordPressProps({ ctx, extra: {hello: 'world'} }); // extra parameter will be forwarded to the Template `variables` callback
}
Component.variables = ({ databaseId }, ctx, extra) => {
console.log(extra) // {hello: 'world'}
...
}
Published by github-actions[bot] about 1 year ago
Published by blakewilson over 1 year ago
Published by github-actions[bot] over 1 year ago
useLogin
and fetchAccessToken
access token code
parameter is now properly escaped. Fixes bug with authentication not workin on Vercel.Published by github-actions[bot] over 1 year ago
240a47b: Introduced the CoreList
block. It can be used like:
wp-blocks/index.js
:
import { CoreBlocks } from '@faustwp/blocks';
export default {
// Your other blocks...
CoreList: CoreBlocks.CoreList,
};
19c7395: Added CoreHeading block implementation.
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by blakewilson over 1 year ago
@faustwp/blocks
version to telemetry data.Published by blakewilson over 1 year ago
442c834: BREAKING: By default, Faust is now using GET for GraphQL requests in Apollo. If you would like to switch back to POST requests, you can do so by setting the useGETForQueries
property to false
in faust.config.js
4cae3d9: BREAKING - Fixed seed query failing when attempting to view an unpublished WordPress post with a draft status.
Previously the seed query would only receive data.node
. These changes update the seed query to now receive both data.contentNode
& data.nodeByUri
. Note that projects hooking into Faust's seedQueryDocumentNode
filter will need to refactor in order to use the new nodeByUri/contentNode syntax.
usePersistedQueries
property in your faust.config.js
basePath
property in faust.config.js
. Thanks @riderjensen!fast-xml-parser
dependencyPublished by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago