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 diff --git a/libs/native-federation-runtime/src/lib/init-federation.ts b/libs/native-federation-runtime/src/lib/init-federation.ts index cbcc8f99..466e6ba5 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 = {}, + o: {hostRemoteEntry:string|false} = {hostRemoteEntry:'./remoteEntry.json'} ): Promise { const remotes = typeof remotesOrManifestUrl === 'string' ? await loadManifest(remotesOrManifestUrl) : remotesOrManifestUrl; - const hostInfo = await loadFederationInfo('./remoteEntry.json'); + const hostInfo = await loadFederationInfo(o.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; } 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(