Skip to content

Commit

Permalink
chore: merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
danpeen committed Dec 27, 2024
2 parents df9adea + 5675773 commit ef040e3
Show file tree
Hide file tree
Showing 133 changed files with 3,299 additions and 732 deletions.
5 changes: 5 additions & 0 deletions .changeset/lucky-shirts-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/sdk': patch
---

chore: bump logger
6 changes: 0 additions & 6 deletions .changeset/real-otters-explode.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/twelve-pumpkins-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/bridge-react': patch
---

feat: support basename passed by remote module props
15 changes: 9 additions & 6 deletions .cursorignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
./tmp
./scripts
./.git
./packages/storybook-addon
./packages/core
./packages/utilities
./packages/typescript
./packages/native-*
./apps
packages/storybook-addon
packages/core
packages/utilities
packages/typescript
packages/native-*
apps
**/configCases
**/dist
apps/**
*.snap
*.js

11 changes: 0 additions & 11 deletions .github/dependabot.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,54 +16,11 @@ on:
description: 'Release Branch (confirm release branch)'
required: true
default: 'main'
issue_comment:
types: [created]

permissions:
id-token: write

jobs:
issue_comment:
name: Release with comment
if: github.event.issue.pull_request && contains(github.event.comment.body, '!canary')
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 1
ref: refs/pull/${{ github.event.issue.number }}/head

- name: Install Pnpm
run: corepack enable

- name: Setup Node.js 18
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'

- name: Install deps
run: pnpm install

- name: Build Packages
run: pnpm run build:pkg

- name: Release
uses: module-federation/actions@v2
with:
version: 'next'
type: 'release'
branch: ''
tools: 'changeset'
env:
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
REPOSITORY: ${{ github.repository }}
PULL_REQUEST_NUMBER: ${{ github.event.issue.number }}
COMMENT: ${{ toJson(github.event.comment) }}

release:
name: Release
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
Expand Down
2 changes: 1 addition & 1 deletion apps/3000-home/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@ant-design/cssinjs": "^1.21.0",
"antd": "5.19.1",
"lodash": "4.17.21",
"next": "14.2.10",
"next": "14.2.16",
"react": "18.3.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion apps/3001-shop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@ant-design/cssinjs": "^1.21.0",
"antd": "5.19.1",
"lodash": "4.17.21",
"next": "14.2.10",
"next": "14.2.16",
"react": "18.3.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion apps/3002-checkout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@ant-design/cssinjs": "^1.21.0",
"antd": "5.19.1",
"lodash": "4.17.21",
"next": "14.2.10",
"next": "14.2.16",
"react": "18.3.1"
},
"devDependencies": {
Expand Down
21 changes: 17 additions & 4 deletions apps/manifest-demo/3010-rspack-provider/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module.exports = composePlugins(
transform: {
react: {
runtime: 'automatic',
refresh: true,
},
},
},
Expand All @@ -60,6 +61,18 @@ module.exports = composePlugins(
// publicPath must be specific url
config.output.publicPath = 'http://localhost:3010/';

const rspackPlugin = config.plugins.find((plugin) => {
return plugin.name === 'HtmlRspackPlugin';
});

if (rspackPlugin && rspackPlugin._args && rspackPlugin._args[0]) {
rspackPlugin._args[0].excludeChunks = ['rspack_provider'];
} else {
console.warn(
'HtmlRspackPlugin not found or has unexpected structure. Skipping excludeChunks configuration.',
);
}

config.plugins.push(
new ModuleFederationPlugin({
name: 'rspack_provider',
Expand All @@ -70,10 +83,10 @@ module.exports = composePlugins(
shared: {
lodash: {},
antd: {},
'react/': {
singleton: true,
requiredVersion: '^18.3.1',
},
// 'react/': {
// singleton: true,
// requiredVersion: '^18.3.1',
// },
react: {
singleton: true,
requiredVersion: '^18.3.1',
Expand Down
24 changes: 24 additions & 0 deletions apps/modernjs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# @module-federation/modernjsapp

## 0.1.77

### Patch Changes

- @module-federation/enhanced@0.8.6

## 0.1.76

### Patch Changes

- @module-federation/enhanced@0.8.5

## 0.1.75

### Patch Changes

- @module-federation/enhanced@0.8.4

## 0.1.74

### Patch Changes

- @module-federation/enhanced@0.8.3

## 0.1.73

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/modernjs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@module-federation/modernjsapp",
"private": true,
"version": "0.1.73",
"version": "0.1.77",
"scripts": {
"reset": "npx rimraf ./**/node_modules",
"dev": "modern dev",
Expand Down
2 changes: 2 additions & 0 deletions apps/react-ts-host/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ module.exports = composePlugins(
withNx(),
withReact(),
async (config, context) => {
config.devServer = config.devServer || {};
config.devServer.host = '127.0.0.1';
// prevent cyclic updates
config.watchOptions = {
ignored: ['**/node_modules/**', '**/@mf-types/**'],
Expand Down
4 changes: 4 additions & 0 deletions apps/react-ts-nested-remote/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ module.exports = composePlugins(
withNx(),
withReact(),
async (config, context) => {
if (!config.devServer) {
config.devServer = {};
}
config.devServer.host = '127.0.0.1';
config.output.publicPath = 'http://localhost:3005/';
// prevent cyclic updates
config.watchOptions = {
Expand Down
1 change: 1 addition & 0 deletions apps/react-ts-remote/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ module.exports = composePlugins(
client: {
overlay: false,
},
host: '127.0.0.1',
port: 3004,
devMiddleware: {
writeToDisk: true,
Expand Down
4 changes: 4 additions & 0 deletions apps/react-ts-remote/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ module.exports = composePlugins(
withNx(),
withReact(),
async (config, context) => {
if (!config.devServer) {
config.devServer = {};
}
config.devServer.host = '127.0.0.1';
const baseConfig = {
name: 'react_ts_remote',
filename: 'remoteEntry.js',
Expand Down
4 changes: 3 additions & 1 deletion apps/router-demo/router-host-2000/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ const App = () => {
<Route path="/detail/*" Component={Detail} />
<Route
path="/remote1/*"
Component={() => <Remote1App name={'Ming'} age={12} ref={ref} />}
Component={() => (
<Remote1App name={'Ming'} age={12} ref={ref} basename="/remote1" />
)}
/>
<Route
path="/remote2/*"
Expand Down
2 changes: 1 addition & 1 deletion apps/rslib-module/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const config: StorybookConfig = {
options: {
remotes: {
'rslib-module':
'rslib-module@http://localhost:3001/mf/mf-manifest.json',
'rslib_provider@http://localhost:3001/mf-manifest.json',
},
},
},
Expand Down
5 changes: 3 additions & 2 deletions apps/rslib-module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"types": "./dist/cjs/index.d.ts",
"scripts": {
"build": "rslib build",
"dev": "rslib mf dev",
"dev": "rslib mf-dev",
"build:watch": "rslib build --watch",
"serve": "pnpm build && http-server -p 3001 ./dist/ --cors",
"storybook": "storybook dev -p 6006"
},
Expand All @@ -22,7 +23,7 @@
"@module-federation/rsbuild-plugin": "workspace:*",
"@module-federation/storybook-addon": "workspace:*",
"@rsbuild/plugin-react": "^1.0.6",
"@rslib/core": "^0.0.18",
"@rslib/core": "0.2.0",
"@types/react": "^18.3.11",
"http-server": "^14.1.1",
"react": "^18.3.1",
Expand Down
40 changes: 17 additions & 23 deletions apps/rslib-module/rslib.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,27 @@ export default defineConfig({
distPath: {
root: './dist/mf',
},
assetPrefix: 'http://localhost:3000/mf',
minify: true,
},
dev: {
assetPrefix: 'http://localhost:3001/mf',
},
// just for dev
server: {
port: 3001,
},
plugins: [
pluginModuleFederation({
name: 'rslib_provider',
exposes: {
'.': './src/index.tsx',
},
shared: {
react: {
singleton: true,
},
'react-dom': {
singleton: true,
},
},
}),
],
},
],
plugins: [pluginReact()],
plugins: [
pluginReact(),
pluginModuleFederation({
name: 'rslib_provider',
exposes: {
'.': './src/index.tsx',
},
shared: {
react: {
singleton: true,
},
'react-dom': {
singleton: true,
},
},
}),
],
});
24 changes: 24 additions & 0 deletions apps/website-new/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# website-new

## 1.0.19

### Patch Changes

- @module-federation/error-codes@0.8.6

## 1.0.18

### Patch Changes

- @module-federation/error-codes@0.8.5

## 1.0.17

### Patch Changes

- @module-federation/error-codes@0.8.4

## 1.0.16

### Patch Changes

- @module-federation/error-codes@0.8.3

## 1.0.15

### Patch Changes
Expand Down
Loading

0 comments on commit ef040e3

Please sign in to comment.