npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jet-php

v1.0.2

Published

jet php

Downloads

10

Readme

jet-php

jet的php运行时库

jet项目介绍

目前主流的前端工程化一般都是采用webpack、fis、gulp工具,并基于cmd或amd规范来组织javascript代码,实现了静态依赖分析和资源合并打包。 但是目前已有技术方案无法很好的做到非常理想的资源管理机制,如静态资源合并代码,在一次页面运行时里往往会有多余的模块加载和资源浪费,因此Jet将提供以下解决方案:

  • 通用代码将通过包管理的方式来进行,并提供适合Web的AMD声明机制;
  • 代码组织方式通过更严格的AMD子集标准来体现,并且是平铺式的文件粒度的Define;
  • 页面的模块依赖方式将被动态的解析处理,结合应用场景完成智能化打包合并资源请求;

安装使用

基于Smarty的php版本

  1. 安装jet-php 克隆jet-php到php后端工程里

  2. Smarty插件安装

在jet-php下有smarty_plugin目录,该目录下有smarty插件,在php的$smarty实例注册该jet插件目录,以方便在smarty调用jet函数实现页面模块依赖注册

$smarty = new Smarty();
$smarty->addPluginsDir("{jet目录}/smarty_plugin");
  1. 在smarty模板里调用函数 以下代码说明:

    • 调用jet_add_dep,增加a模块和e模块的为该页面依赖的模块
    • 调用jet_get_deps,获取到页面所有依赖模块的映射表,并赋给变量jet_deps
    • 将映射表保存到页面,供后续的jet-loader分析使用,实现动态打包
{%jet_add_dep id="a"%}
{%jet_add_dep id="e"%}


{%jet_get_deps configVar="jet_deps"%}

<script>
var jetOpt = {
    map: {%$jet_deps|@json_encode|escape:none|default: null%} || {}
};
<script>
  1. 后端初始化
require_once('../jet-php/lib/JetSingleton.class.php');
$opt = array(
    "depHost" => "http://127.0.0.1:8111", // 仅仅后端没有ral模块时采用curl才生效,否则走ral配置,请注意
    "logid" => LOG_ID,
    'jetMapDir' => '/home/work/search/jet/public/jetmap',
);
Jet_Singleton::startPage($opt);