Skip to content

Commit 0113b81

Browse files
authored
chore: delete references to used shared to prevent memory leaks (#2347)
1 parent 08740a0 commit 0113b81

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+776
-21
lines changed

.changeset/tender-falcons-brush.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@module-federation/enhanced': patch
3+
'@module-federation/managers': patch
4+
'@module-federation/runtime': patch
5+
'@module-federation/rspack': patch
6+
---
7+
8+
chore: delete references to used shared to prevent memory leaks

.github/workflows/build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@ jobs:
7777
run: pnpm run app:manifest:dev & echo "done" && npx wait-on tcp:3009 && npx wait-on tcp:3012 && npx nx run-many --target=e2e --projects=3008-webpack-host --parallel=1 && lsof -ti tcp:3008,3009,3010,3011,3012 | xargs kill
7878

7979
- name: E2E Node Federation
80-
run: npx nx run-many --target=serve --projects=node-local-remote,node-remote --parallel=3 & echo "done" && sleep 25 && npx nx run-many --target=serve --projects=node-host & sleep 5 && npx wait-on tcp:3333 && npx nx run node-host-e2e:test:e2e
80+
run: npx nx run-many --target=serve --projects=node-local-remote,node-remote,node-dynamic-remote-new-version,node-dynamic-remote --parallel=10 & echo "done" && sleep 25 && npx nx run-many --target=serve --projects=node-host & sleep 5 && npx wait-on tcp:3333 && npx nx run node-host-e2e:test:e2e
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"presets": [
3+
[
4+
"@nx/react/babel",
5+
{
6+
"runtime": "automatic"
7+
}
8+
]
9+
],
10+
"plugins": []
11+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
}
17+
]
18+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: 'node-dynamic-remote-new-version',
4+
preset: '../../jest.preset.js',
5+
transform: {
6+
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
7+
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
8+
},
9+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
10+
coverageDirectory: '../../coverage/apps/node-dynamic-remote-new-version',
11+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "node-dynamic-remote-new-version",
3+
"private": true,
4+
"dependencies": {
5+
"@module-federation/node": "workspace:*",
6+
"lodash": "4.17.21"
7+
}
8+
}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
{
2+
"name": "node-dynamic-remote-new-version",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "apps/node-dynamic-remote-new-version/src",
5+
"projectType": "application",
6+
"targets": {
7+
"build": {
8+
"executor": "@nx/webpack:webpack",
9+
"outputs": ["{options.outputPath}"],
10+
"defaultConfiguration": "production",
11+
"options": {
12+
"compiler": "babel",
13+
"outputPath": "apps/node-dynamic-remote-new-version/dist",
14+
"index": "apps/node-dynamic-remote-new-version/src/index.html",
15+
"baseHref": "/",
16+
"main": "apps/node-dynamic-remote-new-version/src/main.tsx",
17+
"tsConfig": "apps/node-dynamic-remote-new-version/tsconfig.app.json",
18+
"assets": [],
19+
"styles": [],
20+
"scripts": [],
21+
"webpackConfig": "apps/node-dynamic-remote-new-version/webpack.config.js"
22+
},
23+
"configurations": {
24+
"development": {
25+
"extractLicenses": false,
26+
"optimization": false,
27+
"sourceMap": true,
28+
"vendorChunk": true
29+
},
30+
"production": {
31+
"fileReplacements": [
32+
{
33+
"replace": "apps/node-dynamic-remote-new-version/src/environments/environment.ts",
34+
"with": "apps/node-dynamic-remote-new-version/src/environments/environment.prod.ts"
35+
}
36+
],
37+
"optimization": true,
38+
"outputHashing": "all",
39+
"sourceMap": false,
40+
"namedChunks": false,
41+
"extractLicenses": true,
42+
"vendorChunk": false
43+
}
44+
},
45+
"dependsOn": [
46+
{
47+
"target": "build",
48+
"dependencies": true
49+
}
50+
]
51+
},
52+
"serve": {
53+
"executor": "@nx/webpack:dev-server",
54+
"dependsOn": [
55+
{
56+
"target": "build",
57+
"dependencies": true
58+
}
59+
],
60+
"defaultConfiguration": "development",
61+
"options": {
62+
"buildTarget": "node-dynamic-remote-new-version:build",
63+
"hmr": true,
64+
"port": 3007
65+
},
66+
"configurations": {
67+
"development": {
68+
"buildTarget": "node-dynamic-remote-new-version:build:development"
69+
},
70+
"production": {
71+
"buildTarget": "node-dynamic-remote-new-version:build:production",
72+
"hmr": false
73+
}
74+
}
75+
},
76+
"lint": {
77+
"executor": "@nx/linter:eslint",
78+
"outputs": ["{options.outputFile}"],
79+
"options": {
80+
"lintFilePatterns": [
81+
"apps/node-dynamic-remote-new-version/**/*.{ts,tsx,js,jsx}"
82+
]
83+
}
84+
},
85+
"test": {
86+
"executor": "@nx/jest:jest",
87+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
88+
"options": {
89+
"jestConfig": "apps/node-dynamic-remote-new-version/jest.config.ts",
90+
"passWithNoTests": true
91+
},
92+
"configurations": {
93+
"ci": {
94+
"ci": true,
95+
"codeCoverage": true
96+
}
97+
}
98+
}
99+
},
100+
"tags": []
101+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const environment = {
2+
production: true,
3+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// This file can be replaced during build by using the `fileReplacements` array.
2+
// When building for production, this file is replaced with `environment.prod.ts`.
3+
4+
export const environment = {
5+
production: false,
6+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const axios = require('axios');
2+
module.exports = function () {
3+
return `new version :${Object.keys(axios)}`;
4+
};

0 commit comments

Comments
 (0)