Giter Club home page Giter Club logo

Comments (2)

itsnoteasytonameaccount avatar itsnoteasytonameaccount commented on August 19, 2024

不建议这样做吧。
使用某项技术是为了解决特定问题,而不应该为了使用技术而使用技术。
当前工程结构虽然看似原始了点,但我觉得蛮好的,启动也方便,没必要使用vue吧。

我认为引入vue是有如下缺点的:

  1. 引入vue runtime无端增加运行的代码体积,工程复杂化,视情况需要引入打包器
  2. 可能引起性能的劣化,这类框架实际上相对原生代码实现界面性能是更差的,相当于是用一部分性能换取更清晰的工程组织方式、以及一些编写更简洁的语法糖
  3. 大量的重构工作量

如果使用vue编写部分组件带来的好处能超过上述缺点那我也支持使用,但如果没有好处的话,我建议不要这样做,另建一个分支或者自己试试可以,还是不要合入主干吧

from noname.

nonameShijian avatar nonameShijian commented on August 19, 2024

不建议这样做吧。
使用某项技术是为了解决特定问题,而不应该为了使用技术而使用技术。
当前工程结构虽然看似原始了点,但我觉得蛮好的,启动也方便,没必要使用vue吧。

我认为引入vue是有如下缺点的:

  1. 引入vue runtime无端增加运行的代码体积,工程复杂化,视情况需要引入打包器
  2. 可能引起性能的劣化,这类框架实际上相对原生代码实现界面性能是更差的,相当于是用一部分性能换取更清晰的工程组织方式、以及一些编写更简洁的语法糖
  3. 大量的重构工作量

如果使用vue编写部分组件带来的好处能超过上述缺点那我也支持使用,但如果没有好处的话,我建议不要这样做,另建一个分支或者自己试试可以,还是不要合入主干吧

主分支代码中直接使用vue文件确实会这样导致性能问题和重构问题。但是就目前来说,vue的引入我是更想让其应用于扩展文件(extension)。

目前如果你使用的是我提供的客户端或者使用noname-server.exe(一些特性还在测试中。不久后会更新官方的客户端来让所有人使用新特性),你可以直接import一个css,ts,json,vue文件,就像是在一个vue工程中那样。

但由于项目的更新方式(离线更新),这些新特性并不是主分支将来所急着去用的,反而是可以让扩展(extension)能更标准,便捷的编写。

以ui扩展为例子,目前的ui扩展,十周年ui等,其写法和主分支的某个特定版本过分藕合绑定。我打算写一套逻辑特定但ui可以自由切换为其他样式(目前的ui扩展大多都不互相兼容)的扩展用作此类美化扩展的标杆。

至于性能方面:
主分支加入了vue的runtime文件但是目前没有加载,所以在没有扩展主动加载的情况是不会有大的性能问题的。
目前确实加入了编译vue(sfc)和typeScript的代码,但是其运行在service worker,也不需要过于担心性能问题,虽然旧的客户端无法加载service worker

from noname.

Related Issues (20)

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.