Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

Integrates the MSW (Mock Service Worker) plugin runtime from app-crm into Storybook, enabling ObjectGrid and ObjectForm stories to fetch data from a fully-initialized ObjectStack kernel instead of using static fixtures.

Changes

MSW Runtime Setup

  • .storybook/msw-browser.ts: ObjectStack kernel initialization with ObjectQLPlugin, DriverPlugin, AppPlugin, and MSWPlugin. Seeds CRM data (contacts, opportunities) from manifest.
  • .storybook/preview.ts: Starts MSW runtime on Storybook initialization
  • .storybook/datasource.ts: Factory function for ObjectStackAdapter connecting to /api/v1

Story Updates

  • object-grid.stories.tsx: Added ContactsGrid and OpportunitiesGrid using provider: "object" data configuration
  • object-form.stories.tsx: Added ContactForm and OpportunityForm

Configuration

  • Added ObjectStack runtime dependencies: @objectstack/core, @objectstack/driver-memory, @objectstack/objectql, @objectstack/runtime
  • Vite aliases for @storybook-config and @object-ui/data-objectstack resolution

Example

// Stories now use MSW-backed DataSource instead of static data
const dataSource = createStorybookDataSource();

export const ContactsGrid: Story = {
  render: (args) => (
    <SchemaRendererProvider dataSource={dataSource}>
      <SchemaRenderer schema={args} />
    </SchemaRendererProvider>
  ),
  args: {
    type: 'object-grid',
    objectName: 'contact',
    data: {
      provider: 'object',
      object: 'contact',
    },
  },
};

Screenshot

Storybook with MSW Integration

New stories with MSW-backed data sources visible in sidebar. Data configuration shows provider: "object" indicating runtime integration.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • storybook.js.org
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/objectui/objectui/node_modules/.bin/../storybook/bin/index.cjs dev -p 6006 bjectStackServer gin-timeline/package.json ndor/bin/git (dns block)
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/objectui/objectui/node_modules/.bin/../storybook/bin/index.cjs dev -p 6006 bjectStackServerOUTPUT lds/package.json-d p/bin/git (dns block)
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/objectui/objectui/node_modules/.bin/../storybook/bin/index.cjs dev -p 6006 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

将app-crm中的msw插件运行模式集成到storybook中,并对应修改objectgrid ,objectform story


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

@vercel
Copy link

vercel bot commented Jan 29, 2026

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

Project Deployment Review Updated (UTC)
objectui Ready Ready Preview, Comment Jan 29, 2026 4:25pm
objectui-components Ready Ready Preview, Comment Jan 29, 2026 4:25pm
objectui-crm-app Error Error Jan 29, 2026 4:25pm

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>
Copilot AI changed the title [WIP] Integrate msw plugin running mode into storybook Integrate MSW plugin runtime mode into Storybook Jan 29, 2026
Copilot AI requested a review from hotlong January 29, 2026 13:10
Copilot AI and others added 2 commits January 29, 2026 13:21
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
@github-actions
Copy link

📦 Bundle Size Report

Package Size Gzipped
components (index.js) 1760.07KB 416.42KB
core (index.js) 0.51KB 0.28KB
data-objectstack (index.js) 4.72KB 1.57KB
fields (index.js) 75.69KB 15.58KB
layout (index.js) 12.63KB 3.91KB
plugin-aggrid (AgGridImpl-DKkq6v1B.js) 5.09KB 1.84KB
plugin-aggrid (index-B6NPAFZx.js) 15.66KB 4.51KB
plugin-aggrid (index.js) 0.18KB 0.15KB
plugin-calendar (index.js) 33.12KB 8.29KB
plugin-charts (AdvancedChartImpl-DPXnchtJ.js) 69.51KB 16.23KB
plugin-charts (BarChart-RKJxvg5Y.js) 535.74KB 134.11KB
plugin-charts (ChartImpl-DZGXB6YY.js) 8.78KB 3.11KB
plugin-charts (index-A3NiI95J.js) 12.59KB 3.90KB
plugin-charts (index.js) 0.21KB 0.16KB
plugin-chatbot (index.js) 18.36KB 5.21KB
plugin-dashboard (index.js) 11.92KB 3.81KB
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-form (index.js) 14.43KB 4.64KB
plugin-gantt (index.js) 18.00KB 5.26KB
plugin-grid (index.js) 15.94KB 5.02KB
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-map (index.js) 16.75KB 5.11KB
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
plugin-timeline (index.js) 23.90KB 5.95KB
plugin-view (index.js) 16.64KB 4.92KB
react (SchemaRenderer.js) 2.58KB 1.04KB
react (index.js) 0.36KB 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 (field-types.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

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
@github-actions
Copy link

✅ All checks passed!

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

Copilot AI and others added 2 commits January 29, 2026 16:10
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
@github-actions
Copy link

📦 Bundle Size Report

Package Size Gzipped
components (index.js) 1760.07KB 416.42KB
core (index.js) 0.51KB 0.28KB
data-objectstack (index.js) 4.72KB 1.57KB
fields (index.js) 75.69KB 15.58KB
layout (index.js) 12.63KB 3.91KB
plugin-aggrid (AgGridImpl-DKkq6v1B.js) 5.09KB 1.84KB
plugin-aggrid (index-B6NPAFZx.js) 15.66KB 4.51KB
plugin-aggrid (index.js) 0.18KB 0.15KB
plugin-calendar (index.js) 33.12KB 8.29KB
plugin-charts (AdvancedChartImpl-DPXnchtJ.js) 69.51KB 16.23KB
plugin-charts (BarChart-RKJxvg5Y.js) 535.74KB 134.11KB
plugin-charts (ChartImpl-DZGXB6YY.js) 8.78KB 3.11KB
plugin-charts (index-A3NiI95J.js) 12.59KB 3.90KB
plugin-charts (index.js) 0.21KB 0.16KB
plugin-chatbot (index.js) 18.36KB 5.21KB
plugin-dashboard (index.js) 11.92KB 3.81KB
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-form (index.js) 14.43KB 4.64KB
plugin-gantt (index.js) 18.00KB 5.26KB
plugin-grid (index.js) 15.94KB 5.02KB
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-map (index.js) 16.75KB 5.11KB
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
plugin-timeline (index.js) 23.90KB 5.95KB
plugin-view (index.js) 16.64KB 4.92KB
react (SchemaRenderer.js) 2.58KB 1.04KB
react (index.js) 0.36KB 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 (field-types.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 29, 2026 16:24
Copilot AI review requested due to automatic review settings January 29, 2026 16:24
@hotlong hotlong merged commit d3d8ad8 into main Jan 29, 2026
15 of 18 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.

2 participants