• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

preactjs/preact-devtools: Browser extension for inspection Preact applications

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

preactjs/preact-devtools

开源软件地址:

https://github.com/preactjs/preact-devtools

开源编程语言:

TypeScript 84.6%

开源软件介绍:

Preact Devtools

Browser extension that allows you to inspect a Preact component hierarchy, including props and state.

Requires Preact >=10.1.0

Screenshot of Preact devtools

Usage

Firstly, we need to import preact/debug somewhere to initialize the connection to the extension. Make sure that this import is the first import in your whole app.

// Must be the first import
import "preact/debug";

// Or if you just want the devtools bridge (~240B) without other
// debug code (useful for production sites)
import "preact/devtools";

Then, download the Preact Devtools extension for your browser:

Contributing

  • Use npm run dev to start a demo page
  • Use npm run watch to rebuild all extensions on any code changes
  • Use npm run build:firefox or npm run build:chrome to create a release build

Chrome:

  1. Go to extensions page
  2. Enable developer mode
  3. Click "Load unpacked"
  4. Select dist/chrome/ folder

Firefox:

  1. Go to addons page
  2. Click the settings icon
  3. Select "Debug addons"
  4. Click "Load temporary addon"
  5. Select the manifest.json in dist/firefox/

For extension reviewers

These commands will build the extension and load it into a browser with a temporary profile. The browser will automatically navigate to preactjs.com. There you can test the extension.

Chrome:

  1. Execute npm run run:chrome
  2. Click on Preact tab in devtools

Firefox:

  1. Exectue npm run run:firefox
  2. Open devtools + click on Preact tab in devtools



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap