Skip to content

Remove react from root package json #3888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: share-filter
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/3000-home/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
9 changes: 6 additions & 3 deletions apps/3000-home/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
"@ant-design/cssinjs": "^1.21.0",
"antd": "5.19.1",
"lodash": "4.17.21",
"next": "14.2.16",
"react": "18.3.1"
"next": "15.3.5",
"react": "19.0.0",
"react-dom": "19.0.0"
},
"devDependencies": {
"@module-federation/nextjs-mf": "workspace:*",
"@module-federation/runtime": "workspace:*",
"@module-federation/utilities": "workspace:*"
"@module-federation/utilities": "workspace:*",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2"
},
"scripts": {
"start": "next start",
Expand Down
2 changes: 1 addition & 1 deletion apps/3001-shop/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
9 changes: 6 additions & 3 deletions apps/3001-shop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
"@ant-design/cssinjs": "^1.21.0",
"antd": "5.19.1",
"lodash": "4.17.21",
"next": "14.2.16",
"react": "18.3.1"
"next": "15.3.5",
"react": "19.0.0",
"react-dom": "19.0.0"
},
"devDependencies": {
"@module-federation/nextjs-mf": "workspace:*",
"@module-federation/runtime": "workspace:*",
"@module-federation/sdk": "workspace:*",
"@module-federation/utilities": "workspace:*"
"@module-federation/utilities": "workspace:*",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2"
},
"scripts": {
"start": "next start",
Expand Down
2 changes: 1 addition & 1 deletion apps/3002-checkout/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
9 changes: 6 additions & 3 deletions apps/3002-checkout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
"@ant-design/cssinjs": "^1.21.0",
"antd": "5.19.1",
"lodash": "4.17.21",
"next": "14.2.16",
"react": "18.3.1"
"next": "15.3.5",
"react": "19.0.0",
"react-dom": "19.0.0"
},
"devDependencies": {
"@module-federation/nextjs-mf": "workspace:*",
"@module-federation/runtime": "workspace:*",
"@module-federation/sdk": "workspace:*",
"@module-federation/utilities": "workspace:*"
"@module-federation/utilities": "workspace:*",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2"
},
"scripts": {
"start": "next start",
Expand Down
2 changes: 2 additions & 0 deletions apps/esbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"@module-federation/runtime": "workspace:*",
"@module-federation/webpack-bundler-runtime": "workspace:*",
"@types/node": "^18.7.13",
"@types/react": "18.3.11",
"@types/react-dom": "18.3.0",
"concurrently": "^8.2.2",
"esbuild": "^0.25.0",
"json5": "^2.2.1",
Expand Down
8 changes: 6 additions & 2 deletions apps/manifest-demo/3009-webpack-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
"@module-federation/enhanced": "workspace:*",
"@module-federation/typescript": "workspace:*",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
"react-refresh": "0.14.2"
"react-refresh": "0.14.2",
"@types/react": "18.3.11",
"@types/react-dom": "18.3.0"
},
"dependencies": {
"antd": "4.24.14"
"antd": "4.24.14",
"react": "18.3.1",
"react-dom": "18.3.1"
}
}
6 changes: 5 additions & 1 deletion apps/manifest-demo/3010-rspack-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
"react-refresh": "0.14.2",
"@rspack/plugin-react-refresh": "^0.7.5",
"@rspack/core": "^1.0.2"
"@rspack/core": "^1.0.2",
"@types/react": "18.3.11",
"@types/react-dom": "18.3.0"
},
"dependencies": {
"antd": "4.24.15",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "^6.23.1"
}
}
8 changes: 6 additions & 2 deletions apps/manifest-demo/3011-rspack-manifest-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@
"@module-federation/enhanced": "workspace:*",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
"react-refresh": "0.14.2",
"@rspack/plugin-react-refresh": "^0.7.5"
"@rspack/plugin-react-refresh": "^0.7.5",
"@types/react": "18.3.11",
"@types/react-dom": "18.3.0"
},
"dependencies": {
"lodash": "4.17.21",
"antd": "4.24.15"
"antd": "4.24.15",
"react": "18.3.1",
"react-dom": "18.3.1"
}
}
8 changes: 6 additions & 2 deletions apps/manifest-demo/3012-rspack-js-entry-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@
"@module-federation/enhanced": "workspace:*",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
"react-refresh": "0.14.2",
"@rspack/plugin-react-refresh": "^0.7.5"
"@rspack/plugin-react-refresh": "^0.7.5",
"@types/react": "18.3.11",
"@types/react-dom": "18.3.0"
},
"dependencies": {
"lodash": "4.17.21",
"antd": "4.24.15"
"antd": "4.24.15",
"react": "18.3.1",
"react-dom": "18.3.1"
}
}
7 changes: 6 additions & 1 deletion apps/manifest-demo/webpack-host/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
"@module-federation/typescript": "workspace:*",
"@module-federation/enhanced": "workspace:*",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
"@types/react": "18.3.11",
"@types/react-dom": "18.3.0",
"react-refresh": "0.14.2"
},
"dependencies": {
"antd": "4.24.15"
"antd": "4.24.15",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.26.2"
}
}
Original file line number Diff line number Diff line change
@@ -1,47 +1,15 @@
'use client';

import { useCounter } from './counter-context';
import React from 'react';
import { Boundary } from '#/ui/boundary';
import dynamic from 'next/dynamic';
const Button = dynamic(() => import('remote_4001/Button'), { ssr: true });
import Button from '#/ui/button';

const ContextClickCounter = () => {
const [count, setCount] = useCounter();
export default function ContextClickCounter() {
const [count, setCount] = React.useState(0);

return (
<Boundary
labels={['Counter Context [Client Component]']}
color="blue"
size="small"
animateRerendering={false}
>
<Button>testing</Button>
<button
onClick={() => setCount(count + 1)}
className="rounded-lg bg-gray-700 px-3 py-1 text-sm font-medium tabular-nums text-gray-100 hover:bg-gray-500 hover:text-white"
>
{count} Clicks
</button>
</Boundary>
<div className="space-y-4">
<p>Count: {count}</p>
<Button onClick={() => setCount(count + 1)}>Increment</Button>
</div>
);
};

export const Counter = () => {
const [count] = useCounter();

return (
<Boundary
labels={['Counter Context [Client Component]']}
color="blue"
size="small"
animateRerendering={false}
>
<div className="span text-xl font-bold text-white">
<span className="tabular-nums">{count}</span> Clicks
</div>
</Boundary>
);
};

export default ContextClickCounter;
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
'use client';

import { Boundary } from '#/ui/boundary';
import Button from 'remote_4001/Button';
import React from 'react';

export default function Error({ error, reset }: any) {
React.useEffect(() => {
console.log('logging error:', error);
}, [error]);
import Button from '#/ui/button';

export default function Error({
error,
reset,
}: {
error: Error;
reset: () => void;
}) {
return (
<Boundary
labels={['./[categorySlug]/[subCategorySlug]/error.tsx']}
color="pink"
>
<div className="space-y-4">
<h2 className="text-lg font-bold">Error</h2>
<p className="text-sm">{error?.message}</p>
<div>
<Button onClick={() => reset()}>Try Again</Button>
</div>
</div>
</Boundary>
<div className="prose prose-sm prose-invert max-w-none">
<h1 className="text-lg font-bold">Sub-category Error!</h1>
<Button onClick={() => reset()}>Try again</Button>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
'use client';

import { Boundary } from '#/ui/boundary';
import Button from 'remote_4001/Button';
import React from 'react';

export default function Error({ error, reset }: any) {
React.useEffect(() => {
console.log('logging error:', error);
}, [error]);
import Button from '#/ui/button';

export default function Error({
error,
reset,
}: {
error: Error;
reset: () => void;
}) {
return (
<Boundary labels={['./[categorySlug]/error.tsx']} color="pink">
<div className="space-y-4">
<h2 className="text-lg font-bold">Error</h2>
<p className="text-sm">{error?.message}</p>
<div>
<Button onClick={() => reset()}>Try Again</Button>
</div>
</div>
</Boundary>
<div className="prose prose-sm prose-invert max-w-none">
<h1 className="text-lg font-bold">Category Error!</h1>
<Button onClick={() => reset()}>Try again</Button>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
'use client';

import { Boundary } from '#/ui/boundary';
import Button from 'remote_4001/Button';
import React from 'react';

export default function Error({ error, reset }: any) {
React.useEffect(() => {
console.log('logging error:', error);
}, [error]);
import Button from '#/ui/button';

export default function Error({
error,
reset,
}: {
error: Error;
reset: () => void;
}) {
return (
<Boundary labels={['./error.tsx']} color="pink">
<div className="space-y-4">
<h2 className="text-lg font-bold">Error</h2>
<p className="text-sm">{error?.message}</p>
<div>
<Button onClick={() => reset()}>Try Again</Button>
</div>
</div>
</Boundary>
<div className="prose prose-sm prose-invert max-w-none">
<h1 className="text-lg font-bold">Something went wrong!</h1>
<Button onClick={() => reset()}>Try again</Button>
</div>
);
}
11 changes: 9 additions & 2 deletions apps/next-app-router/next-app-router-4000/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { demos } from '#/lib/demos';
import Link from 'next/link';
import dynamic from 'next/dynamic';
const Button = dynamic(() => import('remote_4001/Button'), { ssr: true });

// Simple local Button component since Module Federation isn't supported with App Router
function Button({ children }: { children: React.ReactNode }) {
return (
<button className="rounded bg-blue-600 px-4 py-2 text-white hover:bg-blue-700">
{children}
</button>
);
}

export default function Page() {
return (
Expand Down
15 changes: 15 additions & 0 deletions apps/next-app-router/next-app-router-4000/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
import { defineConfig } from 'cypress';

export default defineConfig({
projectId: '27e40c91-5ac3-4433-8a87-651d10f51cf6',
e2e: {
...nxE2EPreset(__filename, { cypressDir: 'cypress' }),
baseUrl: 'http://localhost:4000',
},
defaultCommandTimeout: 20000,
retries: {
runMode: 2,
openMode: 1,
},
});
Loading