EZUIKit-JavaScript-npm icon indicating copy to clipboard operation
EZUIKit-JavaScript-npm copied to clipboard

是否可以去掉console、是否可以提供一个dispose销毁方法?是否提供一个闭包版本?

Open bestime opened this issue 4 years ago • 6 comments

  • 如题,多次复用封装组件,console.log信息太多了,是否可以提供一个参数屏蔽日志?
  • 需要一个销毁实例的方法
  • 全局变量、函数太多,是否考虑闭包?

bestime avatar Oct 14 '22 01:10 bestime

哎 我也遇到问题这个了,类似切换的项目,切换了,还在占内存,海康就没有靠谱点的前端工程师吗

maoxuanlong avatar Oct 24 '22 13:10 maoxuanlong

使用esbuild清除console之后,运行都运行不了了

tanhh326 avatar Jun 25 '23 08:06 tanhh326

提交工单哈

发件人: 鲨鱼辣椒 @.> 发送时间: 2023年6月25日 16:52 收件人: Ezviz-OpenBiz/EZUIKit-JavaScript-npm @.> 抄送: Subscribed @.***> 主题: Re: [Ezviz-OpenBiz/EZUIKit-JavaScript-npm] 是否可以去掉console、是否可以提供一个dispose销毁方法?是否提供一个闭包版本? (Issue #85)

使用esbuild清除console之后,运行都运行不了了

— Reply to this email directly, view it on GitHubhttps://github.com/Ezviz-OpenBiz/EZUIKit-JavaScript-npm/issues/85#issuecomment-1605951264, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD3TVUR2XHZIDTN65RD72RLXM734JANCNFSM6AAAAAAREZOCPA. You are receiving this because you are subscribed to this thread.Message ID: @.@.>>


本邮件及其附件含有萤石公司保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from EZVIZ, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!

Ezviz-Open avatar Jun 26 '23 02:06 Ezviz-Open

遇到的console问题

  1. 无法运行:vue项目,使用uglifyjs-webpack-plugin插件清空console,导致运行时 ezuikit.js L24387 ~ L24392绑定报错。
  2. 临时解决:取消插件uglifyjs-webpack-plugin的drop_console配置,修改全局console为空实现。

debug配置项

  1. ezuikit.js配置项:发现ezuikit.js 存在日志配置项 L24358,通过babel粗暴修改 L27693的 debug: "all" 可以关闭ezuikit.js内的日志;开启uglifyjs-webpack-plugin后运行正常。
module.exports = ({ types: t }) => {
  return {
    visitor: {
      ObjectExpression(path, state) {
        const node = path.node
        if (state.filename.includes("ezuikit-js") && node.properties.length === 2) {
          const property = node.properties[0]
          if (property.key.name === 'debug') {
            property.value.value = false
          }
        }
      },
    },
  };
};
  1. 新问题:jsPluginV1-1.0.0.min.js 中仍在打印日志,请问 jsPlugin是否有日志配置项 bJSPrintLog;若有,如何配置 ?: )

guangze233 avatar Jul 05 '23 11:07 guangze233

提交工单问下

发件人: guangzezhu @.> 发送时间: 2023年7月5日 19:01 收件人: Ezviz-OpenBiz/EZUIKit-JavaScript-npm @.> 抄送: OpenTeam @.>; Comment @.> 主题: Re: [Ezviz-OpenBiz/EZUIKit-JavaScript-npm] 是否可以去掉console、是否可以提供一个dispose销毁方法?是否提供一个闭包版本? (Issue #85)

遇到的console问题

  1. 无法运行:vue项目,使用uglifyjs-webpack-plugin插件清空console,导致运行时 ezuikit.js L24387 ~ L24392绑定报错。
  2. 临时解决:取消插件uglifyjs-webpack-plugin的drop_console配置,修改全局console为空实现。

debug配置项

  1. ezuikit.js配置项:发现ezuikit.js 存在日志配置项 L24358,通过babel粗暴修改 L27693的 debug: "all" 可以关闭ezuikit.js内的日志;开启uglifyjs-webpack-plugin后运行正常。

module.exports = ({ types: t }) => {

return {

visitor: {

  ObjectExpression(path, state) {

    const node = path.node

    if (state.filename.includes("ezuikit-js") && node.properties.length === 2) {

      const property = node.properties[0]

      if (property.key.name === 'debug') {

        property.value.value = false

      }

    }

  },

},

};

};

  1. 新问题:jsPluginV1-1.0.0.min.js 中仍在打印日志,请问 jsPlugin是否有日志配置项 bJSPrintLog;若有,如何配置 ?: )

— Reply to this email directly, view it on GitHubhttps://github.com/Ezviz-OpenBiz/EZUIKit-JavaScript-npm/issues/85#issuecomment-1621525455, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD3TVUWXEBAILBBAV4G2D6DXOVCNTANCNFSM6AAAAAAREZOCPA. You are receiving this because you commented.Message ID: @.@.>>


本邮件及其附件含有萤石公司保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from EZVIZ, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!

Ezviz-Open avatar Jul 06 '23 03:07 Ezviz-Open

这个库写的是真的烂,一堆console.log,还有报错,关键内存占用还高。真的服了,这东西还有脸拿出来给别人用。

refinec avatar Jan 23 '24 04:01 refinec