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

now.js 迷你版发布 #4

Open
hongmaoxiao opened this issue Dec 23, 2017 · 0 comments
Open

now.js 迷你版发布 #4

hongmaoxiao opened this issue Dec 23, 2017 · 0 comments

Comments

@hongmaoxiao
Copy link
Owner

迷你版

迷你版即0.3.0版。

0.2.0版没加新功能,只增加eadme内容和修正package.json上的一些错误。

0.3.0同样没加新功能,但是却是非常重要的。

这个版本国际化默认只支持英文和中文。初始化是英文。如果想支持全部118种语言,需要引入nowjs.locale.js或者压缩版nowjs.locale.min.js

版本大小比较

~/learn/ljs/now master
❯ ll -h dist | grep js$
-rw-rw-r-- 1 mao mao  66K 12月  5 00:37 nowjs.js
-rw-rw-r-- 1 mao mao 355K 12月  5 00:37 nowjs.locale.js
-rw-rw-r-- 1 mao mao 212K 12月  5 00:37 nowjs.locale.min.js
-rw-rw-r-- 1 mao mao  32K 12月  5 00:37 nowjs.min.js

可以看出,nowjs.jsnowjs.locale.js小289kb,降低81.4%。nowjs.min.jsnowjs.locale.min.js减小180kb,降低84.9%。相当可观。完全可以放心在生产环境中使用而不担心加载速度问题。

结语

准备把min版加到cdn中。

还有很多可以优化的地方:

  1. 调整format的写法。
  2. 降低代码冗余。
  3. 优化文件组织方式。
  4. 增加一些新的功能等等。

有人给我点赞我很开心,现在已经有5个赞了(哈哈哈,我无耻的自己点了一个)。

最后还是放个链接github地址npm地址

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant