GithubHelp home page GithubHelp logo

fex-team / fis-plus Goto Github PK

View Code? Open in Web Editor NEW
572.0 77.0 142.0 5.41 MB

百度基于FIS的前端集成解决方案,可能是史上最强大的前端集成解决方案

Home Page: http://oak.baidu.com/fis-plus

JavaScript 0.76% PHP 97.00% Smarty 0.95% Shell 1.29%

fis-plus's Introduction

The official site: http://oak.baidu.com/fis-plus

NPM version

##Introduction Welcome to F.I.S, it is the front-end integrated solution which included automation tool, development framework, development environment. Our mission is「productivity for developers, performance for users」, to give you an advanced solution for developing web sites and applications without worrying about framework and performance.

Document: https://github.com/fex-team/fis-plus/wiki

fis-plus's People

Contributors

2betop avatar hefangshi avatar laotan avatar lily-zhangying avatar oxund avatar tianlili avatar waltershen avatar zhangtao07 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  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  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

fis-plus's Issues

pc-demo bugs

I followed the example of fisp.

fisp release -r common
fisp release -r home
fisp server start 

it shows below errors:
Forward request " / " to file [ /home/vagrant/.fis-plus-tmp/www/index.php ].

  • ubuntu 14.04LTS
  • fisp -v v0.7.1
  • node -v v0.10.25
  • fis -v v1.7.15

一个压缩问题

我现在有 3 个模板,继承关系是:C→B→A;
A 是最基础的模板,A 中定义了 {%block name="xx"%};

B 中以 append 的方式填充 xx block:{%block name="xx" append%}abc{%/block%}
C 中同样以 append 的方式填充 xx block:{%block name="xx" append%} def{%/block%}(注意:d前面有个空格)

带着 -o 编译模板时,xx block 中的空格会被压缩掉,也就是会得到“abcdef”而非“abc def”。因为出现问题的 block 正好被设置到元素类名 class="{%block name="xx"%}{%/block%}"上,所以这个空格的确实导致样式名连缀到一起,失效了。

npm intall fisp 404

npm http GET https://registry.npmjs.org/fisp
npm http 404 https://registry.npmjs.org/fisp
npm ERR! 404 'fisp' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "fisp"
npm ERR! cwd /Users/kevinzeng/soft/tencent/
npm ERR! node -v v0.10.20
npm ERR! npm -v 1.3.11
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/kevinzeng/soft/tencent//npm-debug.log
npm ERR! not ok code 0

提个小建议

在使用fisp release时,有很多时候其实是想看看合并之后的文件,但是使用了几次:
fisp release -pd local之后,发现require的文件并没有进行合并;只有在使用 fisp release -pod local时才会将require过来的文件合并到一起,但是文件又都压缩了...调试起来还挺麻烦的...

所以,能不能单独加个选项是合并文件的,不要把合并和压缩都做到一起?

npm安装fis-plus/fis出错

由于最近npm默认源不稳定,经常导致安装出错。如果出现这个问题,请尝试在安装的时候指定其他源。

npm install --registry=http://r.cnpmjs.org -g fis-plus

http://cnpmjs.org/

芋头修修 [mailto:[email protected]] 遇到的问题

FISP的本地调试数据给我们团队的前端人员带来了很大的方便,使其能脱离后端独立开发。但是调试数据文件缺少一个继承机制,当很多页面需要相同数据时,需要对测试数据文件中的内容复制粘贴到其他页面的测试文件中,且不易修改。

希望可以对数据测试文件增加一个继承机制,便于将公共部分抽取到一个文件中。

以上就是我的一点儿建议,望采纳,谢谢!

fisp一个项目下打包多个js文件报错

在fisp中当把所有JS文件都打包到一个文件里是正常的,把jquery文件单独放出来打包,执行命令"fisp release -p",浏览器打开页面报如下错误:
Fatal error: unable to locale resource "common:widget/ad/ad.tpl" in C:\Users\aa\AppData\Local.fis-plus-tmp\www\templates_c\4e8483ad9b55d61368c50d625dd3587854a7c45d.file.index.tpl.php on line 54

fis.config.merge({
    namespace : 'common',
    pack : {
    'jquery.js':'static/lib/jquery-1.8.3.min.js',
        'base.js' : [
            'static/js/function/**.js',
            'widget/ad/**.js',
        ]
    },
    modules :{
        parser : {
            less : ['less']
        },
        sprite: 'csssprites'
    },
    roadmap : {
        ext : {
            less : 'css'
        },
        path:[
            {
                reg : "jquery.js",
                release : '/static/lib/jquery.js'
            },
            {
                reg : "base.js",
                requires:["jquery.js"],
                release : '/static/base.js'
            }
        ]
    }
});

当不指定jquery.js 的打包规则时,页面上输出的代码如下:

<script type="text/javascript">require.resourceMap({"pkg":{"common:p1":{"url":"/static/base.js"}}});</script>
<script type="text/javascript" src="/static/common/lib/jquery-1.8.3.min.js"></script>

请问怎样才能做到最终输出的代码如下,且jquery.js居于base.js之前:

<script type="text/javascript" src="/static/lib/jquery.js"></script>
<script type="text/javascript" src="/static/base.js"></script>

官方文档对模块根目录/page下对应的静态文件的位置有三种不同的说法?求解释

第一种:

页面(page):存放在 模块根目录/page 下,url访问路径为/模块名/page/页面名,

例如path_to_user_module/page/view.tpl,访问url为:/user/page/view。页面静态资源存储的位置为:

tpl :path_to_module/page/页面名.tpl

js :path_to_module/page/页面名.js

css :path_to_module/page/页面名.css

第二种:

---module1 //module1子系统

| | |---test
| | |---config
| | |---page
| | └── index.tpl
| | |---widget
| | |---static
| | | └── index //index.tpl模板对应的静态资源
| | | └── index.js
| | | └── index.css
| | |---fis-conf.js //fis配置文件

第三种:

页面模板静态资源对应页面模板的同名静态资源,FIS-Plus会在页面自动进行加载,用户不需要在页面中声明加载。

tpl :模板根目录/page/页面名.tpl

js :模板根目录/page/页面名/页面名.js

css :模板根目录/page/页面名/页面名.css

Windows7 下转移 fis-plus 模块时遇到的一个坑

我的 NPM 的 prefix 路径原来是:

C:\Users\XXXXXXXX\AppData\Roaming\npm\

安装 fisp 也到了这个路径下,可正常使用。

将 prefix 修改为:

"D:\\Program Files (x86)\\nodejs"

然后将 fisp 移到其下,预期的路径是:

D:\Program Files (x86)\nodejs\node_modules\fis-plus\

转移过程中出现问题,Windows弹框报错:文件名对目录文件夹可能过长。

发现原因是由于:

C:\Users\XXXXXXXX\AppData\Roaming\npm\node_modules\fis-plus\node_modules\fis\node_modules\fis-command-install\node_modules\fis-scaffold-kernel\node_modules\fis-repo-client\node_modules\form-data\node_modules\combined-stream\node_modules\delayed-stream\lib\delayed_stream.js

这个文件移动到新的 prefix 路径下,路径字符过长了,超过了 windows 的 260 个字符的限制。
查看新目录:

D:\Program Files (x86)\nodejs\node_modules\fis-plus\node_modules\fis\node_modules\fis-command-install\node_modules\fis-scaffold-kernel\node_modules\fis-repo-client\node_modules\form-data\node_modules\combined-stream\node_modules\delayed-stream\lib

发现其下的文件 delayed_stream.js 并没有如约移动过来。

(Tips:以上问题只是在转移 fisp 时暴露,不算是 fisp 的问题,算是 Node.js 的机制问题[ https://github.com/nodejs/node-v0.x-archive/issues/6960 ],但可以考虑避免这种情况发生)

fis-plus 配合slightphp开发的方案

前端采用的是fis-plus,编译出来的config、plugins、static、template目录应该怎么和slightphp组合使用呢,config里面的"namespace"-map.json 怎么来解析定位呢?另外fisp的pc-demo是怎么进行解析map.json文件,我觉得是plugin里面的php解析的?希望能够得到解答....

如何在tpl中定位图片资源

在tpl中引用loading.gif图片,release后,图片文件名称带了md5,可引用位置的路径指向的gif文件名不带md5。
如何是好?(根据官方文档提供的资源定位方式,uri也不好使)

<img class="list-loading" src="{%require name="module-name:static/img/loading.gif"%}">

尝试pc-demo 启动不了

HTTP ERROR 500

Problem accessing /. Reason:

Server Error

Caused by:

php.java.bridge.http.FCGIConnectionException
at php.java.bridge.http.FCGIInputStream.read(FCGIInputStream.java:58)
at php.java.servlet.fastcgi.FastCGIServlet.parseBody(FastCGIServlet.java:362)
at php.java.servlet.fastcgi.FastCGIServlet.execute(FastCGIServlet.java:433)
at php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:481)
at php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:521)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
at com.baidu.fis.HttpServer$FISWebAppContext.doScope(HttpServer.java:106)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:370)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Protocol error
at php.java.bridge.http.FCGIInputStream.doRead(FCGIInputStream.java:67)
at php.java.bridge.http.FCGIInputStream.read(FCGIInputStream.java:54)
... 31 more
Caused by:

java.io.IOException: Protocol error
at php.java.bridge.http.FCGIInputStream.doRead(FCGIInputStream.java:67)
at php.java.bridge.http.FCGIInputStream.read(FCGIInputStream.java:54)
at php.java.servlet.fastcgi.FastCGIServlet.parseBody(FastCGIServlet.java:362)
at php.java.servlet.fastcgi.FastCGIServlet.execute(FastCGIServlet.java:433)
at php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:481)
at php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:521)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
at com.baidu.fis.HttpServer$FISWebAppContext.doScope(HttpServer.java:106)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:370)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:745)

FISP-0.7.2下 载入dojoJS报错

dojo报:Error: defineAlreadyDefined
modjs报:Error: Cannot find module [object Object]
没找到问题出在哪,请教原因,thank you

fis-plus 和 tomcat的关系。

1、运行fisp server start 之后,xampp里的tomcat服务器莫名其妙的启动,并开启了8080端口。
2、127.0.0.1:8080出现“No input file specified.”,也就是404错误。
3、为何fisp发布的内容和apche没有任何关系呢?

如何解决字符串过长导致smarty编译出错的问题

压缩后的js,css代码往往很长一个字符串,如果碰巧这个文件被inline到了tpl中,这个过长的字符串就会导致smarty解析出错。

这个问题该如何解决呢?

解决方法:配置js&css压缩器,修改js&css压缩策略,避免出现过长字符。

fis.config.set("settings.optimizer.uglify-js", {
    output : {
        max_line_len : 500
   }
});

fis.config.set("settings.optimizer.clean-css", { keepBreaks : true });

如果是tpl本身字符串过长导致报错呢?

解决方法: 在过长的字符串中人工加入一个smarty注释就可以啦。
例如:

<body>
blablablabla  {*fix-smarty*}  blablabla
</body>

把define和require改个名字

  1. 既然是definerequire了,建议按照amd的规范来实现
  2. 如果没有按照amd的规范来实现,那就建议改成改成FIS_defineFIS_require,降低冲突的可能性

npm intall fisp 404

npm http GET https://registry.npmjs.org/fisp
npm http 404 https://registry.npmjs.org/fisp
npm ERR! 404 'fisp' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "fisp"
npm ERR! cwd /Users/kevinzeng/soft/tencent/
npm ERR! node -v v0.10.20
npm ERR! npm -v 1.3.11
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/kevinzeng/soft/tencent
npm ERR! not ok code 0

关于文档和推广的几个问题

  1. fis-plus的roadmap.path不能被定制,如果用户定制了roadmap.path,会导致几乎所有框架功能失效
  2. README.md中列出的 Who uses FIS 项目都是基于fis的,而非fis-plus。
  3. 如果用户参考现在的文档,安装了fis-plus,然后试图基于fis-plus去定制自己解决方案也是有很高成本的(要覆盖fis-plus中的配置,而且携带了一些不需要的插件)
  4. 把fis的文档混在fis-plus中介绍,并且把fis-plus放到fis.baidu.com上推广,这些做法是出于什么考虑?

从成本上来说,用户接触fis只需要有nodejs环境,然后安装fis,可以当做工具来用,如果需要解决方案,可以参考 php版java版 两个例子。

而fis-plus用户除了有nodejs环境外,还要有java、php-cgi环境,安装fis-plus之外还要安装lights,然后学习fis-plus的规范、js框架、smarty框架,最后想要定制自己的解决方案的时候却发现其实应该学习的是fis,之前对于fis-plus的接触的最终意义只是被当做展现fis的最佳实践而已,这个从成本上来说不是更高么?

mac环境下 fis-plus测试数据目录中的php文件不能require上级文件

windows中没这个问题,mac中会出现这个现象:
经测试,可以require当前目录和下级目录中的文件,但是不能require上级目录中文件。
test/common.php
test/job/index.php
test/job/common1.php
test/job/sub/common2.php
如上的目录结构,在job/index.php中,可以require("common1.php"),require("sub/common2.php")。
但是不能require("../common.php")。会报错:Failed opening required

fisp server init 连接失败

fisp server init 时连接失败,如下图

fisp

本地服务能正常起来,访问时始终都是

 Forward request " / " to file [ C:\Users\samczhang\AppData\Local\.fis-plus-tmp\www\index.php ].

fisp server start --type=node

我按照文档。敲入如下命令:

fisp release -r common  
fisp release -r home  
fisp server start  

然后报错,意思是java未安装(属实)
然后我又敲入如下命令:

fisp release -r common  
fisp release -r home  
fisp server start  --type=node  

服务器启动,页面也出来了,可是页面根本没有任何css,整个页面的样子(更ftp那种类似),只是单纯显示文件目录结构,感觉就是个ftp。跟文档中的显示结果不一致。这是正常行为?
我想请问,能否不需要安装java?
我的系统是windows64位,fisp -v == 0.8.4。

修改了界定符的项目中,fisp release -o导致$smarty编译错误

各位大神,我们用fisp做前端项目构建,但$smarty的界定符{%%}很难用,被我们用smarty.conf修改成了{{}},在没有进行项目的合并打包之前,一切OK,用fisp release可以正确的编译,但是在项目需要合并的时候,用fisp release -o进行编译后,打开原来的页面却报错了,错误信息如下:Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "C:\Users\Administrator\AppData\Local.fis-plus-tmp\www\template\home\page\homePage.tpl" on line 1 "{{extends file=&quot;./layout.tpl&quot;}}{{block name=&quot;body&quot;}}........

FIS官网的一些问题

  1. 从官网上线至今,遇到比较棘手的问题;
    • 官网直接宣传FIS-PLUS,虽然解决了内部人员的疑惑,但不利于推广。使用的人以为FIS-PLUS就是FIS。
    • 如果需要跟gulp和grunt进行抗衡,如果按照fisp的规格,对个人或者小团队比较大,学习成本过高。
      • 个人或者小团队比较关注的问题
        • css,js如何用FIS进行压缩
        • 如何csssprite
        • 如何加时间戳
    • 官网目录过深,内容堆砌上去的,缺少连贯。比如划分的几个流程很少有个人或者小产品线使用。以FISP进行宣传,观感上就给人一种复杂感。
  2. 如果以后着重宣传FIS,fisp,fis-java,fis-go等解决方案如何展示,如何引导各种使用群体找到适合自己的解决方案
  3. FIS的文档只说明API,但缺少示例;

fisp数据模拟服务的问题

好像每次服务启动后,在浏览中打开本地页面会,默认不使用本地的调试数据进行渲染(会使用空数据渲染出页面)?
需要使用文档中说的编辑测试数据的脚本(http://fis.baidu.com/fis-plus/userdoc/fis/%E6%9C%AC%E5%9C%B0%E8%B0%83%E8%AF%95%E6%95%B0%E6%8D%AE%E5%8A%9F%E8%83%BD ),在编辑界面中手动选择json后再点击render之后才正常(此后再次刷新页面数据都正常)。是需要配置什么参数,才能默认使用本地的数据吗?

P.S.
本地的fisp是使用的php server,模拟数据是test目录下的json文件。

.tpl文件是什么语法

很菜鸟的问题,本来不想new一个issue的,可是不知道还有什么其它渠道。
.tpl的模板文件是smarty的语法吗?

请问fisp中通过require加载的静态资源怎么打包

像这种{%require name="home:static/index/index.css"%};
在配置文件设置pack属性然后release的时候加-p;但是不起作用

pack: {
'pkg/all.js': [
'/common/static/mod.js',
'/common/widget/jquery/1.7.2/jquery.js'
]
}

我这里是跨业务模块的,就是home模块的config人肉配置打包策略,该打包配置有common的资源

fis-plus widget错误

{%widget name="home:widget/header/header.tpl"%}在页面引入了这个widget,但是报unable to locate resource "home:widget/header/header.tpl" 这个错误,widget需要安装相应的插件吗?

有@import的stylus文件编译异常

我在一个stylus文件中定义了一些变量和函数,然后在其它widget中@import,编译的时候经常会出现@import失败的情形,即在其它styl文件中使用的stylus变量和函数没有被编译成功。
如果只存在一处@import,到没有问题,当公共styl文件被多次@import,就经常不成功。

fis 部署的时候 会有些文件没有更新到

如题。文件确实已经有改动,但是在部署的时候没有生成最新文件。在清除 fis 的缓存后就好了,但有时候没测出来恐怕会出大问题。有什么办法能保证fis部署的时候文件百分百更新?

http500错误

我安装完
fisp init pc-demo
cd pc-demo
fisp release -r common
fisp release -r home
fisp server start
127.0.0.1:8080
出现:

HTTP ERROR 500

Problem accessing /. Reason:

Server Error

Caused by:

php.java.bridge.http.FCGIConnectionException
at php.java.bridge.http.FCGIConnectionOutputStream.flush(FCGIConnectionOutputStream.java:87)
at php.java.bridge.http.FCGIConnectionOutputStream.close(FCGIConnectionOutputStream.java:71)
at php.java.servlet.fastcgi.FastCGIServlet.parseBody(FastCGIServlet.java:357)
at php.java.servlet.fastcgi.FastCGIServlet.execute(FastCGIServlet.java:433)
at php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:481)
at php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:521)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
at com.baidu.fis.HttpServer$FISWebAppContext.doScope(HttpServer.java:106)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:370)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: ????????
at java.io.RandomAccessFile.writeBytes0(Native Method)
at java.io.RandomAccessFile.writeBytes(Unknown Source)
at java.io.RandomAccessFile.write(Unknown Source)
at php.java.bridge.http.RandomAccessFileOutputStream.write(RandomAccessFileOutputStream.java:62)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.flush(Unknown Source)
at php.java.bridge.http.FCGIConnectionOutputStream.flush(FCGIConnectionOutputStream.java:85)
... 32 more
Caused by:

java.io.IOException: ????????
at java.io.RandomAccessFile.writeBytes0(Native Method)
at java.io.RandomAccessFile.writeBytes(Unknown Source)
at java.io.RandomAccessFile.write(Unknown Source)
at php.java.bridge.http.RandomAccessFileOutputStream.write(RandomAccessFileOutputStream.java:62)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.flush(Unknown Source)
at php.java.bridge.http.FCGIConnectionOutputStream.flush(FCGIConnectionOutputStream.java:85)
at php.java.bridge.http.FCGIConnectionOutputStream.close(FCGIConnectionOutputStream.java:71)
at php.java.servlet.fastcgi.FastCGIServlet.parseBody(FastCGIServlet.java:357)
at php.java.servlet.fastcgi.FastCGIServlet.execute(FastCGIServlet.java:433)
at php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:481)
at php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:521)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
at com.baidu.fis.HttpServer$FISWebAppContext.doScope(HttpServer.java:106)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:370)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Unknown Source)
Powered by Jetty://

fis-plus如何与后端结合使用

fis-plus实际上是fis+php+smarty的技术选型,无论是thinkphp还是yaf还是其他任何php框架,只要渲染引擎选择用smarty,就可以无缝兼容。

前端与后端结合的关键点就在于要把fis-plus产出的config目录在后端smarty配置里设置为config_dir ,template目录设置为template_dir,plugin目录设置为plugins_dir,然后后端渲染数据的时候设置好tpl路径即可。

此外还可以通过配置fis-plus让其产出目录适应后端目录结构,并不局限于通过后端目配置来适应前端目录结构。

比如以下是fisp的内置服务的index.php中加载smarty的实现,在加载完smarty后,只需要后端同学指定了正确的render模板并给予正确的模板数据,就可以实现前后端的结合。

    require_once ($root . 'smarty/Smarty.class.php');
    $smarty = new Smarty();
    $default_conf = array(
        'template_dir' => 'template',
        'config_dir' => 'config',
        'plugins_dir' => array( 'plugin' ),
        'left_delimiter' => '{%',
        'right_delimiter' => '%}'
    );
    if(file_exists($root . 'smarty.conf')){
        $user_conf = parse_ini_file($root . 'smarty.conf');
        if(!empty($user_conf)){
            $default_conf = array_merge($default_conf, $user_conf);
        }
    }
    $smarty->setTemplateDir($root . $default_conf['template_dir']);
    $smarty->setConfigDir($root . $default_conf['config_dir']);
    foreach ($default_conf['plugins_dir'] as $dir) {
        $smarty->addPluginsDir($root . $dir);
    }
    $smarty->setLeftDelimiter($default_conf['left_delimiter']);
    $smarty->setRightDelimiter($default_conf['right_delimiter']);

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.