跪拜 Guibai
← All articles
Backend

Tencent Open-Sources tmagic-editor: Drag-and-Drop Visual Page Builder for H5, PC, and TV

By 皮皮林551 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

tmagic-editor gives any team a working blueprint for a low-code page platform, separating reusable components from page composition via a serializable DSL. Its pluggable runtimes for vue2, vue3, and react mean teams can adopt it without committing to a new framework.

Summary

Tencent has released tmagic-editor as open source, a visual page editor that turns drag-and-drop configuration into deployable H5, PC, and TV pages. The editor renders a WYSIWYG canvas inside an iframe, so the editing environment and the page runtime can be built with different front-end frameworks. tmagic-editor ships runtimes for vue2, vue3, and react, and a business can extend it to other frameworks by writing a new runtime.

The production flow splits into three stages: component development, page arrangement, and save/publish. Business components are written by the team using tmagic-editor; the editor itself provides no business components. Once components exist, non-technical staff drag them onto the canvas, configure them, and save a page description as a serialized JS object following a JS schema. Publishing then builds that schema into html/js/css via the chosen runtime and deploys the artifacts to the business's own servers.

Along with the editor and runtimes, tmagic-editor includes an admin demo for page list management, AB testing, and publish status. The project has been running inside Tencent for several businesses, including Tencent Video VIP and Tencent Meeting, producing hundreds of pages monthly. Teams adopting it must self-host the platform and manage their own component libraries.

Takeaways
— tmagic-editor is Tencent's open-source WYSIWYG page editor for building H5, PC, and TV pages via drag-and-drop.
— The editor produces a serialized JS object (JS schema) as the page description, decoupling the editor from the final page.
— Official runtimes cover vue2, vue3, and react; other frameworks require writing a custom runtime.
— Business components are not included; teams must develop their own components, which can be written in any framework.
— The admin demo provides page list management, AB testing, and publish status.
— Tencent uses tmagic-editor in over a dozen businesses, producing hundreds of pages monthly.
Conclusions

The iframe-based simulator allows the editor platform and the page runtime to use different frameworks, a design that keeps the tool flexible but also pushes the maintenance burden of a custom runtime onto adopters.

By leaving business components out of the core, tmagic-editor forces teams to invest in a component library before it delivers value, which is likely why it fits Tencent's internal scale but may slow smaller adopters.

The DSL-driven approach means page definitions are plain data, making version control and automated testing of page configurations feasible.

Concepts & terms
runtime
In tmagic-editor, a runtime is the execution environment that renders a visual page, either inside the editor's iframe simulator or in a user's browser. It also serves as the packaging context for building the final page artifacts. Separate runtimes can be implemented for different front-end frameworks.
JS schema
The page description generated by tmagic-editor is a serialized JavaScript object that conforms to a schema. It holds the page's basic information, the components it contains, and the logic between them, acting as the interface between the editor and the final rendered page.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗