From e0fc39b67a8c32579f513f8dc548d07b1892a6ba Mon Sep 17 00:00:00 2001 From: Hendrik Liebau Date: Thu, 14 Mar 2024 20:41:58 +0100 Subject: [PATCH] Move `hydrateApp` to `@mfng/core/client/browser` This is imported from the client/browser entry, so it should be in `@mfng/core/client/browser`, and not in `@mfng/core/client`. The latter has modules that can used in both, the SSR and browser client. Since `Router` is also imported through the same barrel file, we can remove the `'use client'` directive from it. Continuation from #53 and #54 --- apps/aws-app/src/client.tsx | 2 +- apps/cloudflare-app/src/client.tsx | 2 +- apps/vercel-app/src/client.tsx | 2 +- packages/core/src/client/browser.ts | 1 + packages/core/src/client/index.ts | 1 - packages/core/src/client/router.tsx | 2 -- 6 files changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/aws-app/src/client.tsx b/apps/aws-app/src/client.tsx index e82437f..64bcbbc 100644 --- a/apps/aws-app/src/client.tsx +++ b/apps/aws-app/src/client.tsx @@ -1,4 +1,4 @@ -import {hydrateApp} from '@mfng/core/client'; +import {hydrateApp} from '@mfng/core/client/browser'; // eslint-disable-next-line import/no-extraneous-dependencies import 'tailwindcss/tailwind.css'; diff --git a/apps/cloudflare-app/src/client.tsx b/apps/cloudflare-app/src/client.tsx index e82437f..64bcbbc 100644 --- a/apps/cloudflare-app/src/client.tsx +++ b/apps/cloudflare-app/src/client.tsx @@ -1,4 +1,4 @@ -import {hydrateApp} from '@mfng/core/client'; +import {hydrateApp} from '@mfng/core/client/browser'; // eslint-disable-next-line import/no-extraneous-dependencies import 'tailwindcss/tailwind.css'; diff --git a/apps/vercel-app/src/client.tsx b/apps/vercel-app/src/client.tsx index e82437f..64bcbbc 100644 --- a/apps/vercel-app/src/client.tsx +++ b/apps/vercel-app/src/client.tsx @@ -1,4 +1,4 @@ -import {hydrateApp} from '@mfng/core/client'; +import {hydrateApp} from '@mfng/core/client/browser'; // eslint-disable-next-line import/no-extraneous-dependencies import 'tailwindcss/tailwind.css'; diff --git a/packages/core/src/client/browser.ts b/packages/core/src/client/browser.ts index 0630623..cb5d083 100644 --- a/packages/core/src/client/browser.ts +++ b/packages/core/src/client/browser.ts @@ -1,2 +1,3 @@ export * from './call-server.js'; +export * from './hydrate-app.js'; export * from './router.js'; diff --git a/packages/core/src/client/index.ts b/packages/core/src/client/index.ts index 6c5bb92..2d90346 100644 --- a/packages/core/src/client/index.ts +++ b/packages/core/src/client/index.ts @@ -1,3 +1,2 @@ -export * from './hydrate-app.js'; export * from './link.js'; export * from './use-router.js'; diff --git a/packages/core/src/client/router.tsx b/packages/core/src/client/router.tsx index 9d9f843..4a6ca50 100644 --- a/packages/core/src/client/router.tsx +++ b/packages/core/src/client/router.tsx @@ -1,5 +1,3 @@ -'use client'; - import * as React from 'react'; import type {RouterLocation} from '../use-router-location.js'; import {createUrl, createUrlPath} from './router-location-utils.js';