Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(module-federation): turn dts off by default #27198 #27403

Merged
merged 7 commits into from
Aug 14, 2024
Merged
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
6 changes: 6 additions & 0 deletions packages/angular/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,12 @@
},
"description": "Update the @angular/cli package version to ~18.1.0.",
"factory": "./src/migrations/update-19-5-0/update-angular-cli"
},
"update-19-6-0": {
"cli": "nx",
"version": "19.6.0-beta.4",
"description": "Ensure Module Federation DTS is turned off by default.",
"factory": "./src/migrations/update-19-6-0/turn-off-dts-by-default"
}
},
"packageJsonUpdates": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,12 @@ exports[`Host App Generator --ssr should generate the correct files 6`] = `
exports[`Host App Generator --ssr should generate the correct files 7`] = `
"const { withModuleFederationForSSR } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederationForSSR(config);
/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
module.exports = withModuleFederationForSSR(config, { dts: false });
"
`;

Expand Down Expand Up @@ -438,7 +443,12 @@ exports[`Host App Generator --ssr should generate the correct files for standalo
exports[`Host App Generator --ssr should generate the correct files for standalone 6`] = `
"const { withModuleFederationForSSR } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederationForSSR(config);
/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
module.exports = withModuleFederationForSSR(config, { dts: false });
"
`;

Expand Down Expand Up @@ -653,7 +663,12 @@ exports[`Host App Generator --ssr should generate the correct files for standalo
"import { withModuleFederationForSSR } from '@nx/angular/module-federation';
import config from './module-federation.config';

export default withModuleFederationForSSR(config);
/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
export default withModuleFederationForSSR(config, { dts: false });
"
`;

Expand Down Expand Up @@ -883,7 +898,12 @@ exports[`Host App Generator --ssr should generate the correct files when --types
"import { withModuleFederationForSSR } from '@nx/angular/module-federation';
import config from './module-federation.config';

export default withModuleFederationForSSR(config);
/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
export default withModuleFederationForSSR(config, { dts: false });
"
`;

Expand Down Expand Up @@ -948,45 +968,78 @@ exports[`Host App Generator --ssr should generate the correct files when --types
exports[`Host App Generator should generate a host app with a remote 1`] = `
"const { withModuleFederation } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederation(config);

/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
module.exports = withModuleFederation(config, { dts: false });
"
`;

exports[`Host App Generator should generate a host app with a remote 2`] = `
"const { withModuleFederation } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederation(config);

/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
module.exports = withModuleFederation(config, { dts: false });
"
`;

exports[`Host App Generator should generate a host app with a remote when --typesscript=true 1`] = `
"import { withModuleFederation } from '@nx/angular/module-federation';
import config from './module-federation.config';

export default withModuleFederation(config);
/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
export default withModuleFederation(config, { dts: false });
"
`;

exports[`Host App Generator should generate a host app with a remote when --typesscript=true 2`] = `
"import { withModuleFederation } from '@nx/angular/module-federation';
import config from './module-federation.config';

export default withModuleFederation(config);
/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
export default withModuleFederation(config, { dts: false });
"
`;

exports[`Host App Generator should generate a host app with no remotes 1`] = `
"const { withModuleFederation } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederation(config);

/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
module.exports = withModuleFederation(config, { dts: false });
"
`;

exports[`Host App Generator should generate a host app with no remotes when --typescript=true 1`] = `
"import { withModuleFederation } from '@nx/angular/module-federation';
import config from './module-federation.config';

export default withModuleFederation(config);
/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
export default withModuleFederation(config, { dts: false });
"
`;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
const { withModuleFederationForSSR } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederationForSSR(config)
/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
module.exports = withModuleFederationForSSR(config, { dts: false });
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { withModuleFederationForSSR } from '@nx/angular/module-federation';
import config from './module-federation.config';

export default withModuleFederationForSSR(config);
/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
export default withModuleFederationForSSR(config, { dts: false });
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,13 @@ exports[`MF Remote App Generator --ssr should generate the correct files 6`] = `
exports[`MF Remote App Generator --ssr should generate the correct files 7`] = `
"const { withModuleFederationForSSR } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederationForSSR(config);

/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
module.exports = withModuleFederationForSSR(config, { dts: false });
"
`;

Expand Down Expand Up @@ -443,7 +449,12 @@ exports[`MF Remote App Generator --ssr should generate the correct files when --
"import { withModuleFederationForSSR } from '@nx/angular/module-federation';
import config from './module-federation.config';

export default withModuleFederationForSSR(config);
/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
export default withModuleFederationForSSR(config, { dts: false });
"
`;

Expand Down Expand Up @@ -525,45 +536,78 @@ exports[`MF Remote App Generator --ssr should generate the correct files when --
exports[`MF Remote App Generator should generate a remote mf app with a host 1`] = `
"const { withModuleFederation } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederation(config);

/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
module.exports = withModuleFederation(config, { dts: false });
"
`;

exports[`MF Remote App Generator should generate a remote mf app with a host 2`] = `
"const { withModuleFederation } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederation(config);

/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
module.exports = withModuleFederation(config, { dts: false });
"
`;

exports[`MF Remote App Generator should generate a remote mf app with a host when --typescriptConfiguration=true 1`] = `
"import { withModuleFederation } from '@nx/angular/module-federation';
import config from './module-federation.config';

export default withModuleFederation(config);
/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
export default withModuleFederation(config, { dts: false });
"
`;

exports[`MF Remote App Generator should generate a remote mf app with a host when --typescriptConfiguration=true 2`] = `
"import { withModuleFederation } from '@nx/angular/module-federation';
import config from './module-federation.config';

export default withModuleFederation(config);
/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
export default withModuleFederation(config, { dts: false });
"
`;

exports[`MF Remote App Generator should generate a remote mf app with no host 1`] = `
"const { withModuleFederation } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederation(config);

/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
module.exports = withModuleFederation(config, { dts: false });
"
`;

exports[`MF Remote App Generator should generate a remote mf app with no host when --typescriptConfiguration=true 1`] = `
"import { withModuleFederation } from '@nx/angular/module-federation';
import config from './module-federation.config';

export default withModuleFederation(config);
/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
export default withModuleFederation(config, { dts: false });
"
`;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { withModuleFederationForSSR } from '@nx/angular/module-federation';
import config from './module-federation.config';

export default withModuleFederationForSSR(config);
/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
export default withModuleFederationForSSR(config, { dts: false });
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
const { withModuleFederationForSSR } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederationForSSR(config)

/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
module.exports = withModuleFederationForSSR(config, { dts: false })
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,13 @@ export const appRoutes: Route[] = [
exports[`Init MF should create webpack and mf configs correctly 1`] = `
"const { withModuleFederation } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederation(config);

/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
module.exports = withModuleFederation(config, { dts: false });
"
`;

Expand All @@ -224,7 +230,13 @@ exports[`Init MF should create webpack and mf configs correctly 2`] = `
exports[`Init MF should create webpack and mf configs correctly 3`] = `
"const { withModuleFederation } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederation(config);

/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
module.exports = withModuleFederation(config, { dts: false });
"
`;

Expand All @@ -242,7 +254,12 @@ exports[`Init MF should create webpack and mf configs correctly when --typescrip
"import { withModuleFederation } from '@nx/angular/module-federation';
import config from './module-federation.config';

export default withModuleFederation(config);
/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
export default withModuleFederation(config, { dts: false });
"
`;

Expand Down Expand Up @@ -274,7 +291,12 @@ exports[`Init MF should create webpack and mf configs correctly when --typescrip
"import { withModuleFederation } from '@nx/angular/module-federation';
import config from './module-federation.config';

export default withModuleFederation(config);
/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
export default withModuleFederation(config, { dts: false });
"
`;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { withModuleFederation } from '@nx/angular/module-federation';
import config from './module-federation.config';

export default withModuleFederation(config);
/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
export default withModuleFederation(config, { dts: false });
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { withModuleFederation } from '@nx/angular/module-federation';
import config from './module-federation.config';

/**
* DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
* The DTS Plugin can be enabled by setting dts: true
* Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
*/
export default withModuleFederation({
...config,
/*
Expand All @@ -13,4 +18,4 @@ export default withModuleFederation({
* ['app2', 'https://app2.example.com'],
* ]
*/
});
}, { dts: false });
Loading