Coder Social home page Coder Social logo

regularjs / regular-devtools Goto Github PK

View Code? Open in Web Editor NEW
31.0 6.0 4.0 1.34 MB

Devtools for Regularjs

Home Page: https://chrome.google.com/webstore/detail/regular-developer-tools/ehlcoecgkhfjffhmdhmhbjkjjpaecmam

License: MIT License

JavaScript 90.34% HTML 0.31% CSS 9.35%
regularjs devtools

regular-devtools's People

Contributors

fengzilong avatar mejustme avatar zxc0328 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

regular-devtools's Issues

remove reference to Regular in inject.js

because Regular may not be available in global

var sanitize = function(store) {
    var str = JSON.stringify(store, function(key, value) {
        if (value instanceof Regular) {
            return;
        }
        return value;
    });
    return JSON.parse(str);
};

可以在webpack中使用么?

使用webpack开发,工具提示找不到Regular实例
主要代码如下:

import App from "./App";
import router  from "./router";
import restate   from "regular-state";

new App({
    data: {username: "leeluolee"}
}).$inject('#app');
restate()
    .state(router.routes) //完成路由节点注册
    .start({ html5: true ,view: document.getElementById('app')}); // 启动路由
```

Add filter for data

在组件数据很复杂的情况下,可以过滤数据来方便的查看自己关注的属性。

Add show component definition

跳转到Source面板中对应组件的定义位置,有时候需要打断点的话,可以快速定位到代码

New sidebar tab: Performance

可以在sidebar加一个Performance tab,可视化的展示显示选中组件整个组件树的watcher和stable watcher的数量情况。

Todo List

  1. UI升级。包括inspect按钮图标,背景色,边框颜色,高亮效果。
  2. 左侧element视图可以收起和打开组件树的各个层级
  3. 左侧element视图中把内嵌组件特殊显示,比如打开视觉父节点之后加一个背景色,类似DOM里的UA shadowdom的显示。
    4.右侧state视图可以打开和收起属性显示(非primitive的Object和Array可以打开和收起)。

some bug with highlighter

getDomNode is located in frontend/inject.js

sometimes call node.group.get(i) on root component doesn't return an ast element node but a regular instance, see example/jsonTree.html for example, and hover on Anonymous Component, throws Inspect Error

新增特性

在可行的前提下增加以下features:

  • 支持将组件的data或实例打印到控制台(参考vue-devtools + React-Devtools)

  • 支持按组件名字进行过滤(参考React-Devtools + vue-devtools)

  • 在右侧data处增加一栏events,用于记录event历史,并给每个event标记触发时间,支持清空

  • 如果一个组件没有定义name属性,使用在父组件中定义的名字,Parent.component( 'foo', bar ),比如这个例子中,使用foo,如果有其他未考虑到的匿名组件情形使用anonymous

  • 支持修改data并实时更新视图,支持undo(参考React-Devtools)

    可以用上面提到的第一个特性代替,将组件实例打印在控制台,用户手动修改data并调用$update,但这样交互会好些

@zxc0328 你的想法呢?

发布前的todo

  1. 前一个todo中未完成的
  2. 提供刷新功能
  3. (optional)从Elements tab切换到Regular tab时会自动选中DOM元素对应的组件
  4. 文档和博客

CircularJSON is not defined

an error shows up in console

Uncaught ReferenceError: CircularJSON is not defined

injectScript(chrome.extension.getURL('frontend/circular-json.js'), 'body');
injectScript(chrome.extension.getURL('frontend/inject.js'), 'body');

above code is from frontend/content.js

we should ensure circular-json.js is always executed before inject.js

Restructure files

src/devtools-ui

给extension和electron提供核心的界面,需要和chrome.* api和electron api解耦,打包到dist目录,和src/extensionsrc/electron组合后,在release目录生成chrome扩展和electron应用

src/extension

chrome扩展相关代码,如manifest.json, background.js, inject.js, regular.png...

src/electron

electron相关代码

@zxc0328 你觉得怎么样?

1.0版计划

  • include显示优化 一行 赵
  • 选中组件把实例输出到控制台 赵
  • tab组件 冯
  • data tab显示computed属性 冯
  • data属性可以编辑,页面组件更新 冯
  • others tab显示指令 filter 和动画 陈
  • 搜索组件 高亮 赵
  • 组件名 没有name属性则在parent上找 赵

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.