Skip to content

Commit

Permalink
Merge branch 'main' into fork/fyodorovandrei/upgrade-package-deps-to-…
Browse files Browse the repository at this point in the history
…allow-to-use-new-api

# Conflicts:
#	packages/storybook-addon/package.json
  • Loading branch information
ScriptedAlchemy committed Jan 1, 2025
2 parents 0c7481d + eda5184 commit 0197c22
Show file tree
Hide file tree
Showing 212 changed files with 5,745 additions and 2,857 deletions.
7 changes: 7 additions & 0 deletions .changeset/ai-hungry-cat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@module-federation/enhanced": patch
---

Reordered the "import" and "require" fields in export mappings for consistency.

```
3 changes: 2 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"@module-federation/retry-plugin",
"@module-federation/data-prefetch",
"@module-federation/rsbuild-plugin",
"@module-federation/error-codes"
"@module-federation/error-codes",
"@module-federation/inject-external-runtime-core-plugin"
]
],
"ignorePatterns": ["^alpha|^beta"],
Expand Down
5 changes: 0 additions & 5 deletions .changeset/lucky-shirts-listen.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/shaggy-flowers-cry.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/smart-crabs-burn.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/sour-carpets-walk.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/twelve-pumpkins-film.md

This file was deleted.

87 changes: 73 additions & 14 deletions .cursorignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,75 @@
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
./tmp
./scripts
./.git
packages/storybook-addon
packages/core
packages/utilities
packages/typescript
# Cache and temporary files
**/.cache/
**/.temp/
**/coverage/
**/dist/

# Documentation and config files
**/*.md
**/*.yaml
**/*.yml
**/.eslintrc*
**/.prettierrc*
**/.swcrc
**/jest.config.*
**/tsconfig.*
**/*/stats.json

# First ignore everything
*

# Then allow specific packages and their contents
!packages/webpack-bundler-runtime/
!packages/webpack-bundler-runtime/**/*
!packages/sdk/
!packages/sdk/**/*
!packages/enhanced/
!packages/enhanced/**/*

# Allow package.json files
!package.json
!packages/*/package.json
!**/package.json

# Explicitly ignore specific packages
packages/dts-plugin/
packages/typescript/
packages/native-*
apps
**/configCases
**/dist
apps/**
*.snap
*.js
packages/core/
packages/assemble-release-plan/
packages/native-federation-typescript/
packages/esbuild/

# Ignore specific directories
apps/
webpack/tooling/
webpack/setup/
webpack/test/
webpack/benchmark/
tools/
.husky/
.github/
.vscode/
.verdaccio/

# Ignore specific files
.cursorignore
jest.preset.js
babel.config.json
nx.json
LICENSE
.nxignore
netlify.toml
renovate.json
.npmrc
.cursorrules
.prettierignore
.editorconfig
ai-lint-fix.js
manifest.json
typedoc.json
typedoc.base.json
commitlint.config.js
.eslintignore
commit-gen.js
main.py
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ body:
label: Validations
description: Before submitting the issue, please make sure you do the following
options:
- label: Read the [Contributing Guidelines](https://github.com/module-federation/core/blob/canary/CONTRIBUTING.md).
- label: Read the [Contributing Guidelines](https://github.com/module-federation/core/blob/main/CONTRIBUTING.md).
required: true
- label: Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
required: true
14 changes: 14 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ jobs:
- name: Run Build for All
run: npx nx run-many --targets=build --projects=tag:type:pkg --skip-nx-cache

- name: Check Package Publishing Compatibility
run: |
for pkg in packages/*; do
if [ -f "$pkg/package.json" ] && \
[ "$pkg" != "packages/assemble-release-plan" ] && \
[ "$pkg" != "packages/chrome-devtools" ] && \
[ "$pkg" != "packages/core" ] && \
[ "$pkg" != "packages/esbuild" ] && \
[ "$pkg" != "packages/utilities" ]; then
echo "Checking $pkg..."
npx publint "$pkg"
fi
done
- name: Run Affected Test
uses: nick-fields/retry@v3
with:
Expand Down
3 changes: 3 additions & 0 deletions apps/manifest-demo/3009-webpack-provider/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ module.exports = composePlugins(
requiredVersion: '^18.3.1',
},
},
experiments: {
externalRuntime: true,
},
}),
);

Expand Down
3 changes: 3 additions & 0 deletions apps/manifest-demo/3010-rspack-provider/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ module.exports = composePlugins(
},
},
dataPrefetch: true,
experiments: {
externalRuntime: true,
},
}),
);
(config.devServer = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ module.exports = composePlugins(
requiredVersion: '^18.3.1',
},
},
experiments: {
externalRuntime: true,
},
}),
);
(config.devServer = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ module.exports = composePlugins(
},
},
manifest: false,
experiments: {
externalRuntime: true,
},
}),
);
(config.devServer = {
Expand Down
50 changes: 0 additions & 50 deletions apps/manifest-demo/webpack-host/src/bootstrap.tsx

This file was deleted.

9 changes: 5 additions & 4 deletions apps/manifest-demo/webpack-host/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ module.exports = composePlugins(withNx(), withReact(), (config, context) => {
'modern-js-provider': 'app1@http://127.0.0.1:4001/mf-manifest.json',
},
filename: 'remoteEntry.js',
exposes: {
'./Button': './src/Button.tsx',
},
shared: {
lodash: {},
antd: {},
Expand All @@ -47,8 +44,12 @@ module.exports = composePlugins(withNx(), withReact(), (config, context) => {
},
},
dataPrefetch: true,
experiments: { federationRuntime: 'hoisted' },
// experiments: { federationRuntime: 'hoisted' },
runtimePlugins: [path.join(__dirname, './runtimePlugin.ts')],
experiments: {
provideExternalRuntime: true,
federationRuntime: 'hoisted',
},
}),
);

Expand Down
8 changes: 8 additions & 0 deletions apps/modernjs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @module-federation/modernjsapp

## 0.1.78

### Patch Changes

- Updated dependencies [f573ad0]
- Updated dependencies [336f3d8]
- @module-federation/enhanced@0.8.7

## 0.1.77

### 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.77",
"version": "0.1.78",
"scripts": {
"reset": "npx rimraf ./**/node_modules",
"dev": "modern dev",
Expand Down
8 changes: 8 additions & 0 deletions apps/website-new/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# website-new

## 1.0.20

### Patch Changes

- Updated dependencies [336f3d8]
- Updated dependencies [4fd33fb]
- @module-federation/error-codes@0.8.7

## 1.0.19

### Patch Changes
Expand Down
19 changes: 19 additions & 0 deletions apps/website-new/docs/en/configure/experiments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,22 @@ There should be no "eager consumption" errors possible, as the initialization of
Instead of federation runtime initilizing in the entrypoint code, it is initialized in a RuntimeModule, within the webpack runtime.
This allows module federation to be avaliable ahead of time, thus enabling "Async Startup" capabilities etc.

## externalRuntime

- Type: `boolean`
- Required: No
- Default: `false`

After setting `true`, the external MF runtime will be used and the runtime provided by the consumer will be used. (Please make sure your consumer has `provideExternalRuntime: true` set, otherwise it will not run properly!)

## provideExternalRuntime

- Type: `boolean`
- Required: No
- Default: `false`

::: warning note
Make sure to only configure it on the topmost consumer! If multiple consumers inject runtime at the same time, the ones executed later will not overwrite the existing runtime.
:::

Setting `true` will inject the MF runtime at the consumer.
2 changes: 1 addition & 1 deletion apps/website-new/docs/en/configure/shared.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ new ModuleFederationPlugin({

- Type: `boolean`
- Required: No
- Default: `true`
- Default: `false`

Whether to allow only one version of the shared module within the shared scope (singleton mode).

Expand Down
2 changes: 1 addition & 1 deletion apps/website-new/docs/en/guide/start/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Module Federation is an architectural pattern for the decentralization of JavaSc

Module Federation has the following features:

- ⚡ Code sharingDependency reuse
- ⚡ Code sharing, Dependency reuse
- 📝 Manifest
- 🎨 [Module Federation Runtime](../basic/runtime.mdx)
- 🧩 [Runtime Plugins System](../../plugin/dev/index.mdx)
Expand Down
5 changes: 5 additions & 0 deletions apps/website-new/docs/zh/configure/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,10 @@
"type": "file",
"name": "shareStrategy",
"label": "shareStrategy"
},
{
"type": "file",
"name": "experiments",
"label": "experiments"
}
]
Loading

0 comments on commit 0197c22

Please sign in to comment.