Skip to content
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
9 changes: 5 additions & 4 deletions examples/turbo-rspack-mf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ npx create-turbo@latest --example https://github.com/swalker326/ze-starter-turbo
```bash
pnpm install
```

2. **Development mode**
2. **Zephyr Setup**
Update all the occurences of `zephyr:turbo_host@*` to be `zephyr:turbo_host.[your_project_name].[your_organiztion]@*` where your `your_project_name` and `your_organization` are from zephyr cloud
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good observation, but this only necessary if the user split this project into separate repositories or organizations even.

If the boilerplate comes from create-zephyr-apps CLI this shouldn't be a problem.

Could you please expand on how or if you ran into some issues with this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no correlation that connects the error I was having to that specific part of the README.
It was more of a nuance that I think is important to have in the README, it is probably better to just outright remove it since it is very unlikely for it to cause an issue.

What do you think?

3. **Development mode**
```bash
pnpm dev
```
Expand All @@ -43,7 +44,7 @@ npx create-turbo@latest --example https://github.com/swalker326/ze-starter-turbo
- **Home**: http://localhost:3001 (remote micro-frontend)
- **Settings**: http://localhost:3002 (remote micro-frontend)

3. **Build for production**
4. **Build for production**
```bash
pnpm build
```
Expand All @@ -53,7 +54,7 @@ npx create-turbo@latest --example https://github.com/swalker326/ze-starter-turbo
turbo build
```

4. **Other commands**
5. **Other commands**
```bash
pnpm lint # Lint all packages
pnpm check # Run Biome checks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ export const mfConfig: ModuleFederationPluginOptions = {
remotes: {
turbo_host: "turbo_host@http://localhost:3000/remoteEntry.js"
},
shared: ["react", "react-dom", "react-router"]
shared: ["react", "react-dom", "react-router", "react-router-dom"]
};
1 change: 1 addition & 0 deletions examples/turbo-rspack-mf/apps/home/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router": "^6.30.0",
"react-router-dom": "^6.30.0",
"tailwindcss": "catalog:tailwind3",
"zephyr-rspack-plugin": "catalog:zephyr"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/turbo-rspack-mf/apps/home/rspack.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { rspack } from "@rspack/core";
import * as RefreshPlugin from "@rspack/plugin-react-refresh";
import { ReactRefreshRspackPlugin } from "@rspack/plugin-react-refresh";
import { withZephyr } from "zephyr-rspack-plugin";
import { mfConfig } from "./module-federation.config";

Expand Down Expand Up @@ -61,7 +61,7 @@ export default withZephyr()({
new rspack.HtmlRspackPlugin({
template: "./index.html"
}),
isDev ? new RefreshPlugin() : null,
isDev ? new ReactRefreshRspackPlugin() : null,
new rspack.container.ModuleFederationPlugin(mfConfig)
].filter(Boolean),
optimization: {
Expand Down
2 changes: 1 addition & 1 deletion examples/turbo-rspack-mf/apps/home/src/RemoteEntry.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Cloud, Book, Link2Icon } from 'lucide-react';
import { Link } from 'react-router';
import { Link } from 'react-router-dom';

function RemoteEntry() {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ export const mfConfig: ModuleFederationPluginOptions = {
exposes: {
"./RemoteEntry": "./src/App.tsx"
},
shared: ["react", "react-dom", "react-router"]
shared: ["react", "react-dom", "react-router", "react-router-dom"]
};
1 change: 1 addition & 0 deletions examples/turbo-rspack-mf/apps/host/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router": "^6.30.0",
"react-router-dom": "^6.30.0",
"tailwindcss": "catalog:tailwind3",
"zephyr-rspack-plugin": "catalog:zephyr"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/turbo-rspack-mf/apps/host/rspack.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { rspack } from "@rspack/core";
import * as RefreshPlugin from "@rspack/plugin-react-refresh";
import { ReactRefreshRspackPlugin } from "@rspack/plugin-react-refresh";
import { withZephyr } from "zephyr-rspack-plugin";
import { mfConfig } from "./module-federation.config";

Expand Down Expand Up @@ -61,7 +61,7 @@ export default withZephyr()({
new rspack.HtmlRspackPlugin({
template: "./index.html"
}),
isDev ? new RefreshPlugin() : null,
isDev ? new ReactRefreshRspackPlugin() : null,
new rspack.container.ModuleFederationPlugin(mfConfig)
].filter(Boolean),
optimization: {
Expand Down
2 changes: 1 addition & 1 deletion examples/turbo-rspack-mf/apps/host/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Settings from 'turbo_settings/RemoteEntry';
import Home from 'turbo_home/RemoteEntry';
import { BrowserRouter, Route, Routes } from 'react-router';
import { BrowserRouter, Route, Routes } from 'react-router-dom';
import AppLayout from './components/AppLayout';
import { useLocalStorage } from './useLocalStorage';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Cloud, Github, Menu, X } from 'lucide-react';
import React from 'react';
import { Link } from 'react-router';
import { Link } from 'react-router-dom';
import { useLocalStorage } from '../useLocalStorage';

export function Header() {
Expand Down
4 changes: 2 additions & 2 deletions examples/turbo-rspack-mf/apps/host/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"extends": ["//"],
"tasks": {
"build": {
"dependsOn": ["settings#build", "home#build"],
"dependsOn": ["turbo_settings#build", "turbo_home#build"],
"inputs": ["$TURBO_DEFAULT$", ".env*"],
"outputs": [".next/**", "!.next/cache/**"]
"outputs": [".next/**", "!.next/cache/**", "dist/**"]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ export const mfConfig: ModuleFederationPluginOptions = {
remotes: {
turbo_host: "turbo_host@http://localhost:3000/remoteEntry.js"
},
shared: ["react", "react-dom", "react-router"]
shared: ["react", "react-dom", "react-router", "react-router-dom"]
};
1 change: 1 addition & 0 deletions examples/turbo-rspack-mf/apps/settings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router": "^6.30.0",
"react-router-dom": "^6.30.0",
"tailwindcss": "catalog:tailwind3",
"zephyr-rspack-plugin": "catalog:zephyr"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/turbo-rspack-mf/apps/settings/rspack.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from "@rspack/cli";
import { rspack } from "@rspack/core";
import * as RefreshPlugin from "@rspack/plugin-react-refresh";
import { ReactRefreshRspackPlugin } from "@rspack/plugin-react-refresh";
import { withZephyr } from "zephyr-rspack-plugin";
import { mfConfig } from "./module-federation.config";

Expand Down Expand Up @@ -61,7 +61,7 @@ export default withZephyr()({
new rspack.HtmlRspackPlugin({
template: "./index.html"
}),
isDev ? new RefreshPlugin() : null,
isDev ? new ReactRefreshRspackPlugin() : null,
new rspack.container.ModuleFederationPlugin(mfConfig)
].filter(Boolean),
optimization: {
Expand Down
2 changes: 1 addition & 1 deletion examples/turbo-rspack-mf/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"build": {
"dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", ".env*"],
"outputs": [".next/**", "!.next/cache/**"],
"outputs": [".next/**", "!.next/cache/**", "dist/**"],
"env": ["ZE_API", "ZE_API_GATE", "DEBUG"]
},
"lint": {
Expand Down
Loading