-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f0f2706
commit d2ab282
Showing
13 changed files
with
240 additions
and
129 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# @faustjs/core | ||
|
||
## 0.12.0 | ||
|
||
### Minor Changes | ||
|
||
- 4ded997: Implement `logoutHandler` middleware | ||
- 8243e9f: `headlessConfig` from `@faustjs/core` is now just `config`, and `@faustjs/next` has its own `config` with a global revalidate option. | ||
|
||
Your `faust.config.js` needs to change to look like this: | ||
|
||
```ts | ||
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`: | ||
|
||
```ts | ||
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 to `revalidate: 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 your `pages/api/auth/wpe-headless.ts` file, and create a new file, `pages/api/faust/[[...route]].ts` with the following content: | ||
|
||
```ts | ||
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.](https://nextjs.org/docs/routing/dynamic-routes#optional-catch-all-routes) | ||
|
||
### Config changes | ||
|
||
The `apiEndpoint` and `apiUrl` config options have been removed in exchange for the `apiBasePath` option. This option specifies the base path for all of the Faust.js endpoints. The `blogUrlPrefix` is no longer necessary and has been removed from the config interface. | ||
|
||
### Patch Changes | ||
|
||
- c4b205a: Implemented `changesets` 🦋 | ||
- 5c7f662: Added the appropriate `Content-Type` response header to the `authorizeHandler` middleware |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# @faustjs/next | ||
|
||
## 0.12.0 | ||
|
||
### Minor Changes | ||
|
||
- 8243e9f: `headlessConfig` from `@faustjs/core` is now just `config`, and `@faustjs/next` has its own `config` with a global revalidate option. | ||
|
||
Your `faust.config.js` needs to change to look like this: | ||
|
||
```ts | ||
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`: | ||
|
||
```ts | ||
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 to `revalidate: 900` (15 minutes). | ||
|
||
- 5c7f662: Introduced an argument to the `useAuth` hook, `UseAuthOptions`, to provide users the ability to disable automatic redirect from the `useAuth` hook upon an unauthenticated user. | ||
|
||
```tsx | ||
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 | ||
|
||
- c4b205a: Implemented `changesets` 🦋 | ||
- Updated dependencies [4ded997] | ||
- Updated dependencies [8243e9f] | ||
- Updated dependencies [f0f2706] | ||
- Updated dependencies [c4b205a] | ||
- Updated dependencies [5c7f662] | ||
- @faustjs/core@0.12.0 | ||
- @faustjs/react@0.12.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# @faustjs/react | ||
|
||
## 0.12.0 | ||
|
||
### Minor Changes | ||
|
||
- 8243e9f: `headlessConfig` from `@faustjs/core` is now just `config`, and `@faustjs/next` has its own `config` with a global revalidate option. | ||
|
||
Your `faust.config.js` needs to change to look like this: | ||
|
||
```ts | ||
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`: | ||
|
||
```ts | ||
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 to `revalidate: 900` (15 minutes). | ||
|
||
### Patch Changes | ||
|
||
- c4b205a: Implemented `changesets` 🦋 | ||
- Updated dependencies [4ded997] | ||
- Updated dependencies [8243e9f] | ||
- Updated dependencies [f0f2706] | ||
- Updated dependencies [c4b205a] | ||
- Updated dependencies [5c7f662] | ||
- @faustjs/core@0.12.0 |
Oops, something went wrong.