-
Notifications
You must be signed in to change notification settings - Fork 9
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
Showing
13 changed files
with
131 additions
and
113 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,8 +1,15 @@ | ||
import '@quilted/quilt/globals'; | ||
import {hydrateRoot} from 'react-dom/client'; | ||
import {Browser, BrowserContext} from '@quilted/quilt/browser'; | ||
|
||
import {App} from './App.tsx'; | ||
|
||
const element = document.querySelector('#app')!; | ||
const browser = new Browser(); | ||
|
||
hydrateRoot(element, <App />); | ||
hydrateRoot( | ||
element, | ||
<BrowserContext browser={browser}> | ||
<App /> | ||
</BrowserContext>, | ||
); |
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 |
---|---|---|
@@ -1,13 +1,21 @@ | ||
import '@quilted/quilt/globals'; | ||
|
||
import {hydrateRoot} from 'react-dom/client'; | ||
import {QueryClient} from '@tanstack/react-query'; | ||
import {createGraphQLFetch} from '@quilted/quilt/graphql'; | ||
import {Browser, BrowserContext} from '@quilted/quilt/browser'; | ||
|
||
import {App} from './App.tsx'; | ||
|
||
const element = document.querySelector('#app')!; | ||
const browser = new Browser(); | ||
|
||
const queryClient = new QueryClient(); | ||
const fetchGraphQL = createGraphQLFetch({url: '/api/graphql'}); | ||
|
||
hydrateRoot( | ||
element, | ||
<App fetchGraphQL={createGraphQLFetch({url: '/api/graphql'})} />, | ||
<BrowserContext browser={browser}> | ||
<App context={{fetchGraphQL, queryClient}} /> | ||
</BrowserContext>, | ||
); |
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
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,11 @@ | ||
import type {GraphQLFetch} from '@quilted/quilt/graphql'; | ||
import type {QueryClient} from '@tanstack/react-query'; | ||
|
||
declare module '~/shared/context.ts' { | ||
interface AppContext { | ||
queryClient: QueryClient; | ||
fetchGraphQL: GraphQLFetch; | ||
} | ||
} | ||
|
||
export {}; |
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 |
---|---|---|
@@ -1,15 +1,24 @@ | ||
import '@quilted/quilt/globals'; | ||
import {hydrateRoot} from 'react-dom/client'; | ||
import {httpBatchLink} from '@trpc/client'; | ||
import {QueryClient} from '@tanstack/react-query'; | ||
import {Browser, BrowserContext} from '@quilted/quilt/browser'; | ||
|
||
import {trpc} from '~/shared/trpc.ts'; | ||
|
||
import {App} from './App.tsx'; | ||
|
||
const element = document.querySelector('#app')!; | ||
const browser = new Browser(); | ||
|
||
const queryClient = new QueryClient(); | ||
const trpcClient = trpc.createClient({ | ||
links: [httpBatchLink({url: new URL('/api', window.location.href).href})], | ||
}); | ||
|
||
hydrateRoot(element, <App trpc={trpcClient} />); | ||
hydrateRoot( | ||
element, | ||
<BrowserContext browser={browser}> | ||
<App context={{trpc: trpcClient, queryClient}} /> | ||
</BrowserContext>, | ||
); |
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
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
Oops, something went wrong.