Yida Canvas Upgrade logo

Yida Canvas Upgrade

Organization
openyida
yida-canvas-upgrade

将基于 JSX 组件 的自定义页面升级/迁移为使用 `YidaCodeCanvas` 组件实现的宜搭自定义页面。适用于用户要求“.oyd.jsx / .oyb.jsx / Jsx 页面转 YidaCodeCanvas”“renderJsx 页面迁移到 YidaCodeCanvas”“把发布产物改为 runtimeCode + importedModules”。不要用于从零编写自定义页面。

Overview

Publisheropenyida
Repositoryopenyida
Skill nameyida-canvas-upgrade
Stars
228
Forks
50
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by openyida on GitHub. Read the source before you install it.

Installation

Install the Yida Canvas Upgrade AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/openyida/openyida/tree/main/yida-skills/skills/yida-canvas-upgrade
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/openyida/openyida.git /tmp/openyida
mkdir -p .claude/skills
cp -r /tmp/openyida/yida-skills/skills/yida-canvas-upgrade .claude/skills/yida-canvas-upgrade
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Yida Canvas Upgrade in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Yida Canvas Upgrade on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Yida Canvas Upgrade is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

平台 JSX 组件页面迁移到 YidaCodeCanvas 组件实现

核心定位

本技能用于迁移存量页面:把已有的 JSX 组件页面转换为使用 YidaCodeCanvas 组件实现的页面,产出等价的 React18 函数组件源码并承载到 YidaCodeCanvas。

  • 迁移前页面:OpenYida 平台 JSX 组件页面,通常是 project/pages/src/*.oyd.jsx、export function renderJsx()、_customState、this.utils.yida.*,openyida publish 发布为 Jsx 组件;用户称 .oyb.jsx 时先按平台 JSX 组件页面需求识别,再确认实际源码后缀。
  • 目标实现:页面 Schema 中承载 YidaCodeCanvas 组件,组件属性包含 code、runtimeCode、importedModules,运行时执行 YidaComp。

从老应用主题升级进入

从 yida-upgrade-app-theme 进入时,复用已备份的 Schema、源码和已确认的目标页面清单,逐页进行等价迁移。保持原业务逻辑、主要区块结构、字段 ID、请求参数、权限和跳转行为,不借迁移重做页面或更换业务模板。平台数据能力按当前 Canvas 数据桥规范适配,无法证明等价时停止发布,在应用升级清单记录未完成项。源码注入历史表单详情主题时,按已确认范围清理样式及专属监听,保留业务事件。

迁移前必须确认

检查项命令 / 做法
登录态只读验证openyida env --json + openyida login --check-only --json
原页面源码找到 .oyd.jsx / .jsx 源文件;不要只看 dist 编译产物
目标页面 Schema先执行 openyida get-schema <appType> <formUuid>,再用 create_file / Write / file edit tool 按需保存到 <projectRoot>/.cache/openyida/canvas-upgrade/<name>-schema.json;不要用 shell 重定向
YidaCodeCanvas 发布能力已内置:产出的 .canvas.jsx 用 openyida publish <源文件> <appType> <formUuid> 即自动写入 YidaCodeCanvas Schema(.canvas.jsx 扩展名识别,CLI 本地用 Babel 编译出 runtimeCode + importedModules),无需设计器手工添加
原页面数据依赖列出 this.utils.yida.*、this.dataSourceMap.*、连接器、外部脚本、全局变量

openyida publish 已能把 .canvas.jsx 发布为 YidaCodeCanvas 组件页面;升级的真正门槛在源码等价改写(尤其 this.utils.yida.* / dataSourceMap 在 YidaCodeCanvas 组件内没有平台 JSX 组件实例桥对应物),而非发布能力。改写受阻、无法保证等价时,只交付源码草案和迁移报告,不要声称已完成升级。

可迁移性分级

原页面能力迁移建议
纯展示 UI、静态数据、轻交互可直接迁为 YidaComp 函数组件
普通 React 状态 / _customState改为 useState / useMemo / useEffect
didMount / didUnmount改为 useEffect(() => { ...; return cleanup; }, [])
ECharts / d3 / recharts优先使用 YidaCodeCanvas 可用资源清单;不在清单内则先补依赖或降级
this.utils.yida.* 表单 API不能默认照搬;需要通过 props、数据源注入;无法等价迁移时保留历史页面并输出阻塞点
this.dataSourceMap.*需要确认 YidaCodeCanvas props 是否透传数据源;未验证前不要迁移为可运行承诺
this.utils.toast/dialog/router改为 antd Message/Modal 或由 props 注入的能力;需验证
字段组件如 EmployeeField按 YidaCodeCanvas 组件依赖映射规则先做最小验证
openyida publish仍是最终发布方式:.oyd.jsx / .openyida.jsx 等平台 JSX 源码发布为 Jsx 组件,.canvas.jsx 源码(或加 --canvas)发布为 YidaCodeCanvas 组件。迁移就是把源码改写成 .canvas.jsx 后重新 publish

输出产物位置

  • 可维护的 .canvas.jsx 源码放在 project/pages/src/<页面名>.canvas.jsx。
  • 临时分析、Schema 回读、编译返回值、依赖清单放在 .cache/openyida/canvas-upgrade/。
  • 不要把一次性 runtimeCode、接口抓包、调试 JSON 放到仓库根目录。

迁移步骤

  1. 盘点原页面

    • 读取源文件,不从 project/pages/dist/*.js 反推。
    • 列出导出的函数、顶层常量、_customState 字段、生命周期、API 调用、第三方脚本。
    • 标记依赖 this 的能力:this.utils、this.dataSourceMap、this.state、this.setState。
  2. 判断是否能自动升级

    • 如果页面主要是 UI + 本地状态 + 白名单图表库,可以继续生成 .canvas.jsx 源码。
    • 如果页面强依赖 this.utils.yida.* 或设计器数据源,但 YidaCodeCanvas props 未验证,先输出阻塞点和迁移计划。
    • 如果目标诉求其实是字段结构、流程、报表、权限,停止迁移,切到对应配置型技能。
  3. 生成 .canvas.jsx 源码

    • 把 export function renderJsx() 的 JSX 提取到 function YidaComp(props)。
    • 把 _customState 拆为 React state;复杂派生数据用 useMemo。
    • 把生命周期副作用放进 useEffect 并返回 cleanup。
    • 把普通页面 API 适配逻辑抽成 props 调用或明确的 TODO,不要假装可用。
    • 保持 UI 结构和文案尽量不变,先做等价迁移,再考虑重构。
  4. 处理依赖

    • import 只使用 YidaCodeCanvas 可用资源清单内的包(能被 CLI 编译识别并注入 importedModules)。
    • 对照 YidaCodeCanvas 依赖规则检查 importedModules。
    • 外部 CDN 脚本要么换成白名单依赖,要么在最小验证页确认可加载。
  5. 发布 / 验证 Schema

    • 用 openyida publish project/pages/src/<页面名>.canvas.jsx <appType> <formUuid> 发布:.canvas.jsx 自动写入 YidaCodeCanvas Schema,CLI 本地用 Babel 编译出 runtimeCode + importedModules(code / runtimeCode / importedModules 由 CLI 填充,无需手工拼 Schema)。
    • 源码改写受阻、无法保证等价时,只交付 .canvas.jsx 草案和升级报告,不要发布覆盖线上页。
    • 发布后回读 Schema,确认组件树中存在 YidaCodeCanvas,且 runtimeCode 不是空。
  6. 运行验收

    • 打开真实页面,确认首屏非空。
    • 控制台无依赖缺失、YidaComp 未定义、CSS 缺失等错误。
    • 核心交互能触发;移动端至少做一次宽度/弹层检查。
    • 如涉及 EmployeeField,按 EmployeeField 验收点逐项验证。

转换模式与升级报告

  • 转换核心:_customState → useState/useMemo;didMount/didUnmount → useEffect + cleanup;删掉 forceUpdate/timestamp 强刷;this.utils.yida.*/dataSourceMap 抽成 props 或明确 TODO(YidaCodeCanvas 组件没有平台 JSX 组件实例桥,不要假装可用);JSX 从 renderJsx() 提到 function YidaComp(props) 并 export default。
  • 迁移完成或受阻时输出简短升级报告(含 source/target、status、依赖、schema write path、blockers、验收勾选项)。

📖 before/after 完整转换 JSX 示例 + 升级报告模板 → references/migration-examples.md

常见阻塞

阻塞处理
源码无法等价改写(this.utils.yida.* / dataSourceMap 深度耦合)YidaCodeCanvas 组件没有平台 JSX 组件实例桥,需重写为自建 HTTP 桥或 props;未验证前只交付草案和迁移报告,不发布覆盖
依赖不在 YidaCodeCanvas 可用资源清单补依赖映射、换已支持库,或保留原实现
原页面强依赖 this.utils.yida.*需要 props / 数据源注入方案;未验证前不要承诺可运行
原页面使用宜搭原生字段组件先做最小验证
Schema 回读不是 YidaCodeCanvas说明 Schema 仍是 Jsx 组件,升级未完成

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Yida Canvas Upgrade AI skill do?

将基于 JSX 组件 的自定义页面升级/迁移为使用 `YidaCodeCanvas` 组件实现的宜搭自定义页面。适用于用户要求“.oyd.jsx / .oyb.jsx / Jsx 页面转 YidaCodeCanvas”“renderJsx 页面迁移到 YidaCodeCanvas”“把发布产物改为 runtimeCode + importedModules”。不要用于从零编写自定义页面。

Why use Yida Canvas Upgrade on TypingMind?

Because you install it once and use it with any model. Yida Canvas Upgrade is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Yida Canvas Upgrade in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/openyida/openyida/tree/main/yida-skills/skills/yida-canvas-upgrade. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Yida Canvas Upgrade?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Yida Canvas Upgrade?

As many as you like. As long as a model supports skills, you can use Yida Canvas Upgrade with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Yida Canvas Upgrade AI skill free?

Yes. It is published on GitHub by openyida under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇