Coder Social home page Coder Social logo

mustime / minipbjs Goto Github PK

View Code? Open in Web Editor NEW
25.0 2.0 6.0 169 KB

Having enough of the massive glue code generated by pbjs? Here's minipbjs. 受够了pbjs产生的巨量胶水代码吗?试试minipbjs!

JavaScript 27.38% TypeScript 72.62%
protobuf protobufjs pbjs minipbjs

minipbjs's People

Contributors

aghassi avatar mustime avatar

Stargazers

 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

minipbjs's Issues

初始化性能问题

目前一进入就会解析所有的message,这样如果message非常多,在手机性能稍差的机器上,耗时会比较久。可以考虑用到时再解析,保存到内存,判断有了就不再解析。不影响加载速度

对于不同的proto协议,生成的js代码中大量代码是重复的

您好,我尝试了用两种proto协议生成js代码,发现生成的文件中,大部分内容是重复的,差别主要集中在底部函数传入参数这边。能否将公共代码抽离出去,这样在多proto协议的时候能进一步压缩空间。
可能命令行需要支持一次性生成多个js文件,或者提供代码调用方式?

百忙之中打扰您,如有错误请指正~

Don't assume node_module pathing in CLI

let uglifyjsPath = path.join(__dirname, '..', 'node_modules', 'uglify-js');

This sort of logic is not necessary and can be broken easily in workspaces.

The better way to do this is just to use require.resolve since this is nodejs. require.resolve will pull the nearest version and then expand the path to the bin of the library you need and run it using the standard module resolution process.

Would you be open to a contribution to replace this logic so that it works out of box in more edge cases?

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.