Skip to content

Commit 68c0f18

Browse files
committed
refactor(HttpDispatcher): replace broker calls with direct service dispatch for data operations
- Introduced a new method `callData` to handle data service operations (create, get, update, delete, query, batch) directly. - Removed legacy broker calls from various methods, enhancing service resolution and error handling. - Updated metadata handling to prioritize service resolution over broker calls, improving modularity and maintainability. - Cleaned up code by removing unnecessary logging and legacy fallback mechanisms.
1 parent 431747b commit 68c0f18

File tree

10 files changed

+303
-1052
lines changed

10 files changed

+303
-1052
lines changed

apps/server/lib/create-broker-shim.ts

Lines changed: 0 additions & 309 deletions
This file was deleted.

apps/server/server/index.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import { AutomationServicePlugin } from '@objectstack/service-automation';
2525
import { AnalyticsServicePlugin } from '@objectstack/service-analytics';
2626
import { getRequestListener } from '@hono/node-server';
2727
import type { Hono } from 'hono';
28-
import { createBrokerShim } from '../lib/create-broker-shim.js';
2928
import CrmApp from '@example/app-crm';
3029
import TodoApp from '@example/app-todo';
3130
import BiPluginManifest from '@example/plugin-bi';
@@ -111,17 +110,8 @@ async function ensureKernel(): Promise<ObjectKernel> {
111110
await kernel.use(new AutomationServicePlugin());
112111
await kernel.use(new AnalyticsServicePlugin());
113112

114-
// Broker shim — bridges HttpDispatcher → ObjectQL engine
115-
(kernel as any).broker = createBrokerShim(kernel);
116-
117113
await kernel.bootstrap();
118114

119-
// Validate broker attachment
120-
if (!(kernel as any).broker) {
121-
console.warn('[Vercel] Broker shim lost during bootstrap — reattaching.');
122-
(kernel as any).broker = createBrokerShim(kernel);
123-
}
124-
125115
_kernel = kernel;
126116
console.log('[Vercel] Kernel ready.');
127117
return kernel;

apps/studio/server/index.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import { AutomationServicePlugin } from '@objectstack/service-automation';
3737
import { AnalyticsServicePlugin } from '@objectstack/service-analytics';
3838
import { getRequestListener } from '@hono/node-server';
3939
import type { Hono } from 'hono';
40-
import { createBrokerShim } from '../src/lib/create-broker-shim.js';
4140
import studioConfig from '../objectstack.config.js';
4241

4342
// ---------------------------------------------------------------------------
@@ -134,17 +133,8 @@ async function ensureKernel(): Promise<ObjectKernel> {
134133
await kernel.use(new AutomationServicePlugin());
135134
await kernel.use(new AnalyticsServicePlugin());
136135

137-
// Broker shim — bridges HttpDispatcher → ObjectQL engine
138-
(kernel as any).broker = createBrokerShim(kernel);
139-
140136
await kernel.bootstrap();
141137

142-
// Validate broker attachment
143-
if (!(kernel as any).broker) {
144-
console.warn('[Vercel] Broker shim lost during bootstrap — reattaching.');
145-
(kernel as any).broker = createBrokerShim(kernel);
146-
}
147-
148138
// Seed data from config (non-fatal — the kernel is usable without seed data)
149139
try {
150140
await seedData(kernel, [studioConfig]);

0 commit comments

Comments
 (0)