feat: add removable reference feature vertical slice

This commit is contained in:
donghyeon-ka
2026-07-26 14:56:34 +09:00
parent 980981bc86
commit c11be43f20
87 changed files with 1881 additions and 1114 deletions
+6 -2
View File
@@ -16,7 +16,8 @@ import { createApplication } from "../application/create-application.js";
* release: Release
* }): Promise<{
* outputPorts: OutputPorts,
* infrastructure: Infrastructure
* infrastructure: Infrastructure,
* featureInputs?: Readonly<Record<string, unknown>>
* }>
* }} factories
* @returns {Promise<Readonly<{
@@ -30,7 +31,10 @@ export async function createCompositionRoot(factories) {
const config = await factories.loadConfig();
const release = await factories.loadRelease(config);
const adapters = await factories.createAdapters({ config, release });
const application = createApplication(adapters.outputPorts);
const application = createApplication(
adapters.outputPorts,
adapters.featureInputs,
);
return Object.freeze({
config,
+15 -1
View File
@@ -10,6 +10,7 @@ import {
import { createBrowserStorageAdapter } from "../adapters/storage/browser-storage-adapter.js";
import { createTelemetryAdapter } from "../adapters/telemetry/best-effort-telemetry.js";
import { fetchReleaseManifest } from "./load-release-manifest.js";
import { createInstalledFeatureInputs } from "../features/installed-feature-adapters.js";
/**
* @param {Record<string, unknown>} host
@@ -54,7 +55,7 @@ function storageOrUndefined(value) {
* scheduler?: Parameters<typeof createHttpClient>[0]["scheduler"]
* }} context
*/
export function createRuntimeHttpClient(context) {
export function createRuntimeHttpClient(context, contract = {}) {
return createHttpClient({
baseUrl: context.runtime.config.API_BASE_URL,
timeoutMs: context.runtime.config.REQUEST_TIMEOUT_MS,
@@ -63,6 +64,7 @@ export function createRuntimeHttpClient(context) {
fetcher: context.fetcher,
clock: context.clock,
scheduler: context.scheduler,
...contract,
});
}
@@ -116,6 +118,17 @@ export async function createRuntimeAdapters(context) {
location.reload();
},
});
const featureInputs = createInstalledFeatureInputs({
createHttpClient: (contract) =>
createRuntimeHttpClient(
{
runtime: context.runtime,
authSession,
fetcher: context.fetcher,
},
contract,
),
});
return Object.freeze({
outputPorts: Object.freeze({
@@ -128,5 +141,6 @@ export async function createRuntimeAdapters(context) {
infrastructure: Object.freeze({
queryClient,
}),
featureInputs,
});
}