Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 21, 2026

Integrates latest ObjectStack packages to establish protocol conformance and enable native ObjectStack backend connectivity.

Dependencies

  • @object-ui/types@objectstack/spec@^0.1.2 (protocol foundation)
  • @object-ui/core@objectstack/client@^0.1.1 (runtime SDK)
  • @object-ui/data-objectql@objectstack/client@^0.1.1 (data adapter)

ObjectStack Adapter

New ObjectStackAdapter implements ObjectUI's DataSource interface with full protocol support:

import { createObjectStackAdapter } from '@object-ui/core';

const dataSource = createObjectStackAdapter({
  baseUrl: 'https://api.example.com',
  token: process.env.API_TOKEN
});

// Drop-in replacement for any DataSource
const users = await dataSource.find('users', {
  $filter: { status: 'active' },
  $orderby: { createdAt: 'desc' },
  $top: 20
});

Features:

  • CRUD operations: find, findOne, create, update, delete
  • Bulk operations: createMany, updateMany, deleteMany
  • Auto-discovery of server capabilities
  • OData-style → ObjectStack query translation
  • Full TypeScript typing

Build Configuration

Updated vite-plugin-dts to skip diagnostics for workspace dependencies, preventing TypeScript from traversing source files across package boundaries during builds.

Backward Compatibility

Zero breaking changes. ObjectStack integration is additive—existing code and data sources continue to work unchanged.

Original prompt

基于最新版本的@objectstack/client,@objectstack/spec,重构平台内核代码


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link

vercel bot commented Jan 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
objectui-docs Error Error Jan 21, 2026 1:33am
objectui-site Ready Ready Preview, Comment Jan 21, 2026 1:33am

Request Review

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor platform core code based on latest versions Integrate ObjectStack Protocol (spec@0.1.2, client@0.1.1) into platform core Jan 21, 2026
Copilot AI requested a review from hotlong January 21, 2026 00:26
@huangyiirene huangyiirene requested review from Copilot and removed request for hotlong January 21, 2026 01:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR integrates ObjectStack Protocol packages (@objectstack/spec@^0.1.2 and @objectstack/client@^0.1.1) into ObjectUI's core architecture, establishing protocol conformance and enabling native ObjectStack backend connectivity.

Changes:

  • Added ObjectStack dependencies to @object-ui/types, @object-ui/core, and @object-ui/data-objectql packages
  • Implemented new ObjectStackAdapter class that bridges the ObjectStack Client SDK with ObjectUI's DataSource interface
  • Updated build configuration to skip TypeScript diagnostics for workspace dependencies

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/types/package.json Added @objectstack/spec@^0.1.2 dependency
packages/types/README.md Updated version reference from 0.1.1 to 0.1.2
packages/plugin-kanban/vite.config.ts Added skipDiagnostics and test file exclusions to build config
packages/plugin-charts/vite.config.ts Added skipDiagnostics and test file exclusions to build config
packages/data-objectql/package.json Added @objectstack/client@^0.1.1 dependency
packages/core/src/index.ts Exported new adapters module
packages/core/src/adapters/objectstack-adapter.ts New ObjectStackAdapter implementation with CRUD and bulk operations
packages/core/src/adapters/index.ts Adapter module exports
packages/core/src/adapters/README.md Comprehensive documentation for ObjectStack adapter
packages/core/package.json Added ObjectStack client and spec dependencies
package.json Removed @objectstack/spec from pretest build filter
MIGRATION_GUIDE_OBJECTSTACK.md Complete migration guide for ObjectStack integration
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment on lines +129 to +130
const ids = data.map(item => (item as any).id).filter(Boolean);
await this.client.data.deleteMany(resource, ids);
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable name ids is used but the subsequent line doesn't return results matching the delete operation. Consider renaming to deletedIds for clarity about what these IDs represent.

Suggested change
const ids = data.map(item => (item as any).id).filter(Boolean);
await this.client.data.deleteMany(resource, ids);
const deletedIds = data.map(item => (item as any).id).filter(Boolean);
await this.client.data.deleteMany(resource, deletedIds);

Copilot uses AI. Check for mistakes.
Comment on lines 128 to 140
case 'delete':
const ids = data.map(item => (item as any).id).filter(Boolean);
await this.client.data.deleteMany(resource, ids);
return [];
case 'update':
// For update, we need to handle each record individually
// or use the batch update if all records get the same changes
const results = await Promise.all(
data.map(item =>
this.client.data.update<T>(resource, String((item as any).id), item)
)
);
return results;
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If any item in the bulk update array is missing an id field, this will produce a confusing error. Consider adding validation to provide a clear error message like 'Bulk update requires all items to have an id field'.

Suggested change
case 'delete':
const ids = data.map(item => (item as any).id).filter(Boolean);
await this.client.data.deleteMany(resource, ids);
return [];
case 'update':
// For update, we need to handle each record individually
// or use the batch update if all records get the same changes
const results = await Promise.all(
data.map(item =>
this.client.data.update<T>(resource, String((item as any).id), item)
)
);
return results;
case 'delete': {
const hasMissingId = data.some(item => (item as any).id == null);
if (hasMissingId) {
throw new Error('Bulk update requires all items to have an id field');
}
const ids = data.map(item => (item as any).id);
await this.client.data.deleteMany(resource, ids);
return [];
}
case 'update': {
const hasMissingId = data.some(item => (item as any).id == null);
if (hasMissingId) {
throw new Error('Bulk update requires all items to have an id field');
}
// For update, we need to handle each record individually
// or use the batch update if all records get the same changes
const results = await Promise.all(
data.map(item =>
this.client.data.update<T>(resource, String((item as any).id), item)
)
);
return results;
}

Copilot uses AI. Check for mistakes.
return record;
} catch (error) {
// If record not found, return null instead of throwing
if ((error as any)?.status === 404) {
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using (error as any) bypasses type safety. Consider defining a proper error type interface or checking for specific error properties in a type-safe manner.

Copilot uses AI. Check for mistakes.
total: result.count,
page: params?.$skip ? Math.floor(params.$skip / (params.$top || 20)) + 1 : 1,
pageSize: params?.$top,
hasMore: result.value.length === params?.$top,
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hasMore calculation is incorrect when params.$top is undefined. If no limit is specified, result.value.length === undefined will always be false. This should check if a limit was provided before comparing: hasMore: params?.$top ? result.value.length === params.$top : false

Suggested change
hasMore: result.value.length === params?.$top,
hasMore: params?.$top != null ? result.value.length === params.$top : false,

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

📦 Bundle Size Report

Package Size Gzipped
components (index.js) 1553.12KB 365.90KB
core (index.js) 0.49KB 0.26KB
data-objectql (ObjectQLDataSource.js) 12.09KB 2.84KB
data-objectql (hooks.js) 5.62KB 1.43KB
data-objectql (index.js) 0.62KB 0.36KB
designer (index.js) 1.46KB 0.51KB
plugin-charts (AdvancedChartImpl-DazADGz5.js) 74.89KB 15.82KB
plugin-charts (BarChart-CRc8MAtI.js) 551.60KB 127.51KB
plugin-charts (ChartImpl-DVw_7KEd.js) 3.17KB 1.10KB
plugin-charts (index-CdgY2AuM.js) 12.39KB 3.83KB
plugin-charts (index.js) 0.21KB 0.16KB
plugin-editor (MonacoImpl-B7ZgZJJG.js) 18.15KB 5.59KB
plugin-editor (index-Dl3HAAqu.js) 10.07KB 3.31KB
plugin-editor (index.js) 0.19KB 0.15KB
plugin-kanban (KanbanImpl-CUWM-JC-.js) 76.50KB 20.46KB
plugin-kanban (index-BV3FWhCb.js) 11.86KB 3.67KB
plugin-kanban (index.js) 0.18KB 0.15KB
plugin-markdown (MarkdownImpl-BRkYjVWf.js) 256.79KB 64.50KB
plugin-markdown (index-D_CdfEXQ.js) 9.59KB 3.16KB
plugin-markdown (index.js) 0.19KB 0.15KB
react (SchemaRenderer.js) 1.44KB 0.73KB
react (index.js) 0.32KB 0.23KB
react (index.test.js) 0.34KB 0.26KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 0.20KB 0.18KB
types (base.js) 0.20KB 0.18KB
types (complex.js) 0.20KB 0.18KB
types (crud.js) 0.20KB 0.18KB
types (data-display.js) 0.20KB 0.18KB
types (data.js) 0.20KB 0.18KB
types (disclosure.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (index.js) 0.34KB 0.25KB
types (layout.js) 0.20KB 0.18KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (registry.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@github-actions
Copy link

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

Copilot AI and others added 3 commits January 21, 2026 01:14
@github-actions
Copy link

📦 Bundle Size Report

Package Size Gzipped
components (index.js) 1553.12KB 365.90KB
core (index.js) 0.49KB 0.26KB
data-objectql (ObjectQLDataSource.js) 12.09KB 2.84KB
data-objectql (hooks.js) 5.62KB 1.43KB
data-objectql (index.js) 0.62KB 0.36KB
designer (index.js) 1.46KB 0.51KB
plugin-charts (AdvancedChartImpl-DazADGz5.js) 74.89KB 15.82KB
plugin-charts (BarChart-CRc8MAtI.js) 551.60KB 127.51KB
plugin-charts (ChartImpl-DVw_7KEd.js) 3.17KB 1.10KB
plugin-charts (index-CdgY2AuM.js) 12.39KB 3.83KB
plugin-charts (index.js) 0.21KB 0.16KB
plugin-editor (MonacoImpl-B7ZgZJJG.js) 18.15KB 5.59KB
plugin-editor (index-Dl3HAAqu.js) 10.07KB 3.31KB
plugin-editor (index.js) 0.19KB 0.15KB
plugin-kanban (KanbanImpl-CUWM-JC-.js) 76.50KB 20.46KB
plugin-kanban (index-BV3FWhCb.js) 11.86KB 3.67KB
plugin-kanban (index.js) 0.18KB 0.15KB
plugin-markdown (MarkdownImpl-BRkYjVWf.js) 256.79KB 64.50KB
plugin-markdown (index-D_CdfEXQ.js) 9.59KB 3.16KB
plugin-markdown (index.js) 0.19KB 0.15KB
react (SchemaRenderer.js) 1.44KB 0.73KB
react (index.js) 0.32KB 0.23KB
react (index.test.js) 0.34KB 0.26KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 0.20KB 0.18KB
types (base.js) 0.20KB 0.18KB
types (complex.js) 0.20KB 0.18KB
types (crud.js) 0.20KB 0.18KB
types (data-display.js) 0.20KB 0.18KB
types (data.js) 0.20KB 0.18KB
types (disclosure.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (index.js) 0.34KB 0.25KB
types (layout.js) 0.20KB 0.18KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (registry.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@github-actions
Copy link

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

@hotlong hotlong marked this pull request as ready for review January 21, 2026 02:26
@hotlong hotlong merged commit 6863e21 into main Jan 21, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants