From aa6f6dd36fb91a6b5587532575d05c9bdd12d4d5 Mon Sep 17 00:00:00 2001 From: Rainer Hahnekamp Date: Sun, 29 Sep 2024 01:42:12 +0200 Subject: [PATCH 1/4] docs: add template for GitHub Issues Issues can be created for three categories: - Bug Reports - Feature Requestion - General Question --- .github/ISSUE_TEMPLATE/bug-report.yml | 57 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature-request.yml | 37 ++++++++++++++ .github/ISSUE_TEMPLATE/question.yml | 23 +++++++++ 3 files changed, 117 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug-report.yml create mode 100644 .github/ISSUE_TEMPLATE/feature-request.yml create mode 100644 .github/ISSUE_TEMPLATE/question.yml diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 00000000..506282de --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,57 @@ +name: Bug Report +description: Report a bug or regression in functionality + +body: + - type: dropdown + id: affected-packages + attributes: + label: With what library do you have an issue? + options: + - native-federation + - module-federation + validations: + required: true + + - type: textarea + id: reproduction + attributes: + label: Reproduction of the bug/regression with instructions + description: If on Native Federation, use our [Stackblitz template](https://stackblitz.com/github/rainerhahnekamp/native-federation-stackblitz?file=projects%2Fhost%2Fsrc%2Fapp%2Fapp.routes.ts) to reproduce the issue + placeholder: If the bug/regression does not include a reproduction via StackBlitz or GitHub repo, your issue may be closed without resolution. + validations: + required: true + + - type: textarea + id: expected_behavior + attributes: + label: Expected behavior + description: Describe what the expected behavior would be. + validations: + required: true + + - type: textarea + id: version + attributes: + label: Versions of Native/Module Federation, Angular, Node, Browser, and operating system + placeholder: | + Native/Module Federation: + Angular: + Node: + Browser: + Operating system(s): + validations: + required: true + + - type: textarea + id: other + attributes: + label: Other information + + - type: checkboxes + id: assistance + attributes: + label: I would be willing to submit a PR to fix this issue + description: Assistance is provided if you need help submitting a pull request + options: + - label: 'Yes' + - label: 'No' diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 00000000..fd08ab2e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,37 @@ +name: Feature Request +description: Submit a Request For Consideration + +body: + - type: dropdown + id: affected-packages + attributes: + label: For which library do you have a feature request? + options: + - native-federation + - module-federation + - other + multiple: true + validations: + required: true + + - type: textarea + id: information + attributes: + label: Information + description: What feature would you like to see added? + validations: + required: true + + - type: textarea + id: alternatives + attributes: + label: Describe any alternatives/workarounds you're currently using + + - type: checkboxes + id: assistance + attributes: + label: I would be willing to submit a PR to fix this issue + description: Assistance is provided if you need help submitting a pull request + options: + - label: 'Yes' + - label: 'No' diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml new file mode 100644 index 00000000..fc9afc18 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -0,0 +1,23 @@ +name: Question / Help +description: Ask a question or request help + +body: + - type: dropdown + id: affected-packages + attributes: + label: For which library do you need help? + options: + - native-federation + - module-federation + - other + multiple: true + validations: + required: true + + - type: textarea + id: information + attributes: + label: Question + description: What do you need help with? + validations: + required: true From 6cecac9c6cf82300be333461a5b1e11defdf9320 Mon Sep 17 00:00:00 2001 From: Dmytro Vradii Date: Sun, 20 Oct 2024 16:20:58 +0300 Subject: [PATCH 2/4] fix ES target for shared libs --- libs/native-federation/src/utils/angular-esbuild-adapter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/native-federation/src/utils/angular-esbuild-adapter.ts b/libs/native-federation/src/utils/angular-esbuild-adapter.ts index 66939c14..3a7279f3 100644 --- a/libs/native-federation/src/utils/angular-esbuild-adapter.ts +++ b/libs/native-federation/src/utils/angular-esbuild-adapter.ts @@ -269,7 +269,7 @@ async function runEsbuild( splitting: kind === 'mapping-or-exposed', platform: 'browser', format: 'esm', - target: ['esnext'], + target: target, logLimit: kind === 'shared-package' ? 1 : 0, plugins: plugins || [ createCompilerPlugin( From ab748bab844932dbf3a26e9c87df07d205d61665 Mon Sep 17 00:00:00 2001 From: Auke van Oostenbrugge Date: Thu, 14 Nov 2024 07:28:22 +0000 Subject: [PATCH 3/4] Fix: runtime crash with non-JS routing (like static HTML apps or SSR apps). --- .../native-federation-runtime/src/lib/init-federation.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libs/native-federation-runtime/src/lib/init-federation.ts b/libs/native-federation-runtime/src/lib/init-federation.ts index cbcc8f99..cb450ac0 100644 --- a/libs/native-federation-runtime/src/lib/init-federation.ts +++ b/libs/native-federation-runtime/src/lib/init-federation.ts @@ -11,14 +11,15 @@ import { appendImportMap } from './utils/add-import-map'; import { FederationInfo } from './model/federation-info'; export async function initFederation( - remotesOrManifestUrl: Record | string = {} + remotesOrManifestUrl: Record | string = {}, + hostRemoteEntry: string|false = './remoteEntry.json' ): Promise { const remotes = typeof remotesOrManifestUrl === 'string' ? await loadManifest(remotesOrManifestUrl) : remotesOrManifestUrl; - const hostInfo = await loadFederationInfo('./remoteEntry.json'); + const hostInfo = await loadFederationInfo(hostRemoteEntry); const hostImportMap = await processHostInfo(hostInfo); const remotesImportMap = await processRemoteInfos(remotes); @@ -87,7 +88,9 @@ function createRemoteImportMap( return { imports, scopes }; } -async function loadFederationInfo(url: string): Promise { +async function loadFederationInfo(url: string|false): Promise { + if(!url) return {name: "host", exposes: [], shared: []}; + const info = (await fetch(url).then((r) => r.json())) as FederationInfo; return info; } From 46161ba5a84af2890eb17e4e154169a13ce0a887 Mon Sep 17 00:00:00 2001 From: Auke van Oostenbrugge Date: Thu, 14 Nov 2024 07:48:02 +0000 Subject: [PATCH 4/4] Updated hostRemoteEntry to optional object property for initFederation to promote extension --- libs/native-federation-runtime/src/lib/init-federation.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/native-federation-runtime/src/lib/init-federation.ts b/libs/native-federation-runtime/src/lib/init-federation.ts index cb450ac0..466e6ba5 100644 --- a/libs/native-federation-runtime/src/lib/init-federation.ts +++ b/libs/native-federation-runtime/src/lib/init-federation.ts @@ -12,14 +12,14 @@ import { FederationInfo } from './model/federation-info'; export async function initFederation( remotesOrManifestUrl: Record | string = {}, - hostRemoteEntry: string|false = './remoteEntry.json' + o: {hostRemoteEntry:string|false} = {hostRemoteEntry:'./remoteEntry.json'} ): Promise { const remotes = typeof remotesOrManifestUrl === 'string' ? await loadManifest(remotesOrManifestUrl) : remotesOrManifestUrl; - const hostInfo = await loadFederationInfo(hostRemoteEntry); + const hostInfo = await loadFederationInfo(o.hostRemoteEntry); const hostImportMap = await processHostInfo(hostInfo); const remotesImportMap = await processRemoteInfos(remotes);