Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
30a9e1c
feat(compiler-core): 新增客服中心示例组件,完善对话面板和路由功能
smirk9581 May 25, 2026
0eab079
chore(compiler-core): 更新版本号
smirk9581 May 25, 2026
199f1c2
docs(compiler-core): 更新英文更新日志
smirk9581 May 25, 2026
a575cf5
docs(compiler-core): 更新中文更新日志
smirk9581 May 25, 2026
94adec8
docs(compiler-core): 更新英文 README
smirk9581 May 25, 2026
1f74de8
docs(compiler-core): 更新中文 README
smirk9581 May 25, 2026
c0c0c8a
fix(compiler-core): 更新适配器映射常量
smirk9581 May 25, 2026
638b7f2
fix(compiler-core): 更新其他常量定义
smirk9581 May 25, 2026
0eee086
fix(compiler-core): 优化 JSX 子节点构建逻辑
smirk9581 May 25, 2026
c404771
fix(compiler-core): 优化依赖规范化处理逻辑
smirk9581 May 25, 2026
fdfdda2
fix(compiler-core): 优化脚本语法处理器入口
smirk9581 May 25, 2026
c5a0191
feat(compiler-core): 新增 vue-type-as-any 后处理功能
smirk9581 May 25, 2026
621af2a
fix(compiler-core): 优化模板属性 IR 工具函数
smirk9581 May 25, 2026
3ee7aa3
fix(compiler-core): 优化 v-on 指令解析逻辑
smirk9581 May 25, 2026
fec1e13
fix(compiler-core): 优化插槽出口节点解析逻辑
smirk9581 May 25, 2026
eacf296
test(compiler-core): 新增 vue-type-as-any 测试用例
smirk9581 May 25, 2026
3847d89
docs: 更新根目录 README 内容
smirk9581 May 25, 2026
cedd3eb
chore(compiler-core): 更新版本号
smirk9581 May 25, 2026
e7bd0d8
docs(compiler-core): 更新英文 README
smirk9581 May 25, 2026
b74b2d0
docs(compiler-core): 更新中文 README
smirk9581 May 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

**Write Vue. Get Pure React.**

> A compiler toolchain for migrating from Vue to React and for writing React with Vue syntax.
> A complete solution for Vue-to-React migration and hybrid development.
>
> It converts Vue 3 SFCs, scripts, and styles into pure React without a runtime bridge, with full
> `<script setup>` support and progressive migration.

[![Stars](https://img.shields.io/github/stars/vureact-js/core?style=flat-square&color=magenta)](https://github.com/vureact-js/core)
[![Npm](https://img.shields.io/npm/v/@vureact/compiler-core.svg?label=Npm&style=flat-square)](https://vureact.top/en/)
[![Downloads](https://img.shields.io/npm/dt/@vureact/compiler-core?label=Downloads&style=flat-square&color=red)](https://www.npmjs.com/package/@vureact/compiler-core)
[![Monthly](https://img.shields.io/npm/dm/@vureact/compiler-core?label=Monthly&style=flat-square)](https://www.npmjs.com/package/@vureact/compiler-core)
Expand Down
1 change: 1 addition & 0 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
>
> Vue 3 SFC・Script・Style をランタイムなしで純粋な React へ変換。`<script setup>` ・段階的移行・混在開発に対応。

[![Stars](https://img.shields.io/github/stars/vureact-js/core?style=flat-square&color=magenta)](https://github.com/vureact-js/core)
[![Npm](https://img.shields.io/npm/v/@vureact/compiler-core.svg?label=Npm&style=flat-square)](https://vureact.top/en/)
[![Downloads](https://img.shields.io/npm/dt/@vureact/compiler-core?label=Downloads&style=flat-square&color=red)](https://www.npmjs.com/package/@vureact/compiler-core)
[![Monthly](https://img.shields.io/npm/dm/@vureact/compiler-core?label=Monthly&style=flat-square)](https://www.npmjs.com/package/@vureact/compiler-core)
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

**写 Vue,输出可维护的 React。**

> 一个面向 Vue 到 React 迁移、兼具「用 Vue 写 React」双重能力的编译工具链
> 一个面向 Vue 迁移/混合 React 的完整解决方案
>
> 将 Vue 3 SFCs・Scripts・Styles 完整转为纯 React(非运行时桥接),
> 覆盖 `<script setup>` 核心全特性,支持渐进式迁移和混合开发
> 覆盖 `<script setup>` 核心全特性,支持渐进式迁移与混合开发

[![Stars](https://img.shields.io/github/stars/vureact-js/core?style=flat-square&color=magenta)](https://github.com/vureact-js/core)
[![Npm](https://img.shields.io/npm/v/@vureact/compiler-core.svg?label=Npm&style=flat-square)](https://vureact.top/)
[![Downloads](https://img.shields.io/npm/dt/@vureact/compiler-core?label=Downloads&style=flat-square&color=red)](https://www.npmjs.com/package/@vureact/compiler-core)
[![Monthly](https://img.shields.io/npm/dm/@vureact/compiler-core?label=Monthly&style=flat-square)](https://www.npmjs.com/package/@vureact/compiler-core)
Expand Down
18 changes: 18 additions & 0 deletions packages/compiler-core/CHANGELOG-zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.8.4] - 2026-05-25

### Fixed

- 修复模板修饰符事件没有表达式时,模板解析直接崩溃 [#43](https://github.com/vureact-js/core/issues/43)
- 修复 `<slot>` 搭配 v-else 时,slot props 解析崩溃 [#44](https://github.com/vureact-js/core/issues/44)
- 修复 JSX children 构建对异常 children 形态缺乏容错 [#45](https://github.com/vureact-js/core/issues/45)
- 修复当 provide() 内部使用 computed() 会漏转为 React 产物 [#46](https://github.com/vureact-js/core/issues/46)
- 修复 Vue 类型的 import 在编译后被移除,但代码中对应类型引用未移除,导致 TS 类型错误 [#47](https://github.com/vureact-js/core/issues/47)
- 修复在依赖分析中(如 watchEffect),对代码中的混合了可选链的对象访问,未添加可选链保护导致崩溃的问题 [#48](https://github.com/vureact-js/core/issues/48)
- 修复编译器在处理模板特殊事件时,生成了错误的运行时方法 dir.On,导致页面奔溃的问题 [#49](https://github.com/vureact-js/core/issues/49)

---

[1.8.4]: https://github.com/vureact-js/core/compare/v1.8.3...v1.8.4

---

## [1.8.3] - 2026-05-15

### Fixed
Expand Down
21 changes: 20 additions & 1 deletion packages/compiler-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.8.4] - 2026-05-25

### Fixed

- Fixed template parser crash when modifier events had no expression [#43](https://github.com/vureact-js/core/issues/43)
- Fixed `<slot>` with `v-else` causing slot props parsing crash [#44](https://github.com/vureact-js/core/issues/44)
- Fixed JSX children builder lacking tolerance for abnormal children shapes [#45](https://github.com/vureact-js/core/issues/45)
- Fixed `provide()` using `computed()` internally not being converted to React output [#46](https://github.com/vureact-js/core/issues/46)
- Fixed Vue type imports being removed after compilation but corresponding type references in code not being removed, causing TS type errors [#47](https://github.com/vureact-js/core/issues/47)
- Fixed dependency analysis (e.g., `watchEffect`) missing optional chaining protection for object access mixed with optional chaining, causing crashes [#48](https://github.com/vureact-js/core/issues/48)
- Fixed compiler generating incorrect runtime method `dir.On` when handling special template events, causing page crashes [#49](https://github.com/vureact-js/core/issues/49)

---

[1.8.4]: https://github.com/vureact-js/core/compare/v1.8.3...v1.8.4

---

## [1.8.3] - 2026-05-15

### Fixed
Expand Down Expand Up @@ -644,7 +662,8 @@ When releasing a new version:
---

```text
[Unreleased]: https://github.com/vureact-js/core/compare/v1.8.3...HEAD
[Unreleased]: https://github.com/vureact-js/core/compare/v1.8.4...HEAD
[1.8.4]: https://github.com/vureact-js/core/compare/v1.8.3...v1.8.4
[1.8.3]: https://github.com/vureact-js/core/compare/v1.8.1...v1.8.3
[1.8.1]: https://github.com/vureact-js/core/compare/v1.8.0...v1.8.1
[1.8.0]: https://github.com/vureact-js/core/compare/v1.7.0...v1.8.0
Expand Down
18 changes: 10 additions & 8 deletions packages/compiler-core/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# @vureact/compiler-core

**Write Vue. Get Pure React.**
`@vureact/compiler-core` is a complete solution for Vue-to-React migration and hybrid development. **CLI and core compiler package** of VuReact.

`@vureact/compiler-core` is the **CLI and core compiler package** of VuReact.
It compiles Vue 3 SFC, script, and style files into **pure React 18+ code**, making it suitable for progressive migration and for teams that want to keep Vue authoring conventions while targeting a React app.

It is a **compile-time solution**, not a runtime bridge.
It is used to fully convert Vue 3 SFCs, Scripts, and Styles into pure React (non-runtime bridge) code and output engineered artifacts, covering all core features of `<script setup>`, and supporting progressive migration and hybrid development.

[![Downloads](https://img.shields.io/npm/dt/@vureact/compiler-core?label=Downloads&style=flat-square)](https://www.npmjs.com/package/@vureact/compiler-core)
[![Node](https://img.shields.io/badge/node-%3E%3D19.0.0-green?label=Node)](https://nodejs.org/)
Expand All @@ -15,12 +12,17 @@ English | [简体中文](./README.zh-CN.md)

## Who this package is for

- Teams progressively migrating a Vue 3 codebase to React
- Developers who want Vue-style authoring with React output
- Projects that need a config-driven `build/watch` compilation workflow
- Projects need to migrate incrementally from Vue 3 to React, but do not want to rewrite from scratch, preferring to find existing solutions first.
- Some developers use Vue as their primary technology stack, are accustomed to its mental model, and consider React's overhead to be heavier than Vue's.
- Backend developers do not want to learn both frameworks; Vue is quick to pick up and intuitive, and they are reluctant to engage with React.
- The converted React code must completely detach from the Vue runtime to avoid performance and bundle size issues caused by a dual-framework runtime.

## Usage

> 💡 **Official guide from scratch:** [VuReact Quick Start](https://vureact.top/en/guide/quick-start.html)
>
> 💡 **Hybrid migration walkthrough:** [Customer Support Hub (Vue + React)](https://vureact.top/en/guide/customer-support-hub)

### 1. Install

```bash
Expand Down
20 changes: 11 additions & 9 deletions packages/compiler-core/README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# @vureact/compiler-core

**写 Vue,生成可维护的 React。**

`@vureact/compiler-core` 是 VuReact 的 **CLI 与核心编译包**。
它用于将 Vue 3 的 SFC、脚本和样式文件编译为 **纯 React 18+ 代码**,适合渐进式迁移,以及“保持 Vue 心智模型、输出 React 工程”的场景。

它是 **编译时方案**,不是运行时桥接。
`@vureact/compiler-core` 是一个面向 Vue 迁移 React / Vue + React 混合开发的完整解决方案。VuReact 的 **CLI 与核心编译包**。
它用于将 Vue 3 SFCs・Scripts・Styles 完整转为纯 React(非运行时桥接)代码并输出工程化产物,覆盖 `<script setup>` 核心全特性,支持渐进式迁移和混合开发。

[![Stars](https://img.shields.io/github/stars/vureact-js/core?style=flat-square&color=magenta)](https://github.com/vureact-js/core)
[![Downloads](https://img.shields.io/npm/dt/@vureact/compiler-core?label=Downloads&style=flat-square)](https://www.npmjs.com/package/@vureact/compiler-core)
[![Node](https://img.shields.io/badge/node-%3E%3D19.0.0-green?label=Node)](https://nodejs.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/vureact-js/core/blob/master/LICENSE)
Expand All @@ -15,12 +12,17 @@

## 这个包适合谁

- 正在把 Vue 3 项目渐进迁移到 React
- 想继续按 Vue 约定写代码,但产出 React 工程
- 需要基于配置文件执行 `build/watch` 编译流程
- 项目需从 Vue 3 渐进式迁移到 React,但不想从头重写,优先寻找现有解决方案
- 部分开发者以 Vue 为主技术栈,习惯其心智模型,认为 React 的额外负担比 Vue 更重
- 后端开发者不想学习双框架,Vue 上手快、符合直觉,不愿接触 React
- 转换后的 React 需完全脱离 Vue 运行时,避免双框架运行时所带来的性能和体积问题

## 使用方式

> 💡 **从零开始的官方指南:**[VuReact 快速入门](https://vureact.top/guide/quick-start.html)
>
> 💡 **混合项目迁移实践:**[客户支持协同后台(Vue + React)](https://vureact.top/guide/customer-support-hub)

### 1. 安装

```bash
Expand Down
73 changes: 61 additions & 12 deletions packages/compiler-core/examples/customer-support-hub/README.en.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,77 @@
# Customer Support Hub (Mixed Writing Example)
# Customer Support Hub

This example demonstrates a business-oriented mixed-writing project for VuReact compiler:

- Stack: Vue + Vue Router + Ant Design (React) + Zustand + Sass + dayjs + fuse.js
- Focus: controlled mixed writing in a realistic support ticket workflow
- Pages: login, dashboard, ticket list, ticket detail, knowledge base, SLA board, settings
`Customer Support Hub` is a realistic multi-channel customer support sample used to stress-test VuReact in a business-style admin application.

English | [简体中文](./README.md)

## Run
## Stack

- Vue 3
- Vue Router 4
- Ant Design React 6
- Zustand
- Sass
- dayjs
- fuse.js

## Business Scope

The sample now covers the main workflow of a mid-sized support collaboration system:

- Login and admin shell
- Dashboard
- Conversation Center
- Tickets List
- Ticket Detail
- Customers
- Agents
- Knowledge Base
- SLA Board
- Settings

## Conversion Coverage

This example intentionally pushes compiler-sensitive Vue patterns inside real pages instead of isolated demos:

- layered conditionals: `v-if / v-else-if / v-else / v-show`
- nested lists with multiple `v-for`
- named slots and scoped slots
- dynamic components via `:is`
- `defineProps / defineEmits / defineExpose`
- `provide / inject`
- `watch / watchEffect / computed`
- multi-`v-model` event mapping
- template literals plus object / array literal props

## Build React Output with the Local Compiler

When you are validating compiler-core changes inside this repo, prefer the local CLI:

```bash
npm install
npm run vr:build
node ..\..\bin\vureact.js build
```

Generated output:

```bash
.vureact/react-app
```

Then run generated output:
## Run the React Output

```bash
cd .vureact/react-app
npm install
npm run dev
```

## Official Tutorial
## Recommended Verification

1. Dashboard shows ticket KPIs, channel distribution, pending conversations, and hotspot customers.
2. Conversation Center supports filtering, queue switching, bulk assignment, convert-to-ticket, merge, pending state, and draft saving.
3. Ticket Detail shows linked conversations, escalation records, internal notes, and timeline updates.
4. Customers, Agents, and SLA Board have stable mock data on first load.

## Related Files

<https://www.vureact.top/en/guide/customer-support-hub.html>
- [vureact.config.ts](./vureact.config.ts)
73 changes: 61 additions & 12 deletions packages/compiler-core/examples/customer-support-hub/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,77 @@
# 客户支持协同台(混写示例)
# Customer Support Hub

该示例用于演示 VuReact 在真实业务场景下的“可控混写”能力:

- 技术栈:Vue + Vue Router + Ant Design(React)+ Zustand(React) + Sass + dayjs + fusejs
- 场景:客服工单协同流程(列表、详情、知识库、SLA)
- 页面:登录、总览、工单列表、工单详情、知识库、SLA 看板、设置
`Customer Support Hub` 是一个偏真实业务形态的多渠道客服协同示例,用来压测 VuReact 在复杂后台项目中的混写与转换能力。

简体中文 | [English](./README.en.md)

## 运行
## 技术栈

- Vue 3
- Vue Router 4
- Ant Design React 6
- Zustand
- Sass
- dayjs
- fuse.js

## 业务范围

当前示例覆盖了一个中小型客服协同平台的主链路:

- 登录与基础后台壳层
- 总览 Dashboard
- 会话中心
- 工单列表
- 工单详情
- 客户管理
- 坐席管理
- 知识库
- SLA 看板
- 设置中心

## 重点能力覆盖

为了尽量挖出编译器边界问题,这个示例刻意把大量高风险语法放进真实页面里:

- 多层条件渲染:`v-if / v-else-if / v-else / v-show`
- 列表与嵌套列表:多层 `v-for`
- 具名插槽与作用域插槽
- 动态组件 `:is`
- `defineProps / defineEmits / defineExpose`
- `provide / inject`
- `watch / watchEffect / computed`
- 多 `v-model` 事件映射
- 模板字面量、对象字面量、数组字面量 props

## 使用本地编译生成 React 产物

如果你正在这个仓库里联调 compiler-core,请优先使用本地 CLI:

```bash
npm install
npm run vr:build
node ..\..\bin\vureact.js build
```

生成目录:

```bash
.vureact/react-app
```

然后运行产物:
## 运行 React 产物

```bash
cd .vureact/react-app
npm install
npm run dev
```

## 官方教程
## 建议验收清单

1. 总览页可看到工单 KPI、渠道分布、待回复会话、热点客户。
2. 会话中心可筛选渠道、切换队列、批量转派、转工单、并单、挂起、保存草稿。
3. 工单详情可看到关联会话、升级记录、内部协同备注和时间轴联动。
4. 客户页、坐席页、SLA 看板首次进入有稳定 mock 数据。

## 相关文件

<https://www.vureact.top/guide/customer-support-hub.html>
- [vureact.config.ts](./vureact.config.ts)
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
collapsible
@collapse="onCollapse"
width="224"
class="shell-sider"
class-name="shell-sider"
>
<div class="brand">
<AntTypographyTitle :level="4" class-name="title">Support Hub</AntTypographyTitle>
Expand Down Expand Up @@ -79,6 +79,7 @@ const userInitial = computed(() => userName.value.slice(0, 1).toUpperCase());

const menuItems = [
{ key: '/dashboard', label: '总览' },
{ key: '/conversations', label: '会话中心' },
{ key: '/tickets', label: '工单列表' },
{ key: '/customers', label: '客户管理' },
{ key: '/agents', label: '坐席管理' },
Expand Down
Loading
Loading