From f4ecfbf013928d0f5546874c152e0b385aa3d506 Mon Sep 17 00:00:00 2001 From: ScriptedAlchemy Date: Tue, 21 Jan 2025 09:35:24 -0800 Subject: [PATCH] feat(nextjs-mf): update module share for rsc --- .../app/context/context-click-counter.tsx | 3 + .../[subCategorySlug]/error.tsx | 2 +- .../error-handling/[categorySlug]/error.tsx | 2 +- .../app/error-handling/error.tsx | 2 +- apps/next-app-router-4000/app/layout.tsx | 4 +- apps/next-app-router-4000/ui/buggy-button.tsx | 2 +- apps/next-app-router-4001/next.config.js | 8 +- .../src/lib/sharing/ConsumeSharedPlugin.ts | 5 +- .../src/lib/sharing/ProvideSharedPlugin.ts | 6 +- .../configCases/layers/9-layers-full/App.js | 12 ++ .../layers/9-layers-full/ComponentA.js | 5 + .../configCases/layers/9-layers-full/index.js | 12 ++ .../layers/9-layers-full/layerImport.js | 3 + .../9-layers-full/node_modules/react/index.js | 4 + .../9-layers-full/node_modules/react/other.js | 1 + .../node_modules/react/package.json | 4 + .../layers/9-layers-full/package.json | 12 ++ .../layers/9-layers-full/test.config.js | 6 + .../layers/9-layers-full/webpack.config.js | 87 ++++++++++++++ packages/nextjs-mf/src/internal.ts | 109 ++++++++---------- 20 files changed, 216 insertions(+), 73 deletions(-) create mode 100644 packages/enhanced/test/configCases/layers/9-layers-full/App.js create mode 100644 packages/enhanced/test/configCases/layers/9-layers-full/ComponentA.js create mode 100644 packages/enhanced/test/configCases/layers/9-layers-full/index.js create mode 100644 packages/enhanced/test/configCases/layers/9-layers-full/layerImport.js create mode 100644 packages/enhanced/test/configCases/layers/9-layers-full/node_modules/react/index.js create mode 100644 packages/enhanced/test/configCases/layers/9-layers-full/node_modules/react/other.js create mode 100644 packages/enhanced/test/configCases/layers/9-layers-full/node_modules/react/package.json create mode 100644 packages/enhanced/test/configCases/layers/9-layers-full/package.json create mode 100644 packages/enhanced/test/configCases/layers/9-layers-full/test.config.js create mode 100644 packages/enhanced/test/configCases/layers/9-layers-full/webpack.config.js diff --git a/apps/next-app-router-4000/app/context/context-click-counter.tsx b/apps/next-app-router-4000/app/context/context-click-counter.tsx index 0a36ee3aae..a59be8aeb2 100644 --- a/apps/next-app-router-4000/app/context/context-click-counter.tsx +++ b/apps/next-app-router-4000/app/context/context-click-counter.tsx @@ -3,6 +3,8 @@ 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 }); const ContextClickCounter = () => { const [count, setCount] = useCounter(); @@ -14,6 +16,7 @@ const ContextClickCounter = () => { size="small" animateRerendering={false} > +