mtjs / mt Goto Github PK
View Code? Open in Web Editor NEWmt code
License: MIT License
mt code
License: MIT License
rt,node 和 java版都有,想问下,这种问题如何解决?
希望详细一下 便于学习 谢谢
貌似没有搜到
讨论一下:
我看了打包的代码,会调用Uglify.minify对代码进行合并压缩,在这个过程中UglifyJS会进行变量名替换。
这样的可能结果是,如下代码:
var xxx = 1;
var yyy = 2;
var zzz = 3;
变量名替换后为:
var a = 1,
b = 2,
c = 3;
而修改代码为:(只改动了一行代码)
var yyy = 2;
var zzz = 3;
后,其对应的变量名替换后代码生成为:
var a = 2,
b = 3;
这意味着变量名替换后的代码中所有用到变量yyy、zzz的地方都变成了a、b(老代码中是b、c),即所有用到该变量的块(切片后的chunk)都会因此被认为是新块。即一行代码的改动,因为变量名替换行为,导致了比实际更大的增量计算结果。
考虑这些,若算法不改变,不对最终代码进行变量名替换会不会在客户端反而获得更好的体验。
或者考虑改进算法(增量计算/变量名替换的算法)
https://github.com/nighca/diff-merge/blob/master/lib/myers-compare.js
https://neil.fraser.name/software/diff_match_patch/myers.pdf
如何面对LS的5M限制?
是否还有维护
是否还能作用, 适用当前场景
如果不适用, 则有无替代方案
新的增量版本号从哪里来,需要请求接口吗 ?
开始前先说一下感谢的话:),最近有一些朋友给我发了很多关于mt的改进建议,其中有@nighca @yulongheli 两位同学都给除了增量更新改进算法建议,@nighca同学甚至还写出了实现,@yulongheli则给出了使用过程中的很多建议,在这里特别感谢这两位同学。
下面进入正题,说下我们2.0的要加进来的一些特征:
1.增加本地存储满的异常回调,便于业务自己按自己的规则清理本地存储
2.增加统计回调,方便业务统计有多少js请求走了本地存储,增量更新,全量更新,以评估
带来的流量节省
3.增量更新算法增加基于lcs的diff,merge协议支持
4.增量更新支持combo增量更新,即支持一个请求增量更新几个js
5.更加强大的demo,会用到手腾自有的spa小模块pm:)
暂时就是这些了,欢迎大家提更多的意见:)
还是天生就支持?
发现下载后的demo是有问题的,比如编译文件的时候写死了一个需要zepto.min.js的文件,注释掉zepto.min.js后才能顺利编译通。,在试用java的中的代码时候会出现代码计算错位的问题,导致js load回来报错!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.