GithubHelp home page GithubHelp logo

Comments (6)

aui avatar aui commented on August 27, 2024

查明是工具在编译前压缩处理有问题,已经修复,并且示例也放了一张图片。

模板引擎本身已经很稳定,也经历大大大小小的商业项目考验。编译工具刚刚由DEMO转为测试版,潜在的问题比较多。后面我会在商业项目中去检验他,逐步完善。

from art-template.

warmhug avatar warmhug commented on August 27, 2024

再提个优化建议:一个文件里多次include进同样的文件时候,会生成几个相同的依赖:

var dependencies = {
        "./include/_banner": require("./include/_banner"),
        "./include/waterfall": require("./include/waterfall"),
        "./include/waterfall": require("./include/waterfall")
};

例如有重复的waterfall依赖,虽然不会抛错,但毕竟不太好。。

from art-template.

aui avatar aui commented on August 27, 2024

好的,下次更新将优化。现在旅行途中,十天后回来处理此问题

from art-template.

warmhug avatar warmhug commented on August 27, 2024

再反馈个感觉比较严重的问题吧:

    var helpers = require("./$helpers");
    helpers.$render = function (id, data) {
        return dependencies[id](data);
    };

这个代码里的 dependencies 引用的对象 一直 是最后一次require进去的模块的 dependencies对象。例如:

    var a = require("./a");
    var b = require("./b");
    var c = require("./c");

如果在代码初始化时相继执行了以上三句,dependencies对象就会是c模块里的dependencies,而调用a,b都是执行的c里的dependencies,这个就直接造成错误了。这个应该是把helpers抽离出来,并且用了helper.$render方法的缘故,这方面的设计上是不是应该再斟酌一下?

from art-template.

aui avatar aui commented on August 27, 2024

确认是个Bug。我决定在模块返回的函数中重写helpers.$render引用,确保它在当前上下文中,明天将更新代码解决上面两个Bug

from art-template.

aui avatar aui commented on August 27, 2024

已经更新代码,问题解决

from art-template.

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.