Compare commits
42 Commits
@nhost/das
...
@nhost/nex
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52d4b5de45 | ||
|
|
6b4ab50f74 | ||
|
|
ceba605d0b | ||
|
|
9249a85ee5 | ||
|
|
f4d70f88e9 | ||
|
|
0d09b80b12 | ||
|
|
b09930c8a4 | ||
|
|
687951281e | ||
|
|
c0f05acd9b | ||
|
|
4a9471cc16 | ||
|
|
567e370bdc | ||
|
|
a91f2db0e2 | ||
|
|
aea99ad2c8 | ||
|
|
594488e435 | ||
|
|
bb83b0f81a | ||
|
|
0384d7c7c4 | ||
|
|
7e356a9604 | ||
|
|
013e55a307 | ||
|
|
2a71257cde | ||
|
|
583a4401d0 | ||
|
|
914e91a0b0 | ||
|
|
98698213e2 | ||
|
|
756daa97cd | ||
|
|
ab5a2b119c | ||
|
|
ffdcce1463 | ||
|
|
a3dcb6106e | ||
|
|
208d224763 | ||
|
|
564d000bfc | ||
|
|
266fda07ab | ||
|
|
6174e1ddcc | ||
|
|
af2e3eae37 | ||
|
|
d2b4c126f3 | ||
|
|
7f2e182c47 | ||
|
|
ae40bd54d4 | ||
|
|
b5cc47078a | ||
|
|
7f251111e2 | ||
|
|
c03dacc3a3 | ||
|
|
8b9e1a0ce8 | ||
|
|
cf9cfec330 | ||
|
|
1c94f56c59 | ||
|
|
f06d5deba3 | ||
|
|
2a86b8876c |
14
.github/workflows/ci.yaml
vendored
14
.github/workflows/ci.yaml
vendored
@@ -36,13 +36,23 @@ jobs:
|
||||
TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
|
||||
TURBO_TEAM: ${{ env.TURBO_TEAM }}
|
||||
BUILD: 'all'
|
||||
- name: Check if the pnpm lockfile changed
|
||||
id: changed-lockfile
|
||||
uses: tj-actions/changed-files@v34
|
||||
with:
|
||||
files: pnpm-lock.yaml
|
||||
# * Determine a pnpm filter argument for packages that have been modified.
|
||||
# * If the lockfile has changed, we don't filter anything in order to run all the e2e tests.
|
||||
- name: filter packages
|
||||
id: filter-packages
|
||||
if: steps.changed-lockfile.outputs.any_changed != 'true' && github.event_name == 'pull_request'
|
||||
run: echo "filter=${{ format('--filter=...[origin/{0}]', github.base_ref) }}" >> $GITHUB_OUTPUT
|
||||
# * List packagesthat has an `e2e` script, except the root, and return an array of their name and path
|
||||
# * In a PR, only include packages that have been modified, and their dependencies
|
||||
- name: List examples with an e2e script
|
||||
id: set-matrix
|
||||
run: |
|
||||
FILTER_MODIFIED="${{ github.event_name == 'pull_request' && format('--filter=...[origin/{0}]', github.base_ref) || '' }}"
|
||||
PACKAGES=$(pnpm recursive list --depth -1 --parseable --filter='!nhost-root' $FILTER_MODIFIED \
|
||||
PACKAGES=$(pnpm recursive list --depth -1 --parseable --filter='!nhost-root' ${{ steps.filter-packages.outputs.filter }} \
|
||||
| xargs -I@ realpath --relative-to=$PWD @ \
|
||||
| xargs -I@ jq "if (.scripts.e2e | length) != 0 then {name: .name, path: \"@\"} else null end" @/package.json \
|
||||
| awk "!/null/" \
|
||||
|
||||
@@ -14,4 +14,5 @@ package.json
|
||||
tsconfig.json
|
||||
tsconfig.*.json
|
||||
*.d.ts
|
||||
.next
|
||||
.next
|
||||
**/pnpm-lock.yaml
|
||||
63
README.md
63
README.md
@@ -258,21 +258,28 @@ Here are some ways of contributing to making Nhost better:
|
||||
<sub><b>Subhendu Kundu</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/badgifter">
|
||||
<img src="https://avatars.githubusercontent.com/u/50094885?v=4" width="100;" alt="badgifter"/>
|
||||
<br />
|
||||
<sub><b>Bad Gifter</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/heygambo">
|
||||
<img src="https://avatars.githubusercontent.com/u/449438?v=4" width="100;" alt="heygambo"/>
|
||||
<br />
|
||||
<sub><b>Christian Gambardella</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/dbarrosop">
|
||||
<img src="https://avatars.githubusercontent.com/u/6246622?v=4" width="100;" alt="dbarrosop"/>
|
||||
<br />
|
||||
<sub><b>David Barroso</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/hajek-raven">
|
||||
<img src="https://avatars.githubusercontent.com/u/7288737?v=4" width="100;" alt="hajek-raven"/>
|
||||
@@ -294,13 +301,21 @@ Here are some ways of contributing to making Nhost better:
|
||||
<sub><b>Jerry Jäppinen</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/wollerman">
|
||||
<img src="https://avatars.githubusercontent.com/u/1610241?v=4" width="100;" alt="wollerman"/>
|
||||
<br />
|
||||
<sub><b>Matt Wollerman</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/mdp18">
|
||||
<img src="https://avatars.githubusercontent.com/u/11698527?v=4" width="100;" alt="mdp18"/>
|
||||
<br />
|
||||
<sub><b>Max</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/mustafa-hanif">
|
||||
<img src="https://avatars.githubusercontent.com/u/30019262?v=4" width="100;" alt="mustafa-hanif"/>
|
||||
@@ -314,8 +329,7 @@ Here are some ways of contributing to making Nhost better:
|
||||
<br />
|
||||
<sub><b>Nicolas Bourdin</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/piromsurang">
|
||||
<img src="https://avatars.githubusercontent.com/u/17776837?v=4" width="100;" alt="piromsurang"/>
|
||||
@@ -343,7 +357,8 @@ Here are some ways of contributing to making Nhost better:
|
||||
<br />
|
||||
<sub><b>Muttenzer</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/alexander-mart">
|
||||
<img src="https://avatars.githubusercontent.com/u/14993551?v=4" width="100;" alt="alexander-mart"/>
|
||||
@@ -357,8 +372,7 @@ Here are some ways of contributing to making Nhost better:
|
||||
<br />
|
||||
<sub><b>Amir Ahmic</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/akd-io">
|
||||
<img src="https://avatars.githubusercontent.com/u/30059155?v=4" width="100;" alt="akd-io"/>
|
||||
@@ -386,7 +400,8 @@ Here are some ways of contributing to making Nhost better:
|
||||
<br />
|
||||
<sub><b>Chris Wetherell</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/rustyb">
|
||||
<img src="https://avatars.githubusercontent.com/u/53086?v=4" width="100;" alt="rustyb"/>
|
||||
@@ -400,8 +415,7 @@ Here are some ways of contributing to making Nhost better:
|
||||
<br />
|
||||
<sub><b>Dago</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/dminkovsky">
|
||||
<img src="https://avatars.githubusercontent.com/u/218725?v=4" width="100;" alt="dminkovsky"/>
|
||||
@@ -429,7 +443,8 @@ Here are some ways of contributing to making Nhost better:
|
||||
<br />
|
||||
<sub><b>Helio Alves</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/nkhdo">
|
||||
<img src="https://avatars.githubusercontent.com/u/26102306?v=4" width="100;" alt="nkhdo"/>
|
||||
@@ -437,14 +452,20 @@ Here are some ways of contributing to making Nhost better:
|
||||
<sub><b>Hoang Do</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/iangabrielsanchez">
|
||||
<img src="https://avatars.githubusercontent.com/u/9511946?v=4" width="100;" alt="iangabrielsanchez"/>
|
||||
<br />
|
||||
<sub><b>Ian Gabriel Sanchez</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/eltociear">
|
||||
<img src="https://avatars.githubusercontent.com/u/22633385?v=4" width="100;" alt="eltociear"/>
|
||||
<br />
|
||||
<sub><b>Ikko Ashimine</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/jladuval">
|
||||
<img src="https://avatars.githubusercontent.com/u/1935359?v=4" width="100;" alt="jladuval"/>
|
||||
@@ -465,7 +486,8 @@ Here are some ways of contributing to making Nhost better:
|
||||
<br />
|
||||
<sub><b>Lucas Bois</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/MarcelloTheArcane">
|
||||
<img src="https://avatars.githubusercontent.com/u/21159570?v=4" width="100;" alt="MarcelloTheArcane"/>
|
||||
@@ -486,8 +508,7 @@ Here are some ways of contributing to making Nhost better:
|
||||
<br />
|
||||
<sub><b>Nirmalya Ghosh</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/quentin-decre">
|
||||
<img src="https://avatars.githubusercontent.com/u/1137511?v=4" width="100;" alt="quentin-decre"/>
|
||||
@@ -508,7 +529,8 @@ Here are some ways of contributing to making Nhost better:
|
||||
<br />
|
||||
<sub><b>Simon Altschuler</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/atapas">
|
||||
<img src="https://avatars.githubusercontent.com/u/3633137?v=4" width="100;" alt="atapas"/>
|
||||
@@ -529,8 +551,7 @@ Here are some ways of contributing to making Nhost better:
|
||||
<br />
|
||||
<sub><b>Vadim</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/TheRedLancer">
|
||||
<img src="https://avatars.githubusercontent.com/u/58493767?v=4" width="100;" alt="TheRedLancer"/>
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
# @nhost/dashboard
|
||||
|
||||
## 0.7.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 7f251111: Use `NhostProvider` instead of `NhostReactProvider` and `NhostNextProvider`
|
||||
|
||||
`NhostReactProvider` and `NhostNextProvider` are now deprecated
|
||||
|
||||
- f4d70f88: fix(dashboard): do not break when region is nullish
|
||||
- 4a9471cc: Windows Live Provider displayed link updated to match backend url
|
||||
- 594488e4: fix(dashboard): do not show error when submitting Apple provider settings
|
||||
- Updated dependencies [7f251111]
|
||||
- @nhost/nextjs@1.10.0
|
||||
- @nhost/react@0.16.0
|
||||
- @nhost/react-apollo@4.10.0
|
||||
|
||||
## 0.7.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/dashboard",
|
||||
"version": "0.7.7",
|
||||
"version": "0.7.8",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"preinstall": "npx only-allow pnpm",
|
||||
|
||||
@@ -5,6 +5,9 @@ import Image from 'next/image';
|
||||
|
||||
export default function OverviewProjectInfo() {
|
||||
const { currentApplication } = useCurrentWorkspaceAndApplication();
|
||||
const { region, subdomain } = currentApplication;
|
||||
const isRegionAvailable =
|
||||
region?.awsName && region?.countryCode && region?.city;
|
||||
|
||||
return (
|
||||
<div className="grid grid-flow-row content-start gap-6">
|
||||
@@ -16,28 +19,28 @@ export default function OverviewProjectInfo() {
|
||||
<div className="grid grid-flow-row gap-3">
|
||||
<InfoCard
|
||||
title="Region"
|
||||
value={currentApplication.region?.awsName}
|
||||
value={region?.awsName}
|
||||
customValue={
|
||||
currentApplication.region && (
|
||||
region.countryCode &&
|
||||
region.city && (
|
||||
<div className="grid grid-flow-col items-center gap-1 self-center">
|
||||
<Image
|
||||
src={`/assets/${currentApplication.region.countryCode}.svg`}
|
||||
alt={`Logo of ${currentApplication.region.countryCode}`}
|
||||
src={`/assets/${region.countryCode}.svg`}
|
||||
alt={`Logo of ${region.countryCode}`}
|
||||
width={16}
|
||||
height={16}
|
||||
/>
|
||||
|
||||
<Text className="text-sm font-medium text-greyscaleDark">
|
||||
{currentApplication.region.city} (
|
||||
{currentApplication.region.awsName})
|
||||
{region.city} ({region.awsName})
|
||||
</Text>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
disableCopy={!currentApplication.region}
|
||||
disableCopy={!isRegionAvailable}
|
||||
/>
|
||||
|
||||
<InfoCard title="Subdomain" value={currentApplication.subdomain} />
|
||||
<InfoCard title="Subdomain" value={subdomain} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -23,7 +23,6 @@ export interface AppleProviderFormValues {
|
||||
authAppleKeyId: string;
|
||||
authAppleClientId: string;
|
||||
authApplePrivateKey: string;
|
||||
authAppleScope: string;
|
||||
}
|
||||
|
||||
export default function AppleProviderSettings() {
|
||||
@@ -38,7 +37,6 @@ export default function AppleProviderSettings() {
|
||||
authAppleKeyId,
|
||||
authAppleClientId,
|
||||
authApplePrivateKey,
|
||||
authAppleScope,
|
||||
},
|
||||
},
|
||||
loading,
|
||||
@@ -57,7 +55,6 @@ export default function AppleProviderSettings() {
|
||||
authAppleKeyId,
|
||||
authAppleClientId,
|
||||
authApplePrivateKey,
|
||||
authAppleScope,
|
||||
authAppleEnabled,
|
||||
},
|
||||
});
|
||||
@@ -83,9 +80,7 @@ export default function AppleProviderSettings() {
|
||||
const updateAppMutation = updateApp({
|
||||
variables: {
|
||||
id: currentApplication.id,
|
||||
app: {
|
||||
...values,
|
||||
},
|
||||
app: values,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -96,7 +91,7 @@ export default function AppleProviderSettings() {
|
||||
success: `Apple settings have been updated successfully.`,
|
||||
error: `An error occurred while trying to update the project's Apple settings.`,
|
||||
},
|
||||
{ ...toastStyleProps },
|
||||
toastStyleProps,
|
||||
);
|
||||
|
||||
form.reset(values);
|
||||
@@ -108,9 +103,11 @@ export default function AppleProviderSettings() {
|
||||
<SettingsContainer
|
||||
title="Apple"
|
||||
description="Allow users to sign in with Apple."
|
||||
primaryActionButtonProps={{
|
||||
disabled: !formState.isValid || !formState.isDirty,
|
||||
loading: formState.isSubmitting,
|
||||
slotProps={{
|
||||
submitButton: {
|
||||
disabled: !formState.isValid || !formState.isDirty,
|
||||
loading: formState.isSubmitting,
|
||||
},
|
||||
}}
|
||||
docsLink="https://docs.nhost.io/authentication/sign-in-with-apple"
|
||||
docsTitle="how to sign in users with Apple"
|
||||
@@ -134,9 +131,9 @@ export default function AppleProviderSettings() {
|
||||
hideEmptyHelperText
|
||||
/>
|
||||
<Input
|
||||
{...register('authAppleScope')}
|
||||
name="authAppleScope"
|
||||
id="authAppleScope"
|
||||
{...register('authAppleClientId')}
|
||||
name="authAppleClientId"
|
||||
id="authAppleClientId"
|
||||
label="Service ID"
|
||||
placeholder="Apple Service ID"
|
||||
className="col-span-1"
|
||||
|
||||
@@ -115,7 +115,7 @@ export default function WindowsLiveProviderSettings() {
|
||||
currentApplication.subdomain,
|
||||
currentApplication.region.awsName,
|
||||
'auth',
|
||||
)}/v1/signin/provider/microsoft/callback`}
|
||||
)}/v1/signin/provider/windowslive/callback`}
|
||||
disabled
|
||||
endAdornment={
|
||||
<InputAdornment position="end" className="absolute right-2">
|
||||
@@ -130,7 +130,7 @@ export default function WindowsLiveProviderSettings() {
|
||||
currentApplication.subdomain,
|
||||
currentApplication.region.awsName,
|
||||
'auth',
|
||||
)}/v1/signin/provider/microsoft/callback`,
|
||||
)}/v1/signin/provider/windowslive/callback`,
|
||||
'Redirect URL',
|
||||
);
|
||||
}}
|
||||
|
||||
@@ -42,7 +42,12 @@ export function useCurrentWorkspaceAndApplication(): UseCurrentWorkspaceAndAppli
|
||||
],
|
||||
deployments: [],
|
||||
subdomain: 'localhost',
|
||||
region: null,
|
||||
region: {
|
||||
id: null,
|
||||
countryCode: null,
|
||||
city: null,
|
||||
awsName: null,
|
||||
},
|
||||
isProvisioned: true,
|
||||
createdAt: new Date().toISOString(),
|
||||
desiredState: ApplicationStatus.Live,
|
||||
|
||||
@@ -21,7 +21,7 @@ import '@fontsource/roboto-mono/400.css';
|
||||
import '@fontsource/roboto-mono/500.css';
|
||||
import { ThemeProvider } from '@mui/material';
|
||||
import CssBaseline from '@mui/material/CssBaseline';
|
||||
import { NhostNextProvider } from '@nhost/nextjs';
|
||||
import { NhostProvider } from '@nhost/nextjs';
|
||||
import { NhostApolloProvider } from '@nhost/react-apollo';
|
||||
import * as snippet from '@segment/snippet';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
@@ -89,7 +89,7 @@ function MyApp({
|
||||
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<CacheProvider value={emotionCache}>
|
||||
<NhostNextProvider nhost={nhost}>
|
||||
<NhostProvider nhost={nhost}>
|
||||
<NhostApolloProvider
|
||||
fetchPolicy="cache-first"
|
||||
nhost={nhost}
|
||||
@@ -118,7 +118,7 @@ function MyApp({
|
||||
</UserDataProvider>
|
||||
</WorkspaceProvider>
|
||||
</NhostApolloProvider>
|
||||
</NhostNextProvider>
|
||||
</NhostProvider>
|
||||
</CacheProvider>
|
||||
</QueryClientProvider>
|
||||
</ErrorBoundary>
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import CheckIcon from '@/ui/v2/icons/CheckIcon';
|
||||
import XIcon from '@/ui/v2/icons/XIcon';
|
||||
import type { DefaultToastOptions } from 'react-hot-toast';
|
||||
|
||||
/**
|
||||
* Common styles for `toast.promise` notifications in the settings page.
|
||||
* @see {@link https://react-hot-toast.com/docs/toast}
|
||||
*/
|
||||
export const toastStyleProps = {
|
||||
export const toastStyleProps: DefaultToastOptions = {
|
||||
style: {
|
||||
minWidth: '400px',
|
||||
backgroundColor: 'rgb(33 50 75)',
|
||||
@@ -12,7 +14,11 @@ export const toastStyleProps = {
|
||||
},
|
||||
success: {
|
||||
duration: 5000,
|
||||
icon: <CheckIcon className="h-4 w-4 bg-transparent" />,
|
||||
icon: <CheckIcon className="h-4 w-4" />,
|
||||
},
|
||||
error: {
|
||||
duration: 5000,
|
||||
icon: <XIcon className="h-4 w-4" />,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { UserDataProvider } from '@/context/workspace1-context';
|
||||
import defaultTheme from '@/theme/default';
|
||||
import { CacheProvider } from '@emotion/react';
|
||||
import { ThemeProvider } from '@mui/material/styles';
|
||||
import { NhostNextProvider } from '@nhost/nextjs';
|
||||
import { NhostProvider } from '@nhost/nextjs';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import type { queries, Queries, RenderOptions } from '@testing-library/react';
|
||||
import { render as rtlRender } from '@testing-library/react';
|
||||
@@ -25,7 +25,7 @@ function Providers({ children }: PropsWithChildren<{}>) {
|
||||
<RetryableErrorBoundary>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<CacheProvider value={emotionCache}>
|
||||
<NhostNextProvider nhost={nhost}>
|
||||
<NhostProvider nhost={nhost}>
|
||||
<WorkspaceProvider>
|
||||
<UserDataProvider>
|
||||
<ManagedUIContext>
|
||||
@@ -36,7 +36,7 @@ function Providers({ children }: PropsWithChildren<{}>) {
|
||||
</ManagedUIContext>
|
||||
</UserDataProvider>
|
||||
</WorkspaceProvider>
|
||||
</NhostNextProvider>
|
||||
</NhostProvider>
|
||||
</CacheProvider>
|
||||
</QueryClientProvider>
|
||||
</RetryableErrorBoundary>
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @nhost/docs
|
||||
|
||||
## 0.0.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 7f251111: Use `NhostProvider` instead of `NhostReactProvider` and `NhostNextProvider`
|
||||
|
||||
`NhostReactProvider` and `NhostNextProvider` are now deprecated
|
||||
|
||||
## 0.0.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -33,7 +33,7 @@ Follow this guide to sign in users with LinkedIn.
|
||||
- Click on **Auth** in the top menu.
|
||||
- Click on the **pen icon** under **OAuth 2.0 settings** and right next to **Authorized redirect URLs for your app**.
|
||||
- Click **Add redirect URL**.
|
||||
- Copy and past the **OAuth Callback URL** from Nhost.
|
||||
- Copy and paste the **OAuth Callback URL** from Nhost.
|
||||
- Click **Update**.
|
||||
|
||||
## Configure Nhost
|
||||
|
||||
@@ -325,6 +325,18 @@ curl http://localhost:1337/v1/functions/time\?name\=Greg
|
||||
Hello Greg! It's now: Wed, 27 Apr 2022 18:52:12 GMT
|
||||
```
|
||||
|
||||
## 4. Managing Local Data
|
||||
|
||||
Nhost makes it easy to manage data on different branches. Within your project directory there is an `.nhost` directory that tracks database configuration, database seeds, mail data, and functions.
|
||||
|
||||
### Seed Data
|
||||
See [the section on seed data](https://docs.nhost.io/database#seed-data) for an overview.
|
||||
|
||||
If seeds have been applied there will be a file `seeds.applied` within the `.nhost/data/<branch-name>/db` directory.
|
||||
|
||||
If you need to re-apply your seeds, delete this file and restart nhost.
|
||||
|
||||
|
||||
## Deploy your project
|
||||
|
||||
To deploy your local changes to production, you can commit and push them to
|
||||
|
||||
@@ -118,7 +118,7 @@ yarn add @nhost/react @nhost/nextjs graphql
|
||||
|
||||
Next, open your `_app.js` file as we'll now configure Nhost inside our app.
|
||||
|
||||
The Nhost Next.js SDK comes with a React provider named `NhostNextProvider` that
|
||||
The Nhost Next.js SDK comes with a React provider named `NhostProvider` that
|
||||
makes the authentication state and all the provided React hooks available in our
|
||||
application.
|
||||
|
||||
@@ -128,7 +128,7 @@ Nhost backend:
|
||||
```jsx title="pages/_app.js"
|
||||
import { UserProvider } from '../UserProvider';
|
||||
// highlight-start
|
||||
import { NhostNextProvider, NhostClient } from '@nhost/nextjs';
|
||||
import { NhostProvider, NhostClient } from '@nhost/nextjs';
|
||||
// highlight-end
|
||||
|
||||
// highlight-start
|
||||
@@ -141,12 +141,12 @@ const nhost = new NhostClient({
|
||||
function MyApp({ Component, pageProps }) {
|
||||
return (
|
||||
{/* highlight-next-line */}
|
||||
<NhostNextProvider nhost={nhost} initial={pageProps.nhostSession}>
|
||||
<NhostProvider nhost={nhost} initial={pageProps.nhostSession}>
|
||||
<UserProvider>
|
||||
{/* ... */}
|
||||
</UserProvider>
|
||||
{/* highlight-next-line */}
|
||||
</NhostNextProvider>
|
||||
</NhostProvider>
|
||||
);
|
||||
}
|
||||
```
|
||||
@@ -561,9 +561,9 @@ import { NhostApolloProvider } from '@nhost/react-apollo'
|
||||
|
||||
function MyApp({ Component, pageProps }) {
|
||||
return (
|
||||
<NhostNextProvider nhost={nhost} initial={pageProps.nhostSession}>
|
||||
<NhostProvider nhost={nhost} initial={pageProps.nhostSession}>
|
||||
<NhostApolloProvider nhost={nhost}>{/* ... */}</NhostApolloProvider>
|
||||
</NhostNextProvider>
|
||||
</NhostProvider>
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -118,7 +118,7 @@ yarn add @nhost/react graphql
|
||||
|
||||
Next, open your `App.js` file as we'll now configure Nhost inside our app.
|
||||
|
||||
The Nhost React SDK comes with a React provider named `NhostReactProvider` that
|
||||
The Nhost React SDK comes with a React provider named `NhostProvider` that
|
||||
makes the authentication state and all the provided React hooks available in our
|
||||
application.
|
||||
|
||||
@@ -126,7 +126,7 @@ Use the following code to instantiate a new Nhost client and link it to your
|
||||
Nhost backend:
|
||||
|
||||
```jsx title="src/App.js"
|
||||
import { NhostClient, NhostReactProvider } from '@nhost/react'
|
||||
import { NhostClient, NhostProvider } from '@nhost/react'
|
||||
|
||||
const nhost = new NhostClient({
|
||||
subdomain: process.env.REACT_APP_NHOST_SUBDOMAIN,
|
||||
@@ -135,9 +135,9 @@ const nhost = new NhostClient({
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<NhostReactProvider nhost={nhost}>
|
||||
<NhostProvider nhost={nhost}>
|
||||
<BrowserRouter>{/* ... */}</BrowserRouter>
|
||||
</NhostReactProvider>
|
||||
</NhostProvider>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -443,7 +443,7 @@ import ProtectedRoute from './components/ProtectedRoute'
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<NhostReactProvider nhost={nhost}>
|
||||
<NhostProvider nhost={nhost}>
|
||||
<BrowserRouter>
|
||||
<Routes>
|
||||
<Route path="sign-up" element={<SignUp />} />
|
||||
@@ -463,7 +463,7 @@ function App() {
|
||||
</Route>
|
||||
</Routes>
|
||||
</BrowserRouter>
|
||||
</NhostReactProvider>
|
||||
</NhostProvider>
|
||||
)
|
||||
}
|
||||
```
|
||||
@@ -527,9 +527,9 @@ import { NhostApolloProvider } from '@nhost/react-apollo'
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<NhostReactProvider nhost={nhost}>
|
||||
<NhostProvider nhost={nhost}>
|
||||
<NhostApolloProvider nhost={nhost}>{/* ... */}</NhostApolloProvider>
|
||||
</NhostReactProvider>
|
||||
</NhostProvider>
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ title: NhostClient
|
||||
sidebar_label: NhostClient
|
||||
description: No description provided.
|
||||
slug: /reference/nextjs/nhost-client
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nextjs/src/index.ts#L30
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nextjs/src/index.ts#L37
|
||||
---
|
||||
|
||||
# `NhostClient`
|
||||
|
||||
@@ -4,7 +4,7 @@ title: NhostNextClientConstructorParams
|
||||
sidebar_label: NhostNextClientConstructorParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nextjs/src/index.ts#L16
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nextjs/src/index.ts#L23
|
||||
---
|
||||
|
||||
# `NhostNextClientConstructorParams`
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: NhostReactProviderProps
|
||||
sidebar_label: NhostReactProviderProps
|
||||
title: NhostProviderProps
|
||||
sidebar_label: NhostProviderProps
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/provider.tsx#L9
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/provider.tsx#L8
|
||||
---
|
||||
|
||||
# `NhostReactProviderProps`
|
||||
# `NhostProviderProps`
|
||||
|
||||
## Parameters
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: NhostReactProviderProps
|
||||
sidebar_label: NhostReactProviderProps
|
||||
title: NhostProviderProps
|
||||
sidebar_label: NhostProviderProps
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/provider.tsx#L9
|
||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/provider.tsx#L8
|
||||
---
|
||||
|
||||
# `NhostReactProviderProps`
|
||||
# `NhostProviderProps`
|
||||
|
||||
## Parameters
|
||||
|
||||
@@ -31,12 +31,12 @@ yarn add @nhost/react @nhost/nextjs graphql
|
||||
|
||||
## Initializing
|
||||
|
||||
Initialize a single `nhost` instance and wrap your app with the `NhostNextProvider`.
|
||||
Initialize a single `nhost` instance and wrap your app with the `NhostProvider`.
|
||||
|
||||
```jsx title=pages/_app.js
|
||||
import type { AppProps } from 'next/app'
|
||||
|
||||
import { NhostClient, NhostNextProvider } from '@nhost/nextjs'
|
||||
import { NhostClient, NhostProvider } from '@nhost/nextjs'
|
||||
|
||||
const nhost = new NhostClient({
|
||||
subdomain: '<your-subdomain>',
|
||||
@@ -45,9 +45,9 @@ const nhost = new NhostClient({
|
||||
|
||||
function MyApp({ Component, pageProps }: AppProps) {
|
||||
return (
|
||||
<NhostNextProvider nhost={nhost} initial={pageProps.nhostSession}>
|
||||
<NhostProvider nhost={nhost} initial={pageProps.nhostSession}>
|
||||
<Component {...pageProps} />
|
||||
</NhostNextProvider>
|
||||
</NhostProvider>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -131,12 +131,12 @@ yarn add @nhost/react-apollo @apollo/client
|
||||
|
||||
### Initializing
|
||||
|
||||
Wrap the Next.js app with the `NhostApolloProvider` and make sure the `NhostApolloProvider` is nested inside the `NhostNextProvider`.
|
||||
Wrap the Next.js app with the `NhostApolloProvider` and make sure the `NhostApolloProvider` is nested inside the `NhostProvider`.
|
||||
|
||||
```jsx title=pages/_app.js
|
||||
import type { AppProps } from 'next/app'
|
||||
|
||||
import { NhostClient, NhostNextProvider } from '@nhost/nextjs'
|
||||
import { NhostClient, NhostProvider } from '@nhost/nextjs'
|
||||
import { NhostApolloProvider } from '@nhost/react-apollo'
|
||||
|
||||
const nhost = new NhostClient({
|
||||
@@ -146,11 +146,11 @@ const nhost = new NhostClient({
|
||||
|
||||
function MyApp({ Component, pageProps }: AppProps) {
|
||||
return (
|
||||
<NhostNextProvider nhost={nhost} initial={pageProps.nhostSession}>
|
||||
<NhostProvider nhost={nhost} initial={pageProps.nhostSession}>
|
||||
<NhostApolloProvider nhost={nhost}>
|
||||
<Component {...pageProps} />
|
||||
</NhostApolloProvider>
|
||||
</NhostNextProvider>
|
||||
</NhostProvider>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ yarn add @nhost/react @nhost/react-apollo @apollo/client graphql
|
||||
|
||||
## Initializing
|
||||
|
||||
Wrap the React app with the `NhostApolloProvider` and make sure the `NhostApolloProvider` is nested inside the `NhostReactProvider`.
|
||||
Wrap the React app with the `NhostApolloProvider` and make sure the `NhostApolloProvider` is nested inside the `NhostProvider`.
|
||||
|
||||
This way, the correct authentication headers are set automatically for GraphQL requests being made by Apollo.
|
||||
|
||||
@@ -36,7 +36,7 @@ import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import App from './App'
|
||||
import { NhostApolloProvider } from '@nhost/react-apollo'
|
||||
import { NhostClient, NhostReactProvider } from '@nhost/react'
|
||||
import { NhostClient, NhostProvider } from '@nhost/react'
|
||||
|
||||
const nhost = new NhostClient({
|
||||
subdomain: '<app-subdomain>',
|
||||
@@ -45,11 +45,11 @@ const nhost = new NhostClient({
|
||||
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
<NhostReactProvider nhost={nhost}>
|
||||
<NhostProvider nhost={nhost}>
|
||||
<NhostApolloProvider nhost={nhost}>
|
||||
<App />
|
||||
</NhostApolloProvider>
|
||||
</NhostReactProvider>
|
||||
</NhostProvider>
|
||||
</React.StrictMode>,
|
||||
document.getElementById('root')
|
||||
)
|
||||
|
||||
@@ -44,22 +44,22 @@ const nhost = new NhostClient({
|
||||
export { nhost }
|
||||
```
|
||||
|
||||
Import `nhost` and wrap your app with the `NhostReactProvider`.
|
||||
Import `nhost` and wrap your app with the `NhostProvider`.
|
||||
|
||||
```jsx title=src/App.tsx
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
|
||||
import { NhostClient, NhostReactProvider } from '@nhost/react'
|
||||
import { NhostClient, NhostProvider } from '@nhost/react'
|
||||
import { nhost } from './lib/nhost'
|
||||
|
||||
import App from './App'
|
||||
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
<NhostReactProvider nhost={nhost}>
|
||||
<NhostProvider nhost={nhost}>
|
||||
<App />
|
||||
</NhostReactProvider>
|
||||
</NhostProvider>
|
||||
</React.StrictMode>,
|
||||
document.getElementById('root')
|
||||
)
|
||||
|
||||
@@ -40,7 +40,7 @@ If the user is **not** authenticated (not signed-in), the user is redirected to
|
||||
Finally, we use a [layout route](https://reactrouter.com/docs/en/v6/getting-started/concepts#layout-routes) in `App.js` to wrap the `ProtectedRoute` component around the routes we want to protect:
|
||||
|
||||
```jsx title=src/App.js
|
||||
import { NhostReactProvider } from '@nhost/react'
|
||||
import { NhostProvider } from '@nhost/react'
|
||||
import { BrowserRouter, Route, Routes } from 'react-router-dom'
|
||||
|
||||
import { ProtectedRoute } from './components/ProtectedRoute'
|
||||
@@ -52,7 +52,7 @@ import Profile from './pages/Profile'
|
||||
|
||||
export function App() {
|
||||
return (
|
||||
<NhostReactProvider nhost={nhost}>
|
||||
<NhostProvider nhost={nhost}>
|
||||
<BrowserRouter>
|
||||
<Routes>
|
||||
<Route path="/" element={<Home />} />
|
||||
@@ -63,7 +63,7 @@ export function App() {
|
||||
</Route>
|
||||
</Routes>
|
||||
</BrowserRouter>
|
||||
</NhostReactProvider>
|
||||
</NhostProvider>
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/docs",
|
||||
"version": "0.0.7",
|
||||
"version": "0.0.8",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"docusaurus": "docusaurus",
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# @nhost-examples/codegen-react-apollo
|
||||
|
||||
## 0.1.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 7f251111: Use `NhostProvider` instead of `NhostReactProvider` and `NhostNextProvider`
|
||||
|
||||
`NhostReactProvider` and `NhostNextProvider` are now deprecated
|
||||
|
||||
- Updated dependencies [7f251111]
|
||||
- @nhost/react@0.16.0
|
||||
- @nhost/react-apollo@4.10.0
|
||||
|
||||
## 0.1.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/codegen-react-apollo",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.6.9",
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { NewCustomer } from './components/new-customer'
|
||||
import { Customers } from './components/customers'
|
||||
import { NhostProvider } from '@nhost/react'
|
||||
import { NhostApolloProvider } from '@nhost/react-apollo'
|
||||
import { Customers } from './components/customers'
|
||||
import { NewCustomer } from './components/new-customer'
|
||||
import { nhost } from './utils/nhost'
|
||||
import { NhostReactProvider } from '@nhost/react'
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<NhostReactProvider nhost={nhost}>
|
||||
<NhostProvider nhost={nhost}>
|
||||
<NhostApolloProvider nhost={nhost}>
|
||||
<div>
|
||||
<h1>GraphQL Code Generator example with React and Apollo</h1>
|
||||
@@ -18,7 +18,7 @@ function App() {
|
||||
</div>
|
||||
</div>
|
||||
</NhostApolloProvider>
|
||||
</NhostReactProvider>
|
||||
</NhostProvider>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
# @nhost-examples/codegen-react-query
|
||||
|
||||
## 0.1.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 7f251111: Use `NhostProvider` instead of `NhostReactProvider` and `NhostNextProvider`
|
||||
|
||||
`NhostReactProvider` and `NhostNextProvider` are now deprecated
|
||||
|
||||
- Updated dependencies [7f251111]
|
||||
- @nhost/react@0.16.0
|
||||
|
||||
## 0.1.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/codegen-react-query",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@nhost/react": "*",
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import { NewCustomer } from './components/new-customer'
|
||||
import { Customers } from './components/customers'
|
||||
import { NhostReactProvider } from '@nhost/react'
|
||||
import { NhostProvider } from '@nhost/react'
|
||||
import { QueryClientProvider } from '@tanstack/react-query'
|
||||
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
|
||||
|
||||
import { queryClient } from './utils/react-query-client'
|
||||
import { Customers } from './components/customers'
|
||||
import { NewCustomer } from './components/new-customer'
|
||||
import { nhost } from './utils/nhost'
|
||||
import { queryClient } from './utils/react-query-client'
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<NhostReactProvider nhost={nhost}>
|
||||
<NhostProvider nhost={nhost}>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<div>
|
||||
<h1>GraphQL Code Generator example with React and React Query</h1>
|
||||
@@ -22,7 +21,7 @@ function App() {
|
||||
</div>
|
||||
<ReactQueryDevtools initialIsOpen={false} />
|
||||
</QueryClientProvider>
|
||||
</NhostReactProvider>
|
||||
</NhostProvider>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
# @nhost-examples/nextjs
|
||||
|
||||
## 0.1.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 7f251111: Use `NhostProvider` instead of `NhostReactProvider` and `NhostNextProvider`
|
||||
|
||||
`NhostReactProvider` and `NhostNextProvider` are now deprecated
|
||||
|
||||
- Updated dependencies [7f251111]
|
||||
- @nhost/nextjs@1.10.0
|
||||
- @nhost/react@0.16.0
|
||||
- @nhost/react-apollo@4.10.0
|
||||
|
||||
## 0.1.2
|
||||
|
||||
### Patch Changes
|
||||
@@ -19,7 +32,7 @@
|
||||
- Updated dependencies [6da44bf8]
|
||||
- @nhost/nextjs@1.9.0
|
||||
- @nhost/react@0.14.0
|
||||
- @nhost/react-apollo@5.0.0
|
||||
- @nhost/react-apollo@4.10.0
|
||||
|
||||
## 0.0.2
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/nextjs",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
import type { AppProps } from 'next/app'
|
||||
import Head from 'next/head'
|
||||
|
||||
import { AppShell, Header, MantineProvider } from '@mantine/core'
|
||||
import { NotificationsProvider } from '@mantine/notifications'
|
||||
import { NhostClient, NhostNextProvider } from '@nhost/nextjs'
|
||||
import { NhostClient, NhostProvider } from '@nhost/nextjs'
|
||||
import { NhostApolloProvider } from '@nhost/react-apollo'
|
||||
import { inspect } from '@xstate/inspect'
|
||||
|
||||
import type { AppProps } from 'next/app'
|
||||
import Head from 'next/head'
|
||||
import NavBar from '../components/NavBar'
|
||||
import { BACKEND_URL } from '../helpers'
|
||||
|
||||
import '../styles/globals.css'
|
||||
|
||||
const devTools = typeof window !== 'undefined' && !!process.env.NEXT_PUBLIC_DEBUG
|
||||
@@ -25,7 +22,7 @@ function MyApp({ Component, pageProps }: AppProps) {
|
||||
// * Monorepo-related. See: https://stackoverflow.com/questions/71843247/react-nextjs-type-error-component-cannot-be-used-as-a-jsx-component
|
||||
// const AnyComponent = Component as any
|
||||
return (
|
||||
<NhostNextProvider nhost={nhost} initial={pageProps.nhostSession}>
|
||||
<NhostProvider nhost={nhost} initial={pageProps.nhostSession}>
|
||||
<NhostApolloProvider nhost={nhost}>
|
||||
<Head>
|
||||
<title>{title}</title>
|
||||
@@ -61,7 +58,7 @@ function MyApp({ Component, pageProps }: AppProps) {
|
||||
</NotificationsProvider>
|
||||
</MantineProvider>
|
||||
</NhostApolloProvider>
|
||||
</NhostNextProvider>
|
||||
</NhostProvider>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# @nhost-examples/react-apollo
|
||||
|
||||
## 0.1.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 7f251111: Use `NhostProvider` instead of `NhostReactProvider` and `NhostNextProvider`
|
||||
|
||||
`NhostReactProvider` and `NhostNextProvider` are now deprecated
|
||||
|
||||
- Updated dependencies [7f251111]
|
||||
- @nhost/react@0.16.0
|
||||
- @nhost/react-apollo@4.10.0
|
||||
|
||||
## 0.1.2
|
||||
|
||||
### Patch Changes
|
||||
@@ -17,7 +29,7 @@
|
||||
- Updated dependencies [ba785da1]
|
||||
- Updated dependencies [6da44bf8]
|
||||
- @nhost/react@0.14.0
|
||||
- @nhost/react-apollo@5.0.0
|
||||
- @nhost/react-apollo@4.10.0
|
||||
|
||||
## 0.1.0
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost-examples/react-apollo",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.6.9",
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { BrowserRouter } from 'react-router-dom'
|
||||
|
||||
import { NhostClient, NhostReactProvider } from '@nhost/react'
|
||||
import { NhostClient, NhostProvider } from '@nhost/react'
|
||||
import { NhostApolloProvider } from '@nhost/react-apollo'
|
||||
import { inspect } from '@xstate/inspect'
|
||||
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { BrowserRouter } from 'react-router-dom'
|
||||
import App from './App'
|
||||
|
||||
const devTools = import.meta.env.MODE === 'development' && import.meta.env.VITE_DEBUG === 'true'
|
||||
@@ -28,11 +26,11 @@ root.render(
|
||||
// * The xstate inspector is hard to use with React 18 strict mode
|
||||
// <React.StrictMode>
|
||||
<BrowserRouter>
|
||||
<NhostReactProvider nhost={nhost}>
|
||||
<NhostProvider nhost={nhost}>
|
||||
<NhostApolloProvider nhost={nhost}>
|
||||
<App />
|
||||
</NhostApolloProvider>
|
||||
</NhostReactProvider>
|
||||
</NhostProvider>
|
||||
</BrowserRouter>
|
||||
// </React.StrictMode>
|
||||
)
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
# @nhost-examples/react-gqty
|
||||
|
||||
## 0.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 7f251111: Use `NhostProvider` instead of `NhostReactProvider` and `NhostNextProvider`
|
||||
|
||||
`NhostReactProvider` and `NhostNextProvider` are now deprecated
|
||||
|
||||
- Updated dependencies [7f251111]
|
||||
- @nhost/react@0.16.0
|
||||
|
||||
## 0.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@nhost-examples/react-gqty",
|
||||
"private": true,
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { NhostProvider } from '@nhost/react'
|
||||
import React, { Suspense } from 'react'
|
||||
|
||||
import { NhostReactProvider } from '@nhost/react'
|
||||
|
||||
import { SignedIn, SignedOut } from './components/controlls'
|
||||
import { ListPrivatePosts } from './components/ListPrivatePosts'
|
||||
import { ListPublicPosts } from './components/ListPublicPosts'
|
||||
@@ -10,7 +8,7 @@ import { nhost } from './utils/nhost'
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<NhostReactProvider nhost={nhost}>
|
||||
<NhostProvider nhost={nhost}>
|
||||
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 mt-6">
|
||||
<div className="mx-auto max-w-3xl">
|
||||
<SignedIn>
|
||||
@@ -38,7 +36,7 @@ function App() {
|
||||
</SignedOut>
|
||||
</div>
|
||||
</div>
|
||||
</NhostReactProvider>
|
||||
</NhostProvider>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
# @nhost/nextjs
|
||||
|
||||
## 1.10.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 7f251111: Use `NhostProvider` instead of `NhostReactProvider` and `NhostNextProvider`
|
||||
|
||||
`NhostReactProvider` and `NhostNextProvider` are now deprecated
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7f251111]
|
||||
- @nhost/react@0.16.0
|
||||
|
||||
## 1.9.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -30,12 +30,12 @@ yarn add @nhost/react @nhost/nextjs graphql
|
||||
|
||||
## Initializing
|
||||
|
||||
Initialize a single `nhost` instance and wrap your app with the `NhostNextProvider`.
|
||||
Initialize a single `nhost` instance and wrap your app with the `NhostProvider`.
|
||||
|
||||
```jsx title=pages/_app.js
|
||||
import type { AppProps } from 'next/app'
|
||||
|
||||
import { NhostClient, NhostNextProvider } from '@nhost/nextjs'
|
||||
import { NhostClient, NhostProvider } from '@nhost/nextjs'
|
||||
|
||||
const nhost = new NhostClient({
|
||||
subdomain: '<Your Nhost project subdomain>',
|
||||
@@ -44,9 +44,9 @@ const nhost = new NhostClient({
|
||||
|
||||
function MyApp({ Component, pageProps }: AppProps) {
|
||||
return (
|
||||
<NhostNextProvider nhost={nhost} initial={pageProps.nhostSession}>
|
||||
<NhostProvider nhost={nhost} initial={pageProps.nhostSession}>
|
||||
<Component {...pageProps} />
|
||||
</NhostNextProvider>
|
||||
</NhostProvider>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -115,12 +115,12 @@ yarn add @nhost/react-apollo @apollo/client
|
||||
|
||||
### Initializing
|
||||
|
||||
Wrap the Next.js app with the `NhostApolloProvider` and make sure the `NhostApolloProvider` is nested inside the `NhostNextProvider`.
|
||||
Wrap the Next.js app with the `NhostApolloProvider` and make sure the `NhostApolloProvider` is nested inside the `NhostProvider`.
|
||||
|
||||
```jsx title=pages/_app.js
|
||||
import type { AppProps } from 'next/app'
|
||||
|
||||
import { NhostClient, NhostNextProvider } from '@nhost/nextjs'
|
||||
import { NhostClient, NhostProvider } from '@nhost/nextjs'
|
||||
import { NhostApolloProvider } from '@nhost/react-apollo'
|
||||
|
||||
const nhost = new NhostClient({
|
||||
@@ -130,11 +130,11 @@ const nhost = new NhostClient({
|
||||
|
||||
function MyApp({ Component, pageProps }: AppProps) {
|
||||
return (
|
||||
<NhostNextProvider nhost={nhost} initial={pageProps.nhostSession}>
|
||||
<NhostProvider nhost={nhost} initial={pageProps.nhostSession}>
|
||||
<NhostApolloProvider nhost={nhost}>
|
||||
<Component {...pageProps} />
|
||||
</NhostApolloProvider>
|
||||
</NhostNextProvider>
|
||||
</NhostProvider>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/nextjs",
|
||||
"version": "1.9.3",
|
||||
"version": "1.10.0",
|
||||
"description": "Nhost NextJS library",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -4,12 +4,19 @@ import {
|
||||
NhostClient as VanillaNhostClient,
|
||||
Subdomain
|
||||
} from '@nhost/nhost-js'
|
||||
import { NhostProvider } from '@nhost/react'
|
||||
|
||||
export * from './create-server-side-client'
|
||||
export * from './get-session'
|
||||
export type { NhostSession } from '@nhost/core'
|
||||
export * from '@nhost/react'
|
||||
export { NhostReactProvider as NhostNextProvider } from '@nhost/react'
|
||||
export { NhostProvider } from '@nhost/react'
|
||||
export * from './create-server-side-client'
|
||||
export * from './get-session'
|
||||
export { NhostNextProvider }
|
||||
|
||||
/**
|
||||
* @deprecated use `NhostProvider` instead
|
||||
*/
|
||||
const NhostNextProvider: typeof NhostProvider = NhostProvider
|
||||
|
||||
const isBrowser = typeof window !== 'undefined'
|
||||
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @nhost/react-apollo
|
||||
|
||||
## 4.10.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7f251111]
|
||||
- @nhost/react@0.16.0
|
||||
|
||||
## 4.9.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/react-apollo",
|
||||
"version": "4.9.2",
|
||||
"version": "4.10.0",
|
||||
"description": "Nhost React Apollo client",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @nhost/react
|
||||
|
||||
## 0.16.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 7f251111: Use `NhostProvider` instead of `NhostReactProvider` and `NhostNextProvider`
|
||||
|
||||
`NhostReactProvider` and `NhostNextProvider` are now deprecated
|
||||
|
||||
## 0.15.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nhost/react",
|
||||
"version": "0.15.2",
|
||||
"version": "0.16.0",
|
||||
"description": "Nhost React library",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
import produce from 'immer'
|
||||
import React, { createContext, PropsWithChildren, useEffect, useRef } from 'react'
|
||||
|
||||
import { AuthContext, NhostSession } from '@nhost/core'
|
||||
import { NhostClient } from '@nhost/nhost-js'
|
||||
import { useInterpret } from '@xstate/react'
|
||||
import produce from 'immer'
|
||||
import React, { createContext, PropsWithChildren, useEffect, useRef } from 'react'
|
||||
|
||||
export const NhostReactContext = createContext<NhostClient>({} as NhostClient)
|
||||
export interface NhostReactProviderProps {
|
||||
export interface NhostProviderProps {
|
||||
nhost: NhostClient
|
||||
initial?: NhostSession
|
||||
}
|
||||
|
||||
export const NhostReactProvider: React.FC<PropsWithChildren<NhostReactProviderProps>> = ({
|
||||
export const NhostProvider: React.FC<PropsWithChildren<NhostProviderProps>> = ({
|
||||
nhost,
|
||||
initial,
|
||||
...props
|
||||
@@ -44,3 +43,8 @@ export const NhostReactProvider: React.FC<PropsWithChildren<NhostReactProviderPr
|
||||
nhost.auth.client.interpreter = interpreter
|
||||
return <NhostReactContext.Provider value={nhost}>{props.children}</NhostReactContext.Provider>
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use `NhostProvider` instead
|
||||
*/
|
||||
export const NhostReactProvider = NhostProvider
|
||||
|
||||
27
pnpm-lock.yaml
generated
27
pnpm-lock.yaml
generated
@@ -3912,7 +3912,7 @@ packages:
|
||||
'@docusaurus/react-loadable': 5.5.2_react@17.0.2
|
||||
'@docusaurus/types': 2.2.0_sfoxds7t5ydpegc3knd667wn6m
|
||||
'@types/history': 4.7.11
|
||||
'@types/react': 18.0.25
|
||||
'@types/react': 18.0.26
|
||||
'@types/react-router-config': 5.0.6
|
||||
'@types/react-router-dom': 5.3.3
|
||||
react: 17.0.2
|
||||
@@ -4226,7 +4226,7 @@ packages:
|
||||
peerDependencies:
|
||||
react: '*'
|
||||
dependencies:
|
||||
'@types/react': 18.0.25
|
||||
'@types/react': 18.0.26
|
||||
prop-types: 15.8.1
|
||||
react: 17.0.2
|
||||
|
||||
@@ -4296,7 +4296,7 @@ packages:
|
||||
'@docusaurus/plugin-content-pages': 2.2.0_56jbash75ng5psbctf36wqywr4
|
||||
'@docusaurus/utils': 2.2.0_@docusaurus+types@2.2.0
|
||||
'@types/history': 4.7.11
|
||||
'@types/react': 18.0.25
|
||||
'@types/react': 18.0.26
|
||||
'@types/react-router-config': 5.0.6
|
||||
clsx: 1.2.1
|
||||
parse-numeric-range: 1.3.0
|
||||
@@ -4385,7 +4385,7 @@ packages:
|
||||
react-dom: ^16.8.4 || ^17.0.0
|
||||
dependencies:
|
||||
'@types/history': 4.7.11
|
||||
'@types/react': 18.0.25
|
||||
'@types/react': 18.0.26
|
||||
commander: 5.1.0
|
||||
joi: 17.6.0
|
||||
react: 17.0.2
|
||||
@@ -10021,39 +10021,39 @@ packages:
|
||||
/@types/react-is/17.0.3:
|
||||
resolution: {integrity: sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw==}
|
||||
dependencies:
|
||||
'@types/react': 18.0.25
|
||||
'@types/react': 18.0.26
|
||||
dev: false
|
||||
|
||||
/@types/react-router-config/5.0.6:
|
||||
resolution: {integrity: sha512-db1mx37a1EJDf1XeX8jJN7R3PZABmJQXR8r28yUjVMFSjkmnQo6X6pOEEmNl+Tp2gYQOGPdYbFIipBtdElZ3Yg==}
|
||||
dependencies:
|
||||
'@types/history': 4.7.11
|
||||
'@types/react': 18.0.25
|
||||
'@types/react': 18.0.26
|
||||
'@types/react-router': 5.1.18
|
||||
|
||||
/@types/react-router-dom/5.3.3:
|
||||
resolution: {integrity: sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==}
|
||||
dependencies:
|
||||
'@types/history': 4.7.11
|
||||
'@types/react': 18.0.25
|
||||
'@types/react': 18.0.26
|
||||
'@types/react-router': 5.1.18
|
||||
|
||||
/@types/react-router/5.1.18:
|
||||
resolution: {integrity: sha512-YYknwy0D0iOwKQgz9v8nOzt2J6l4gouBmDnWqUUznltOTaon+r8US8ky8HvN0tXvc38U9m6z/t2RsVsnd1zM0g==}
|
||||
dependencies:
|
||||
'@types/history': 4.7.11
|
||||
'@types/react': 18.0.25
|
||||
'@types/react': 18.0.26
|
||||
|
||||
/@types/react-table/7.7.12:
|
||||
resolution: {integrity: sha512-bRUent+NR/WwtDGwI/BqhZ8XnHghwHw0HUKeohzB5xN3K2qKWYE5w19e7GCuOkL1CXD9Gi1HFy7TIm2AvgWUHg==}
|
||||
dependencies:
|
||||
'@types/react': 18.0.25
|
||||
'@types/react': 18.0.26
|
||||
dev: true
|
||||
|
||||
/@types/react-transition-group/4.4.5:
|
||||
resolution: {integrity: sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==}
|
||||
dependencies:
|
||||
'@types/react': 18.0.25
|
||||
'@types/react': 18.0.26
|
||||
dev: false
|
||||
|
||||
/@types/react/18.0.25:
|
||||
@@ -10063,6 +10063,13 @@ packages:
|
||||
'@types/scheduler': 0.16.2
|
||||
csstype: 3.1.1
|
||||
|
||||
/@types/react/18.0.26:
|
||||
resolution: {integrity: sha512-hCR3PJQsAIXyxhTNSiDFY//LhnMZWpNNr5etoCqx/iUfGc5gXWtQR2Phl908jVR6uPXacojQWTg4qRpkxTuGug==}
|
||||
dependencies:
|
||||
'@types/prop-types': 15.7.5
|
||||
'@types/scheduler': 0.16.2
|
||||
csstype: 3.1.1
|
||||
|
||||
/@types/responselike/1.0.0:
|
||||
resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==}
|
||||
dependencies:
|
||||
|
||||
Reference in New Issue
Block a user