Giter Club home page Giter Club logo

Comments (24)

leeight avatar leeight commented on June 26, 2024

有js报错么?发svn地址或者git地址。发edp -v的输出

from er.

virola avatar virola commented on June 26, 2024

·
edp -v
[email protected] C:\Users\virola\AppData\Roaming\npm\node_modules\edp
Builtin Commands:
edp-config (1.0.2)
edp-core (1.0.28)
edp-build (1.0.14)
edp-package (0.5.6)
edp-project (0.6.1)
edp-webserver (1.0.16)

User Commands:
edpx-add (1.0.3)
edpx-ws (0.0.2)
·

刚试了下,确认是tplMerge的问题,如果没有merge模板,就能切换正常

from er.

Justineo avatar Justineo commented on June 26, 2024

@virola 还在用 ER,真爱啊哈哈……

from er.

virola avatar virola commented on June 26, 2024

@Justineo 是啊,用这个最快,学新的framework太难啊。
我直接用er做移动端了,也不知有木有坑

from er.

leeight avatar leeight commented on June 26, 2024

@virola 你已经不再百度了?

from er.

virola avatar virola commented on June 26, 2024

@leeight 是啊,所以没法给你发svn/git地址啊,不过你可以找个项目试下在edp-build-config里加一个

    var tplMerge = new TplMerge({
        outputType: 'js'
    });

build看看效果

from er.

otakustay avatar otakustay commented on June 26, 2024

是切换次数多了,还是切换得很快导致的?

from er.

leeight avatar leeight commented on June 26, 2024

@firede 雷哥可以接客了

from er.

firede avatar firede commented on June 26, 2024

@virola 我不懂 ER 呀,要不你试试这个:http://ecomfe.github.io/saber/

from er.

virola avatar virola commented on June 26, 2024

@leeight PC上也是同样的问题

from er.

virola avatar virola commented on June 26, 2024

@otakustay 不是切换很快, 是切换几次(也有点一两次),就开始渲染不了了,或者有的能点有的不能点。模板合并成1个的时候才这样

from er.

jinzhubaofu avatar jinzhubaofu commented on June 26, 2024

看一下生成的tpl,需要的target是不是都在

from er.

virola avatar virola commented on June 26, 2024

@jinzhubaofu target没有问题,页面都能render一次,就是之后再点进来就没有render;但也不是所有view都这样,有的会渲染有的不会渲染

from er.

jinzhubaofu avatar jinzhubaofu commented on June 26, 2024

打开all exceptions pause那个定位下吧…

from er.

otakustay avatar otakustay commented on June 26, 2024

我会争取明天写个简单的项目试试……

先确认下,TplMergeoutputType不是js的时候是好的?

from er.

virola avatar virola commented on June 26, 2024

@otakustay 嗯,文档貌似有说pluginId和outputType一起用才起作用,所以这里写了outputType: js也没有影响最终tpl.html的输出

from er.

virola avatar virola commented on June 26, 2024

会不会是因为build-config处理器顺序问题?
我昨天把tplMerge写在 jsCompressor后面了,像这样:

var moduleEntries = 'html,htm,phtml,tpl,vm,js';
var pageEntries = 'html,htm,phtml,tpl,vm';

exports.getProcessors = function () {
    var lessProcessor = new LessCompiler({
        entryExtnames: pageEntries
    });
    var cssProcessor = new CssCompressor();
    var moduleProcessor = new ModuleCompiler({
        configFile: 'module.conf',
        entryExtnames: moduleEntries
    });
    var jsProcessor = new JsCompressor();
    var pathMapperProcessor = new PathMapper({
        replacements: [
            { type: 'html', tag: 'link', attribute: 'href', extnames: pageEntries },
            { type: 'html', tag: 'img', attribute: 'src', extnames: pageEntries },
            { type: 'html', tag: 'audio', attribute: 'src', extnames: pageEntries },
            { type: 'html', tag: 'script', attribute: 'src', extnames: pageEntries },
            { extnames: 'html', replacer: 'module-config' },
            { extnames: 'less,css', replacer: 'css' }
        ],
        from: 'src',
        to: 'asset'
    });
    var addCopyright = new AddCopyright();

    var tplMerge = new TplMerge({
        outputType: 'js'
    });

    return {
        'debug': [ lessProcessor, moduleProcessor, pathMapperProcessor ],
        'default': [
            lessProcessor, cssProcessor, moduleProcessor,
            jsProcessor, 
            tplMerge, 
            pathMapperProcessor, addCopyright
        ]
    };
};

刚刚试了下把 tplMerge 放到 moduleProcessor 前面,然后也把各个view里面require的tpl都提到入口文件里面,这样build出来是没问题的

from er.

otakustay avatar otakustay commented on June 26, 2024

只用outputType其实最后生成的还是.tpl.html,而不是一个.js,我们这边的项目都是合并模板为一个HTML的,一直没有问题

@virola 能不能确认下你们build后的模板到底是HTML还是js?

Best regards

Gray Zhang

在 2015年2月3日 下午1:53:04, Virola ([email protected]) 写到:

会不会是因为build-config处理器顺序问题?
我昨天把tplMerge写在 jsCompressor后面了,像这样:

var moduleEntries = 'html,htm,phtml,tpl,vm,js';
var pageEntries = 'html,htm,phtml,tpl,vm';

exports.getProcessors = function () {
var lessProcessor = new LessCompiler({
entryExtnames: pageEntries
});
var cssProcessor = new CssCompressor();
var moduleProcessor = new ModuleCompiler({
configFile: 'module.conf',
entryExtnames: moduleEntries
});
var jsProcessor = new JsCompressor();
var pathMapperProcessor = new PathMapper({
replacements: [
{ type: 'html', tag: 'link', attribute: 'href', extnames: pageEntries },
{ type: 'html', tag: 'img', attribute: 'src', extnames: pageEntries },
{ type: 'html', tag: 'audio', attribute: 'src', extnames: pageEntries },
{ type: 'html', tag: 'script', attribute: 'src', extnames: pageEntries },
{ extnames: 'html', replacer: 'module-config' },
{ extnames: 'less,css', replacer: 'css' }
],
from: 'src',
to: 'asset'
});
var addCopyright = new AddCopyright();

var tplMerge = new TplMerge({
    outputType: 'js'
});

return {
    'debug': [ lessProcessor, moduleProcessor, pathMapperProcessor ],
    'default': [
        lessProcessor, cssProcessor, moduleProcessor,
        jsProcessor,  
        tplMerge,  
        pathMapperProcessor, addCopyright
    ]
};

};

刚刚试了下把 tplMerge 放到 moduleProcessor 前面,然后也把各个view里面require的tpl都提到入口文件里面,这样build出来是没问题的


Reply to this email directly or view it on GitHub.

from er.

virola avatar virola commented on June 26, 2024

@otakustay 恩,是的,我们也是build之后用.tpl.html,模板用的etpl,没用esui

from er.

otakustay avatar otakustay commented on June 26, 2024

这事没有试出来……因为我们的项目就是build为一个文件的,但始终没出现这情况

你是否能给我可运行的源码之类的来辅助下问题排查……我比较怀疑是某个Action的dispose出了问题之类的

from er.

virola avatar virola commented on June 26, 2024

@otakustay https://github.com/virola/demo-project 这个,build之后,点击首页随便那个button,再点logo回首页,再点其他button就会出现这种情况了

from er.

otakustay avatar otakustay commented on June 26, 2024

搞定了,esl的一个BUG,和我这边曾经遇到过的问题一样,已经让 @errorik 修复过了,你改用2.0.4的esl就好了

from er.

otakustay avatar otakustay commented on June 26, 2024

顺便给下对应的Issue:ecomfe/esl#35

在这之前我们一直用的esl是1.x版本正好就没事,上周转到2.0.2发现的这问题及时给搞了

from er.

virola avatar virola commented on June 26, 2024

soga! 没想到最后是因为esl的bug... = = 切换2.0.4现在可以了~

from er.

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.