You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 26, 2026. It is now read-only.
Repository navigation
Commit 699156a
Browse filesBrowse the repository at this point in the historyBrowse files
authored
refactor(providers)!: retire the DataSourceProvider, MetadataProvider and ThemeProvider trio and fix the guides that taught them (objectui#13453, part 2) (#13507)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D4nNtkcxk6i4sCKHsvYsQgG)_
Part of #13453
Clause-②: no (nothing added a consumer or author can target)
Metadata-protocol: none
## 维护者速读(草稿)
- **改了什么:** `@object-ui/providers` 删掉三个和别的包重名的
Provider:`DataSourceProvider`、`MetadataProvider`、`ThemeProvider`(连同
`useDataSource` / `useMetadata` / `useTheme` 和四个类型)。包里只留上传用的
`UploadProvider` / `useUpload`。同时改好引用它们的地方:byo 示例、README
和架构文档、贡献者技能指南里的一句话、对外发布的 `skills/objectui` 两篇指南。另外把 #13506 已改成私有的 runner
从这几篇指南里拿掉。
- **为什么改:** 这三个名字在 `@object-ui/react`(数据源、主题)和
`@object-ui/app-shell`(元数据)里都有同名但实现不同的版本,console 用的都是那两个包的。providers
这份在三个仓里没有任何代码引用,只出现在文档和一个示例里,AI 和开发者照着文档写,很容易引错包。
- **风险与代价(含回滚):** 对 npm 上的外部使用者是破坏性删除。按版本政策只声明 `minor`,changeset
里写明删了哪些名字,并给出迁移路径。cloud 和外部 npm 依赖方没有测量到。回滚就是 revert 这一个
PR,没有数据或接口协议上的影响。
- **席位意见:**
- **你要做的:** 审阅后在本 PR 点 Approve(os-zhuang 或 hotlong 任一人即可),之后由席位落地。
## What this removes
Second of the two PRs the claim amendment (comment 6393918010) cuts on
the governed line; PR 1 (#13506, Tier S) merged at `0063f22`. This one
is Tier H because it edits
`.claude/skills/objectui-contributor/guides/console-development.md` and
`skills/objectui/**`.
**1. The providers trio.**
`packages/providers/src/{DataSourceProvider,MetadataProvider,ThemeProvider}.tsx`,
`types.ts`, and their two tests (`spec-symbol-batch7.test.ts`,
`theme-mode-spec-parity.test.tsx`) are deleted. The barrel keeps only
the upload surface (`UploadProvider`, `useUpload`, the upload adapters),
with a note on what retired and where each replacement lives. Removed
names: `DataSourceProvider`, `useDataSource`, `MetadataProvider`,
`useMetadata`, `ThemeProvider`, `useTheme`, and the types
`DataSourceProviderProps`, `MetadataProviderProps`,
`ThemePreferenceProviderProps`, `ThemePreference`.
Premise correction carried from the claim: `@object-ui/react` does not
export `DataSourceProvider`, `useDataSource` or `MetadataProvider`. The
replacements are:
| Retired (`@object-ui/providers`) | Use instead |
|---|---|
| `DataSourceProvider` / `useDataSource` | `SchemaRendererProvider`
(`dataSource` prop), `@object-ui/react` |
| `ThemeProvider` / `useTheme` | `ThemeProvider` / `useTheme`,
`@object-ui/react` (`defaultMode`; the old `system` is `auto`; `persist`
keeps the choice in `localStorage`) |
| `MetadataProvider` / `useMetadata` | `MetadataProvider` /
`useMetadata`, `@object-ui/app-shell` |
**2. The one code consumer, the byo example.**
`examples/byo-backend-console/src/App.tsx` now wraps in `ThemeProvider
defaultMode="light" persist storageKey=…` and `SchemaRendererProvider`
from `@object-ui/react`; its `@object-ui/providers` dependency and the
lockfile entry go. Its README follows.
**3. Docs and exemptions that named the trio.** `README.md`,
`docs/ARCHITECTURE.md` (its compiled snippets now import the
replacements), `examples/README.md`, `packages/providers/README.md`, the
`types/src/theme.ts` comments, and two test comments that pointed at the
deleted files: `p2-spec-exports.test.ts`, and the `KNOWN_COLLISIONS`
note in `one-authority-per-exported-name-6273.test.ts` (no entry
changes; it now records that react's `ThemeProvider` is the only one
left). `docs/audits/2901-spec-enum-renderer-coverage.md` unlinks the
deleted `ThemeProvider.tsx` path (read by `check-doc-links`).
**4. Governed text.**
- `.claude/skills/objectui-contributor/guides/console-development.md`:
the paragraph that called `MetadataProvider` "the one name with two
hits" now says the app-shell one is the only one left
(`check-skills-paths` reads the deleted path).
- `skills/objectui/guides/project-setup.md`: the provider section and
the decision matrix teach `SchemaRendererProvider` / `ThemeProvider`
(react), `MetadataProvider` (app-shell) and `UploadProvider`
(providers); the `@object-ui/runner` section becomes "use `objectui
dev`", since #13506 made runner a private workspace app.
- `skills/objectui/guides/architecture.md`: the integration-package
bullets follow the same split and drop runner.
- `skills/objectui/README.md`: runner leaves the Integration package
list.
## Census before deleting (lit controls)
| Repository | Read at | Searched | Hits outside
`packages/providers/src` | Control |
|---|---|---|---|---|
| objectui | `0063f22` (main) | `git grep` for every removed name and
for `from '@object-ui/providers'` | docs and READMEs, the guide files
above, and `examples/byo-backend-console/src/App.tsx` (the only code
import) | `UploadProvider` imports from `@object-ui/providers` lit in
the console |
| objectstack | `5874d25` | `@object-ui/providers` | none |
`@object-ui/` lit in 150 files |
| hotcrm | `a7faf81` | `@object-ui/providers` | none | `@object-ui/` lit
in 5 files |
| cloud, npm dependents | n/a | **NOT MEASURED**: not reachable from
this session | n/a | n/a |
## Changeset
`13453-providers-retire-trio.md`: `@object-ui/providers` `minor`, every
removed name listed, with the migration above. Never `major`, per the
version policy.
## Verification (local, on this head)
- **type-check** (`turbo run type-check --continue` under the verify
lock, filters providers, types, console, the byo example; 39 tasks with
dependencies): 39 successful.
- **vitest**: `packages/providers`, `p2-spec-exports.test.ts`,
`one-authority-per-exported-name-6273.test.ts`,
`check-skills-paths.test.ts`, `check-doc-links.test.ts`,
`quick-reference-commands-4149.test.ts`, `check-skill-examples.test.ts`:
7 files, 318 tests passed.
- **gates**: `check-doc-links`, `check-changeset-no-major`,
`check-changeset-fixed`, and `pnpm exec changeset status
--since=origin/main` all exit 0.
- Earlier, on the unsplit branch that carried PR 1 plus this diff:
whole-package vitest of core, types, providers, collaboration,
plugin-detail and react passed (1028 files, 19019 tests).
- **NOT MEASURED locally:** `check:readme-exports` and
`check:doc-snippets` (need every package's `dist`); CI runs them.
## Still on #13453 after this
- `resetActionKeyWarnings` and `clearSharedDiscoveryCache` wait for
#13442.
- The 122 dead i18n keys, after #13460's PR merges and a claim
amendment.
- `plugin-ai` and folding `UploadProvider` are out of scope
(maintainer's call).
---
_Generated by [Claude
Code](https://claude.ai/code/session_011yfYeuX2ptMSCcYZiq61tS)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: os-zhuang <jack@objectstack.ai>
**Breaking:** removed `DataSourceProvider` / `useDataSource`, `MetadataProvider` / `useMetadata`, `ThemeProvider` / `useTheme` and the types `DataSourceProviderProps`, `MetadataProviderProps`, `ThemePreferenceProviderProps`, `ThemePreference` (objectui#13453). They duplicated names other ObjectUI packages publish with different implementations. Declared `minor` per the version-alignment policy (a changeset never declares `major`). `UploadProvider`, `useUpload` and the upload adapters are unchanged.
9
+
10
+
Migration: wrap the tree in `SchemaRendererProvider` from `@object-ui/react` (its `dataSource` prop) instead of `DataSourceProvider`, and pass the adapter to views as before; use `ThemeProvider` / `useTheme` from `@object-ui/react` (`defaultMode`, where the old `system` is `auto`; add `persist` to keep the choice in `localStorage`); use `MetadataProvider` / `useMetadata` from `@object-ui/app-shell`.
Copy file name to clipboardExpand all lines: README.md
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ Pick the path that matches where you are starting from:
56
56
| You want to… | Start here | Install |
57
57
|---|---|---|
58
58
| Render a JSON schema inside your React app |[`examples/hello-world`](examples/hello-world)|`@object-ui/react @object-ui/components`|
59
-
| Embed views in an existing app, against **your own** backend |[`examples/byo-backend-console`](examples/byo-backend-console)|`@object-ui/app-shell @object-ui/plugin-view @object-ui/providers`|
59
+
| Embed views in an existing app, against **your own** backend |[`examples/byo-backend-console`](examples/byo-backend-console)|`@object-ui/app-shell @object-ui/plugin-view @object-ui/react`|
60
60
| Stand up a complete console on an **ObjectStack** backend |[`examples/console-starter`](examples/console-starter)| fork the example |
61
61
| Build a UI from a JSON file, no React code at all |[`@object-ui/cli`](packages/cli)|`npm install -g @object-ui/cli`|
62
62
@@ -120,14 +120,14 @@ nothing thrown and one line on the console.
120
120
Use the shell and views without the full console infrastructure — your routing, your auth, your API:
Copy file name to clipboardExpand all lines: docs/audits/2901-spec-enum-renderer-coverage.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ The #2897 shape. Validates, renders nothing, nobody knows it should be full.
76
76
| 7 chart types draw an **empty plot**|[AdvancedChartImpl.tsx:343](../../packages/plugin-charts/src/AdvancedChartImpl.tsx)| Grid, axes, tooltip and legend all render; every series mark hits `return null`. Looks like an empty dataset. |
77
77
| 6 of 9 animation presets do nothing |[useAnimation.ts:64](../../packages/react/src/hooks/useAnimation.ts)|`PRESET_CLASSES` is keyed in **hyphens** (`'slide-up'`), the spec enum in **underscores** (`slide_up`); `rotate`/`flip` absent entirely. Lookup misses → `''` → no animation. |
78
78
| 3 of 6 easings emit **invalid CSS**|[useAnimation.ts:112](../../packages/react/src/hooks/useAnimation.ts)| Same split, but `EASING_MAP[easing] \|\| easing` falls through to the raw string. `animationTimingFunction: 'ease_in_out'` — browser drops it, devtools shows the attribute populated. |
79
-
|`mode: 'auto'` breaks theming |[ThemeProvider.tsx:38](../../packages/app-shell/src/chrome/ThemeProvider.tsx) + [providers/ThemeProvider.tsx:33](../../packages/providers/src/ThemeProvider.tsx)| Renderer branches on `"system"`; spec says `auto`. `root.classList.add('auto')` matches no Tailwind variant → light theme, OS preference no longer followed, no error. |
79
+
|`mode: 'auto'` breaks theming |[ThemeProvider.tsx:38](../../packages/app-shell/src/chrome/ThemeProvider.tsx) + `providers/ThemeProvider.tsx` (retired in objectui#13453) | Renderer branches on `"system"`; spec says `auto`. `root.classList.add('auto')` matches no Tailwind variant → light theme, OS preference no longer followed, no error. |
80
80
| Export **PDF** downloads nothing |[ObjectGrid.tsx:1258](../../packages/plugin-grid/src/ObjectGrid.tsx), [ListView.tsx:1611](../../packages/plugin-list/src/ListView.tsx)| Excluded from `serverEligible` and absent from the client fallback. Popover closes, no file. `xlsx` does the same whenever the server path is unavailable. |
81
81
| Timeline `scale` blanks the axis |[renderer.tsx:270](../../packages/plugin-timeline/src/renderer.tsx)|`hour`/`quarter`/`year` produce zero header columns. All six are ignored entirely on the default `vertical` variant. |
82
82
| All 6 toast positions discarded |[toaster.tsx:15](../../packages/components/src/renderers/feedback/toaster.tsx)|`<SonnerToaster />` with no props, `inputs: []`. |
Copy file name to clipboardExpand all lines: examples/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Runnable examples that show how to consume ObjectUI in different scenarios. Pick
7
7
| Example | Use it when… | Backend | Bundle | What it gives you |
8
8
|---|---|---|---|---|
9
9
|[`hello-world/`](./hello-world)| You want the smallest possible `<SchemaRenderer>` demo to see the JSON → React pipeline. | None (in-memory schema) | Tiny | A single `App.tsx` rendering one schema. |
10
-
|[`byo-backend-console/`](./byo-backend-console)| You want to **embed** ObjectUI into your own app and connect it to **your own** REST/GraphQL backend. | Bring-your-own (mock REST shown) |~50 KB |`@object-ui/app-shell` + `@object-ui/providers`, custom router, custom `DataSource`. ~100 lines of integration code, no auth, no plugins. |
10
+
|[`byo-backend-console/`](./byo-backend-console)| You want to **embed** ObjectUI into your own app and connect it to **your own** REST/GraphQL backend. | Bring-your-own (mock REST shown) |~50 KB |`@object-ui/app-shell` + `@object-ui/react`, custom router, custom `DataSource`. ~100 lines of integration code, no auth, no plugins. |
11
11
|[`console-starter/`](./console-starter)| You want a **fork-ready, opinionated console** with the full plugin set already wired against an **ObjectStack** backend. | ObjectStack (`/api/v1`) | Full |`@object-ui/app-shell``ConsoleShell` + `AuthProvider` + every `@object-ui/plugin-*` (grid, kanban, calendar, charts, dashboard, designer, detail, form, list, report, view, chatbot). |
0 commit comments