算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
Micro-Frontends【设计与创意】Implementing Module Federation for scaling frontend teams.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
%%{init: {"theme": "default", "flowchart": {"useMaxWidth": true}}}%%
graph TD
A[Host App Shell] --> B[Remote App 1: Auth]
A --> C[Remote App 2: Dashboard]
A --> D[Remote App 3: Checkout]
B -.-> E[Shared Libs e.g. React]
C -.-> E
D -.-> E
// webpack.config.js (Host)
const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');
module.exports = {
plugins: [
new ModuleFederationPlugin({
name: 'host',
remotes: {
app1: 'app1@http://localhost:3001/remoteEntry.js',
},
shared: { react: { singleton: true }, 'react-dom': { singleton: true } },
}),
],
};
import React, { Suspense } from 'react';
// Dynamically import the remote component
const RemoteButton = React.lazy(() => import('app1/Button'));
export default function App() {
return (
<div>
<h1>Host Application</h1>
<Suspense fallback={<div>Loading Remote Button...</div>}>
<RemoteButton />
</Suspense>
</div>
);
}