Skip to content

Commit

Permalink
feat: (#591) limiting root @faustjs/next exports to those needed by c…
Browse files Browse the repository at this point in the history
…lient
  • Loading branch information
wjohnsto committed Oct 22, 2021
1 parent b1ba602 commit 7f2a760
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/next/src/components/HeadlessProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export function HeadlessProvider<Props = Record<string, unknown>>({
useHydrateCache,
auth: { useHydrateCache: useAuthHydrateCache },
} = client;
const cacheSnapshot = pageProps[CLIENT_CACHE_PROP];
const authSnapshot = pageProps[AUTH_CLIENT_CACHE_PROP];
const cacheSnapshot = pageProps?.[CLIENT_CACHE_PROP];
const authSnapshot = pageProps?.[AUTH_CLIENT_CACHE_PROP];

useHydrateCache({
cacheSnapshot: isNil(cacheSnapshot) ? undefined : cacheSnapshot,
Expand Down
19 changes: 12 additions & 7 deletions packages/next/src/export/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
export * from '../gqty/client';
export * from '../config/config';
export * from '../server/getProps';
export * from '../components/HeadlessProvider';
export * from '../utils';
export * from '../config/withFaust';
export * from '../log/log';
export { Config, WithFaustConfig, config, withFaust } from '../config';
export { getClient, NextClient } from '../gqty';
export { logQueries } from '../log';
export {
GetNextServerSidePropsConfig,
GetNextStaticPropsConfig,
Is404Config,
getNextServerSideProps,
getNextStaticProps,
is404,
} from '../server';
export { HeadlessProvider } from '../components';

0 comments on commit 7f2a760

Please sign in to comment.