Skip to content
/ her Public

High-performance Enhanced Rendering solution, an implement of Pagelet and Bigpipe for Smarty. Hao123前端高性能渲染解决方案

License

Notifications You must be signed in to change notification settings

hao123-fe/her

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Her

Hao123 前端集成方案

Her是基于FIS编译工具和smarty plugin开发的一套前端集成解决方案。实现了基于smarty运行时的bigpipe输出,极大的优化了前端性能。

Her的开发规范兼容fisp,分为编译工具her和后端smarty运行时以及前端JS运行时。通过对页面进行细粒度分块,收集区块的dom、js、css等资源,通过后端controller控制按需输出,前端BigPipe模块按需渲染,实现最大限度的前端性能优化。

Her已经兼容fisp,FISP模块迁移文档

##核心参考## BigPipe: Pipelining web pages for high performance

FIS

##核心功能## ###1.页面分块pagelet### pagelet将页面的dom,以及dom依赖的css、js分块收集,使用controller控制按需输出,实现了类bigpipe的分块输出,前端BigPipe模块可以实现异步渲染,优化渲染速度和性能。

###2.延迟渲染bigRender### 页面加载的时候只渲染首屏内容,用户滚动页面的时候再渲染可见区域。可以有效提高首屏速度。

###3.局部刷新Quickling### 对于数据交互频繁的模块,可以通过BigPipe.fetch()实现局部刷新。对于开发者几乎是0成本。

WIKI

https://github.com/hao123-fe/her/wiki/03-01.Smarty%E6%A8%A1%E6%9D%BF

##适用场景## her适用于采用Smarty作为后端模板的PC和Mobile站点。

##安装使用##

###1.安装Her###

$ npm install -g her

添加bin目录到环境变量

###2.安装her-pc-demo### 安装her-pc-demo之前,先安装fis的包管理工具lights https://lightjs.duapp.com/

注意:lights install下载文件到当前目录,可以cd到工作目录运行lights install

$ npm install -g lights #要求node版本在v0.10.27以上
$ lights install her-pc-demo

###3.发布her-pc-demo###

$ cd her-pc-demo/common
$ her release -c
$ cd ../home
$ her release -c

###4.启动her-server### 需要java和php-cgi环境,安装方法见 https://fis.baidu.com/docs/api/cli.html#fis%20server%20%3Ccommand%3E%20%5Boptions%5D

$ her server init ##重要,会安装server需要的模块
$ her server start -p 8089 ##用8089端口防止与fis server默认的8080端口冲突

浏览器将打开127.0.0.1:8089端口,即可看到her-pc-demo

如果模板报错或者不能正确rewrite,可以尝试

$ her server open

打开www目录,删除www目录下面的所有内容,然后再执行上面的命令

About

High-performance Enhanced Rendering solution, an implement of Pagelet and Bigpipe for Smarty. Hao123前端高性能渲染解决方案

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •