#  Gadget migration tool

## What is the migration tool?

With the migration tool, you can reduce gadget development cost by migrating some code of your WeChat or Dingding miniprogram to your Feishu gadget.

Through static grammar conversion, this tool helps Feishu recognize common APIs of WeChat or Dingding miniprogram so that they can run on Feishu.

Note that this tool cannot erase runtime differences or make an API from scratch. For this reason, you need to adapt some features based on the logs generated during conversion.

## How to use the migration tool

### Open the migration tool and select the type of app to be migrated

-   In the upper right corner of IDE, click "Migration Tool".
-   Select the app type: WeChat miniprogram or Dingding miniprogram.

![origin_img_v2_a6f64894-5675-440d-b1bd-2cbf6ed2617g.jpg](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/2f019e0a94c9b8dafaae163bdc7d052d_VBkMTenSEw.jpg?height=1212&lazyload=true&width=1518)

### Convert to Feishu gadget and debug
- Enter "the path to the project to convert" and "the directory of Feishu gadget after conversion", and click "OK" to start the conversion.
If you want to convert a WeChat miniprogram, ensure it has the "project.config.json" file. For details, see [WeChat mini-program: Tool Configuration](https://www.cnblogs.com/lizm166/p/9547816.html).

- After the conversion is complete, you can open the Feishu gadget project for debugging and development. You can also directly use the new Feishu gadget package.

-   If some components or APIs from the miniprogram are not supported by Feishu, a prompt of conversion failed will appear in the migration tool.

![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/c441d796b11e4782e65379f60219effd_xi2gkrCeHT.png?height=1464&lazyload=true&width=2806)

-   Click "Open." You can see that the code has been successfully converted, and the project can be edited and debugged.

### FAQ

Q: How do I convert a WeChat or Dingding miniprogram developed using a third-party framework?

A: (1) If your WeChat or Dingding miniprogram was developed using Taro or uniapp, you can directly develop a Feishu gadget using the [Taro framework](https://open.feishu.cn/document/uYjL24iN/uEzMzUjLxMzM14SMzMTN/develop-gadget-with-taro) or the [uniapp framework](https://open.feishu.cn/document/uYjL24iN/uEzMzUjLxMzM14SMzMTN/develop-gadget-with-uni-app). (2) If your WeChat or Dingding miniprogram was developed using another framework, you can import the framework using npm, complete the compilation, and then convert the gadget using the migration tool.

## Appendix What can the migration tool do for you?
Take a WeChat miniprogram as an example:

XML files

- Convert the path suffix to ttml
- Notify when built-in components are not supported by Feishu gadget
- Convert the suffix of the Import tag to ttml
- Convert the WXS tag to SJS

WXSS files

- Convert the path suffix to ttss
- Convert the @import path suffix to ttss

JS files

- Convert wx APIs to tt APIs
- Notify when some APIs are not supported

WXS files

- Convert the path suffix to sjs

JSON files

- Mount app.json usingComponents to the JSON file of each page
- Notify when the app.json useExtendLib field is not support

