GithubHelp home page GithubHelp logo

fex-team / fis3-jello Goto Github PK

View Code? Open in Web Editor NEW
62.0 62.0 17.0 12 KB

基于 fis3 针对 jsp/velocity 模板的前端工程解决方案

License: BSD 3-Clause "New" or "Revised" License

JavaScript 100.00%

fis3-jello's People

Contributors

2betop avatar lienjun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fis3-jello's Issues

跨模块require的js的moduleId多了.js

我有两个工程模块,namespace分别是common和home,其余fis配置均与脚手架一致。
我在home模块的某个js(a.js)中require了common模块的某个js(b.js)。

// a.js:
var b = require('common:widget/b.js');

执行fis3 release之后,js文件的moduleId都是不带.js后缀的。
我看了看:

  1. 页面中require.config({paths:...})部分没有什么问题
  2. b.js自动加了define('common:widget/b', ['require', 'exports', 'module'], function....也没有问题
  3. 但是a.js内部对于b.js的引用moduleId后面都多了个.js
// release后的a.js
define('home:widget/a', ['require', 'exports', 'module', 'common:widget/b.js'], function...{
    var b = require('common:widget/b.js');
}

结果就是js报错,请求不到common:widget/b.js文件,我手动把release之后多余的两个.js删掉就运行正常了

velocity语法报错

# define($vmRightPageContent) vm中使用了 ’define‘定义一个变量,但是fis3 server启动后访问报错 org.apache.velocity.exception.VelocityException: parameter missing: block name at /page/dashboard.vm[line 11, column 1]

定义变量

#set($brandConfig={
"brandName":"xxx",
"logoUrl":"logo_2.png",
"langSelectP":"fr"
})

报错

org.apache.velocity.exception.ParseErrorException: Encountered "object" at /common/brandConfig.vm[line 5, column 30]

Was expecting one of:
"[" ...
"]" ...
"{" ...
...
<STRING_LITERAL> ...
"true" ...
"false" ...
<INTEGER_LITERAL> ...
<FLOATING_POINT_LITERAL> ...
...
"{" ...
...
...
"{" ...
<INTEGER_LITERAL> ...

这些在java后台环境都是可用的,是那里没有配置对么?

运行fis3-jello demo ,页脚会生成如下paths,但自己的项目么有生成,需要特殊配置吗?

require.config({
    paths: {
        "components/bootstrap/affix": "/static/components/bootstrap/affix",
        "components/bootstrap/alert": "/static/components/bootstrap/alert",
        "components/bootstrap/bootstrap": "/static/components/bootstrap/bootstrap",
        "components/bootstrap/button": "/static/components/bootstrap/button",
        "components/bootstrap/carousel": "/static/components/bootstrap/carousel",
        "components/bootstrap/collapse": "/static/components/bootstrap/collapse",
        "components/bootstrap/dropdown": "/static/components/bootstrap/dropdown",
        "components/bootstrap/modal": "/static/components/bootstrap/modal",
        "components/bootstrap/popover": "/static/components/bootstrap/popover",
        "components/bootstrap/scrollspy": "/static/components/bootstrap/scrollspy",
        "components/bootstrap/tab": "/static/components/bootstrap/tab",
        "components/bootstrap/tooltip": "/static/components/bootstrap/tooltip",
        "components/bootstrap/transition": "/static/components/bootstrap/transition",
        "components/jquery/jquery": "/static/components/jquery/jquery"
    }
})

想弄清楚namespace的应用场景

我现在对namespace的概念比较模糊,用了一下namespace,主要是把项目的公共部分提出来做为一个子项目,设置namespace为common,首页做为一个子项目设为home,但是用的时候发现一个问题,我把公共部分的样式、js放到namespace为common的子项目中,home想用的时候就直接引用,一些js可以,但是引用scss的一些mixins这种需要编译的文件就不行了。能否告知namespace是如何应用于项目中的,又是如何产生的。

fis3 server start jello-demo失败

fis3 server start

[INFO] Currently running fis3 (C:\Users\libiqi\AppData\Roaming\npm\node_modules\fis3)

[INFO] Shutdown with pid [8076]
checking java support : v1.7.0
starting fis-server ..... fail
ʮһ�� 13, 2015 1:02:13 ���� org.apache.coyote.AbstractProtocol init
��Ϣ: Initializing ProtocolHandler ["http-bio-8080"]
ʮһ�� 13, 2015 1:02:14 ���� org.apache.catalina.core.StandardService startInternal
��Ϣ: Starting service Tomcat
ʮһ�� 13, 2015 1:02:14 ���� org.apache.catalina.core.StandardEngine startInternal
��Ϣ: Starting Servlet Engine: Apache Tomcat/7.0.50
ʮһ�� 13, 2015 1:02:14 ���� org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
��Ϣ: No global web.xml found

[ERROR] timeout

如何在生成script标签上属性

需求是这样的
1、用的
`#script()
require("./hotCar")

end`

引用了一个js文件,但我想在页面渲染出来的时候给这个script标签上加一个属性,如data="type"
2、hotCar.js在生产环境会被合并到pkb/common.js里,那如果给common.js也加上data="type"属性呢
求解

fis3-jello自定义标签

fis3-jello自定标签的实现类放在什么地方?<%@ taglib uri="/fis" prefix="fis"%>这一行。联调时把本地代码编译发布到rd开发环境下。rd的开发环境并没有自定义标签的实现类,请问这块应该怎么不熟,把我本地的WEB-INF下的lib复制一份到rd环境中?

linux下安装出错

fis3 -v

[INFO] Currently running fis3 (/home/saas/node/0.12.7/lib/node_modules/fis3)

v3.2.1

cnpm install -g fis3-jello
\

[email protected] install /home/saas/node/0.12.7/lib/node_modules/fis3-jello/node_modules/fis-parser-sass/node_modules/fis-sass
node build.js

Downloading http://fisstatic.duapp.com/addons/fis-sass/3.1.0/linux-x64/0.12.0/binding.node ...
Received 513K...
Received 1026K...
Received 1539K...
Received 1753K total.
Test failed!
child_process: customFds option is deprecated, use stdio instead.
make: Entering directory /home/saas/node/0.12.7/lib/node_modules/fis3-jello/node_modules/fis-parser-sass/node_modules/fis-sass/build' CXX(target) Release/obj.target/binding/src/binding.o ../src/binding.cpp: In function ‘Sass_Import** sass_importer2(const char*, const char*, void*)’: ../src/binding.cpp:27: 警告:实参为 NULL,需要非 NULL 值(实参 1) ../src/binding.cpp:28: 警告:实参为 NULL,需要非 NULL 值(实参 1) ../src/binding.cpp: In function ‘void GetStats(v8::Handle<v8::Object>, Sass_Context*)’: ../src/binding.cpp:95: 错误:‘nullptr’在此作用域中尚未声明 make: *** [Release/obj.target/binding/src/binding.o] 错误 1 make: Leaving directory/home/saas/node/0.12.7/lib/node_modules/fis3-jello/node_modules/fis-parser-sass/node_modules/fis-sass/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/saas/node/0.12.7/lib/node_modules/cnpm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 2.6.32-573.3.1.el6.x86_64
gyp ERR! command "node" "/home/saas/node/0.12.7/lib/node_modules/cnpm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/saas/node/0.12.7/lib/node_modules/fis3-jello/node_modules/fis-parser-sass/node_modules/fis-sass
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
Build failed
npm ERR! Linux 2.6.32-573.3.1.el6.x86_64
npm ERR! argv "node" "/home/saas/node/0.12.7/lib/node_modules/cnpm/node_modules/.bin/npm" "--userconfig=/home/saas/.cnpmrc" "--disturl=https://npm.taobao.org/mirrors/node" "--cache=/home/saas/.cnpm" "--registry=https://registry.npm.taobao.org" "--node-gyp=/home/saas/node/0.12.7/lib/node_modules/cnpm/node_modules/node-gyp/bin/node-gyp.js" "install" "-g" "fis3-jello"
npm ERR! node v0.12.7
npm ERR! npm v2.14.5
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node build.js'.
npm ERR! This is most likely a problem with the fis-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls fis-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/saas/node/0.12.7/npm-debug.log

fis2 jello 项目更新fis3后,vm路径出错。

HTTP Status 500 - Request processing failed; nested exception is org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'page/index/page/include/base.vm'

type Exception report

message Request processing failed; nested exception is org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'page/index/page/include/base.vm'

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'page/index/page/include/base.vm'
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:965)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause

org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'page/index/page/include/base.vm'
    org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:474)
    org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:352)
    org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1533)
    org.apache.velocity.runtime.directive.Parse.render(Parse.java:197)
    com.baidu.fis.velocity.directive.AbstractInclude.render(AbstractInclude.java:237)
    com.baidu.fis.velocity.directive.Extends.doRender(Extends.java:100)
    com.baidu.fis.velocity.directive.Extends.render(Extends.java:47)
    org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
    org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
    org.apache.velocity.Template.merge(Template.java:356)
    org.apache.velocity.Template.merge(Template.java:260)
    org.springframework.web.servlet.view.velocity.VelocityView.mergeTemplate(VelocityView.java:517)
    org.springframework.web.servlet.view.velocity.VelocityView.doRender(VelocityView.java:462)
    org.springframework.web.servlet.view.velocity.VelocityView.renderMergedTemplateModel(VelocityView.java:291)
    org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:167)
    org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:264)
    org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1201)
    org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:986)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:933)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:851)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.59 logs.

Apache Tomcat/7.0.59

是不是需要对vm设置路径?

产出的路径 跟fis2 没区别。
fis2 的时候 读取地址'page/include/base.vm' fis3 变成 'page/index/page/include/base.vm' 增加了当前vm所在路径的地址

fis3 server stop 没有效果

昨天看到大神提交代码了,激动的下载下来用。现在有个问题就是
fis3 server stop 没有效果

C:\jello>fis3 server stop

 [INFO] Currently running fis3 (C:\work\nodejs\npm-global\node_modules\fis3\)

 [WARNI] The server is not runing.

运行fis3 server start报错

C:\Users\58\AppData\Roaming\npm\node_modules\fis3\lib\log.js:201
    throw err
          ^
Error: fis-server fails to start at port [8080], error: com.baidu.
pListener
    at Object.exports.error (C:\Users\58\AppData\Roaming\npm\node_
ib\log.js:192:11)
    at Socket.<anonymous> (C:\Users\58\AppData\Roaming\npm\node_mo
lo\node_modules\fis3-server-jello\vendor\server.js:123:15)
    at Socket.emit (events.js:107:17)
    at readableAddChunk (_stream_readable.js:163:16)
    at Socket.Readable.push (_stream_readable.js:126:10)
    at Pipe.onread (net.js:538:20)

另:关于jello方面使用的案例有可供参考的例子么有捏。

windows下面server.conf配置不生效,mac下正常

1.确定在当前项目目录使用fis3 server start启动服务,页面显示
/
static
test
WEB-INF

发现jello有默认设置fis.set('server.type', 'jello');

2.使用fis3 server start --type jello 启动

页面正常打开,但是页面中所有的ajax转发仍然404,server.conf不生效

上述配置在mac中都是正常的

执行 fis3 init jello-demo 报错

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:116:14)
gyp ERR! stack at D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:71:11
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "D:\Program Files\nodejs\node.exe" "D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd F:\study\fis3-jello\jello-demo\node_modules\fis3-jello\node_modules\fis-parser-sass\node_modules\fis-sass
gyp ERR! node -v v4.1.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
Build failed
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\Program Files\nodejs\node.exe" "D:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v4.1.1
npm ERR! npm v2.14.4
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node build.js'.
npm ERR! This is most likely a problem with the fis-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls fis-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! F:\study\fis3-jello\jello-demo\npm-debug.log
Installing components...

[ERROR] unable to load plugin [fis3-jello] or [fis-jello]

Done!

可以帮我看看是啥原因么?

widget下同名的scss文件没有加载

widget下同名的scss文件没有加载,fis2-jello没有这个问题,可以直接运行jello-demo来验证这个问题。,访问/be/spring,请求了sidebarmenus.js,但是没有加载sidebarmenus.css。

spring-boot集成

Settings.DEFAULT_PATH不能自定义,当然幸好不是final的
顺便吐槽一下日志都是sysout的.......以及各种写死的WEB-INF

解析出来的依赖路径是两反斜杠!

"cfq:widget/login/login.js": {
            "uri": "/static/cfq/widget/login/login.js",
            "type": "js",
            "extras": {
                "moduleId": "cfq:widget/login/login"
            },
            "deps": [
                "common:components\\zepto-1.1.4\\zepto.js",
                "common:static\\arrow\\base\\base.js",
                "common:static\\arrow\\validate\\validate.js",
                "common:static\\arrow\\form\\form.js",
                "common:static\\arrow\\info\\info.js"
            ]
        }

mac上server start出错

mac os x yosemite, 版本10.10.5, java8环境.
fis3 server release没有问题,文件都编译好放入./fis3-tmp目录.
但是 server start后,不显示首页,直接显示目录,系统没有报错,请问是什么情况?有谁知道如何解决么?

VM文件里如果有大小比较就不能正常release


#if($banners and $banners.size() > 0)##

[ERROR] preprocessor.extlang: Parse error on line 9: ..."> #if($!banners and $!banners.size() ----------------------^ Expecting 'CLOSE_PARENTHESIS', '||', '&&', '+', '-', '*', '/', '%', '>', '<', '==', '>=', '<=', '!=', got 'ID' [/page/index.vm]

关于性能优化介绍的疑问?

文档里提到了 fis3-jello 引入了模版,可以将 css 和 js 放在合适的位置,同时可以合并链接。这些功能都很好理解,但是有一些疑问,希望有朋友可以帮忙解释一下,谢谢。

  1. 是否在发布后必须使用 map.json 文件?不能通过替换文件中的地址替代 map.json 的作用?
  2. fis 标签语言在发布后必须使用吗?能否替换成 HTML?比如<fis:script> 替换成 <script>
  3. <fis:widget><c:import>有什么区别?

component.json 安装包版本不对

component.json 我这边本地安装的bootstrap4._版本导致样式解析不对,同事的安装默认关联到3._版本就对了,jquery解析路径也不对
1111

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.