Releases: wpengine/faustjs
@faustjs/core@0.12.4
Patch Changes
- 81d6162: Refactored core exports and naming to make root namespace cleaner
@faustjs/next@0.12.3
Patch Changes
-
068f3c3: Introduced the
useLogout
hook to facilitate logging out a userSee https://faustjs.org/docs/next/reference/custom-hooks#uselogout for more details.
-
Updated dependencies [068f3c3]
- @faustjs/core@0.12.3
@faustjs/core@0.12.3
Patch Changes
- 068f3c3: Fixed an issue that caused the API Router to not route requests with an authorization code
@faustjs/next@0.12.2
Patch Changes
- 1e32f81: Typeings for
getNextStaticProps
andgetNextServerSideProps
now allow and protect custom props.
@faustjs/next@0.12.1
Patch Changes
- 7d30277:
logQueries
is can now be called and will log GraphQL queries if desired.
@faustjs/react@0.12.0
Minor Changes
-
8243e9f:
headlessConfig
from@faustjs/core
is now justconfig
, and@faustjs/next
has its ownconfig
with a global revalidate option.Your
faust.config.js
needs to change to look like this:import { config as coreConfig } 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.local file?', ); } /** * @type {import("@faustjs/core").Config} */ export default coreConfig({ wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL, apiClientSecret: process.env.WP_HEADLESS_SECRET, });
Or, to configure the global
revalidate
option in@faustjs/next
:import { config as coreConfig } from '@faustjs/core'; import { config as nextConfig } from '@faustjs/next'; 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.local file?', ); } nextConfig({ revalidate: 60, // 1 minute }); /** * @type {import("@faustjs/core").Config} */ export default coreConfig({ wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL, apiClientSecret: process.env.WP_HEADLESS_SECRET, });
NOTE:
@faustjs/next
defaults torevalidate: 900
(15 minutes).
Patch Changes
@faustjs/next@0.12.0
Minor Changes
-
8243e9f:
headlessConfig
from@faustjs/core
is now justconfig
, and@faustjs/next
has its ownconfig
with a global revalidate option.Your
faust.config.js
needs to change to look like this:import { config as coreConfig } 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.local file?', ); } /** * @type {import("@faustjs/core").Config} */ export default coreConfig({ wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL, apiClientSecret: process.env.WP_HEADLESS_SECRET, });
Or, to configure the global
revalidate
option in@faustjs/next
:import { config as coreConfig } from '@faustjs/core'; import { config as nextConfig } from '@faustjs/next'; 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.local file?', ); } nextConfig({ revalidate: 60, // 1 minute }); /** * @type {import("@faustjs/core").Config} */ export default coreConfig({ wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL, apiClientSecret: process.env.WP_HEADLESS_SECRET, });
NOTE:
@faustjs/next
defaults torevalidate: 900
(15 minutes). -
5c7f662: Introduced an argument to the
useAuth
hook,UseAuthOptions
, to provide users the ability to disable automatic redirect from theuseAuth
hook upon an unauthenticated user.import { client } from 'client'; export default function Page() { const { isLoading, isAuthenticated, authResult } = client.auth.useAuth({ shouldRedirect: false, }); if (isLoading) { return <p>Loading...</p>; } if (!isAuthenticated) { return ( <p>You need to be authenticated to see this content. Please login.</p> ); } return <p>Authenticated content</p>; }
Patch Changes
@faustjs/core@0.12.0
Minor Changes
-
4ded997: Implement
logoutHandler
middleware -
8243e9f:
headlessConfig
from@faustjs/core
is now justconfig
, and@faustjs/next
has its ownconfig
with a global revalidate option.Your
faust.config.js
needs to change to look like this:import { config as coreConfig } 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.local file?', ); } /** * @type {import("@faustjs/core").Config} */ export default coreConfig({ wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL, apiClientSecret: process.env.WP_HEADLESS_SECRET, });
Or, to configure the global
revalidate
option in@faustjs/next
:import { config as coreConfig } from '@faustjs/core'; import { config as nextConfig } from '@faustjs/next'; 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.local file?', ); } nextConfig({ revalidate: 60, // 1 minute }); /** * @type {import("@faustjs/core").Config} */ export default coreConfig({ wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL, apiClientSecret: process.env.WP_HEADLESS_SECRET, });
NOTE:
@faustjs/next
defaults torevalidate: 900
(15 minutes). -
f0f2706: Introduced the
apiRouter
that will handle all of the Faust.js related endpoints for you.Breaking Changes
With the introduction of
apiRouter
we have introduced a breaking change. You will need to remove yourpages/api/auth/wpe-headless.ts
file, and create a new file,pages/api/faust/[[...route]].ts
with the following content:import 'faust.config'; import { apiRouter } from '@faustjs/core/api'; export default apiRouter;
Note: The
[[...route]]
naming convention is a Next.js convention for a catch-all route.Config changes
The
apiEndpoint
andapiUrl
config options have been removed in exchange for theapiBasePath
option. This option specifies the base path for all of the Faust.js endpoints. TheblogUrlPrefix
is no longer necessary and has been removed from the config interface.
Patch Changes
package/core/0.11.0
Refactor `next/getting-started` example to 0.11.0 (#497) * Update example starter schema * Update Faust.js to 0.11.0
package/core/0.10.2
Releasing 0.10.2 (#453) * chore: 0.10.2 * fix: allowing npm i to pass * fix: npm audit * fix: tests passing