Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

配置代码可直接编辑 #3

Closed
lifesinger opened this issue Jun 25, 2013 · 11 comments
Closed

配置代码可直接编辑 #3

lifesinger opened this issue Jun 25, 2013 · 11 comments
Labels

Comments

@lifesinger
Copy link
Member

debug 插件的核心功能,是给用户提供一个加载自定义 config 的可扩展点,目前所有自定义 config 信息,都需要存在一个本地文件里,并且需要 http server 来访问。

一个优化点是,利用本地存储,不再依赖 http server,直接弹出一个可编辑框让用户编辑即可。

还可以提供一个 config 模板文件出来,让常用功能,通过去除注释就可以开启。

@afc163
Copy link
Member

afc163 commented Jun 25, 2013

最好是有一些 checkbox,勾勾就能解决大多数问题。

@lifesinger
Copy link
Member Author

@afc163 嗯,一并考虑。等设计好后,找个周会看看大家的意见。

预计开发时间:7 月份

@lifesinger lifesinger mentioned this issue Jun 30, 2013
@noahlu
Copy link

noahlu commented Jul 4, 2013

debug只能适用get请求页面,post的不太方便,并且很多post页面,刷新重复提交是无效的。建议在debug的页面默认给链接和表单地址加上 seajs-debug 参数。

另外,在console里的配置可以存到页面url里。

@popomore
Copy link
Member

popomore commented Jul 4, 2013

原来是存 cookie 的,也就是会一直保持 debug 状态

---Sent from Boxer | http://getboxer.com

On 周四, 7月 04, 2013 at 11:24 下午, noahlu wrote:debug只能适用get请求页面,post的不太方便,并且很多post页面,刷新重复提交是无效的。建议在debug的页面默认给链接和表单地址加上 seajs-debug 参数。 另外,在console里的配置可以存到页面url里。 —Reply to this email directly or view it on GitHub.

@lifesinger
Copy link
Member Author

现在依旧存在 cookie 里的,有效期 30 天,因此只要加一次 seajs-debug 参数就好。

@lizzie
Copy link
Member

lizzie commented Aug 6, 2013

看了之前的 issue , 感觉 seajs-debug 需融合以下功能:

  • 输出 log
  • 保留插入的 script 元素
  • 给用户提供一个加载自定义 config 的可扩展点
  • 解 combo
  • 压缩代码换成源码
  • 模块关系图
  • nocache

有几个问题:

  • 由 seajs-log.js 提供的 当seajs.data.debug 为 true, 显示 seajs.log. 这个为何不直接放到 seajs-debug 里, 而另外拆出到 sejs-log.js 中? 我觉得 log 信息就是该在 debug 状态显示啊, 线上没必要显示.
  • 原先的方式, 通过配置一个本地服务器上的 config.js, 通过设置 map 来映射到本地来调试, 其实我不觉得这个很麻烦. 如果直接在页面上显示输入框来定义映射, 就更方便
  • 模块关系图, 为何不放到 health 里?
  • nocache 感觉还是可以通过 map 来解决, 所以貌似在 seajs-debug 中不是必要.

@lifesinger , 是否要精简下需求? 我觉得方便开发者调试的功能够用就好了. 不是非常必要的就不加了.

@lifesinger
Copy link
Member Author

输出 log

sea-log.js 有可能线上需要的,这样线上代码,可以直接使用 seajs.log 而无需担心出错。输出 log 的需求,可以通过 url 中添加 ?seajs-log&seajs-debug 来达成。

保留插入 script 元素

当 debug 为 true 时,就会保留。

给用户提供一个加载自定义 config 的可扩展点

嗯,这个是最主要的功能点。有了这个,其他功能都可以基于 config 来实现。

解 combo

目前可通过下面的配置来实现

seajs.config({
  comboExcludes: /\.js/
})

压缩代码换成源码

目前可通过下面的配置来实现

seajs.config({
  map: [
     function(url) {
        // 将 url 中的所有非 -debug.js 替换为 debug.js
     }
  ]
})

模块关系图

这个放到 seajs-health 插件中去做,debug 中不做

nocache

这个可以放 debug 插件做

@lifesinger
Copy link
Member Author

核心需求就是

原先的方式, 通过配置一个本地服务器上的 config.js, 通过设置 map 来映射到本地来调试, 其实我不觉得这个很麻烦. 如果直接在页面上显示输入框来定义映射, 就更方便

让 config.js 的内容可直接在页面中编辑,不需要放到本地文件中。

把这个实现后,然后优化界面,将常用功能以更便捷的方式提供出来(比如 checkbox 等)。

@popomore
Copy link
Member

popomore commented Aug 8, 2013

我觉得比较重要的功能

  1. 解 combo,很多人问到这个。
  2. 默认将文件换成 -debug,这个是最实用的功能,能解决 80% 的需求,而且很多人不会写 map。
  3. 输入框自定义 config,除了 map 应该还可以配别的,输入后可替换默认的 map(上一条),而且这个应该支持更简单的方式。
  4. nocache,调试的时候很方便,虽然不是必要但可以加个 checkbox 选择,能不写 map 最好不写。

之前请求 config.js 方式还有个问题,线上 https 是无法访问本地 http 服务的,会被阻止

@lifesinger
Copy link
Member Author

debug 插件乔花跟进,直接修改 seajs/sea-debug 库。

新界面、功能设计好后,先让贯高、小高、偏右和我看下,讨论下。

@lizzie
Copy link
Member

lizzie commented Feb 7, 2014

这个可以关了. seajs-debug@1.1.1

@lizzie lizzie closed this as completed Feb 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants