Giter VIP home page Giter VIP logo

Comments (33)

oxUnd avatar oxUnd commented on May 30, 2024
  • deploy 的调整再做下讨论

这个问题初步讨论是直接走属性配置 deploy,不过有个问题是多个deploy插件的调用问题;

fis.match('*.js', {
  deploy: fis.plugin('http-push', {
    receiver: 'http://my-host/receiver.php',
    replace: { from: 'some string', to: 'other string'}
  })
});

新进展,把替换也搞成一个插件,deploy 可以认为是后处理插件;

fis.match('*.js', {
  deploy: [
      fis.plugin('macro', {
        from: 'some string',
        to: 'other string'
      }),

      fis.plugin('http-push', {
        reciver: 'http://xxxx.com/reciver.php',
        to: '/work/wwww'
      })
  ]
});

新任务

  • deploy 优化

from fis3.

oxUnd avatar oxUnd commented on May 30, 2024
  • package 这块的设置还是有点别扭,需要做修正

这个问题,是个问题,因为现在都绑到文件属性上去了,给文件分配属性来完成对文件的若干操作;那么问题来了,package 阶段的插件设置起来就比较难搞了。

初步想法

fis.match('all', {
  packager: fis.plugin('map')
});

这种方式

上面这种方式确实太挫了,这种方式如何?

fis.match('**', {
  packager: fis.plugin('map')
}); 

@2betop 提出提供一种 ::packager 的配置方式,表示在打包都用某些属性,我感觉比较合理,遂用之;

fis.match('::packager', {
  packager: fis.plugin('map')
});

from fis3.

2betop avatar 2betop commented on May 30, 2024
  • plugin 系列插件配置调整

原来的配置方法

fis.set('modules.plugin', [

    // 启用 relative 插件
    fis.plugin('relative'),

    // 启用模块化开发插件
    fis.plugin('module', {
        packages: [
            {
                jquery: '/components/jquery',
                main: 'jquery'
            }
        ]
    }),

    // 启用js组件插件, 短路径支持 fis-components.
    fis.plugin('component')
]);

初步改造想法:

// 启用 relative 插件
fis.hook('relative');


// 启用模块化开发插件
fis.hook('module', {
    packages: [
        {
            jquery: '/components/jquery',
            main: 'jquery'
        }
    ]
});

// 启用js组件插件, 短路径支持 fis-components.
fis.hook('component');

from fis3.

hefangshi avatar hefangshi commented on May 30, 2024

一个小建议,开启插件的API最好是个动词,类似 hook 会比 plugin 好不少,不过最好能够更形象点,最好是能够不写注释就让大家看懂。另外这个插件我更觉得像是 feature,类似 enable feature 的语义可能会更好。

fis.feature('module', {
    packages: [
        {
            jquery: '/components/jquery',
            main: 'jquery'
        }
    ]
}).enable();

或者

fis.feature.enable('module', {
    packages: [
        {
            jquery: '/components/jquery',
            main: 'jquery'
        }
    ]
});

fis.feature.disable('module');

from fis3.

2betop avatar 2betop commented on May 30, 2024
  • 调整 map.json 的产出

原来是没有任何配置,默认都会产出 map.json

可以通过以下配置来关闭。

fis.match('/map.json', {
    release: false
})

初步调整

map.json 默认不产出

用户新建任何名字的文件。比如 map.json

__MAPJSON

又或者,我一个前端 loader 文件。loader.js

var map = __MAPJSON;

window.load = function(id, callback) {
}

from fis3.

oxUnd avatar oxUnd commented on May 30, 2024

应该是 resource_map

在 2015年5月22日,下午1:27,liaoxuezhi [email protected] 写道:

[] 调整 map.json 的产出
原来是没有任何配置,默认都会产出 map.json

可以通过以下配置来关闭。

fis.match('/map.json', {
release: false
})
初步调整

map.json 默认不产出

用户新建任何名字的文件。比如 map.json

__MAPJSON
又或者,我一个前端 loader 文件。loader.js

var map = __MAPJSON;

window.load = function(id, callback) {
}

Reply to this email directly or view it on GitHub.

from fis3.

2betop avatar 2betop commented on May 30, 2024

__RESOURCE_MAP 吧,只给 isJsLike 的文件加

from fis3.

oxUnd avatar oxUnd commented on May 30, 2024

__RESOURCE_MAP__ 子串包含的文件不做缓存;

而且嵌入时,其 json 数据不进行字符串化,由用户自己决定;

比如

in php

$_map = json_decode('__RESOURCE_MAP__', true);

in json

__RESOURCE_MAP__

代码检查过不去,注意

in js

var _map = __RESOURCE_MAP__; 

代码检查过不去,注意

from fis3.

nwind avatar nwind commented on May 30, 2024

macro 这个名字有点奇怪,应该指的不是一个东西,宏是可以展开的,所以直接叫 replace 好了

from fis3.

oxUnd avatar oxUnd commented on May 30, 2024

@nwind 嗯,好的,macro 用作其他支持,比如宏支持。在提供一个 replace 的插件

from fis3.

2betop avatar 2betop commented on May 30, 2024
  • 关于插件累加问题

如下代码:

fis.match('*.js', {
    parser: fis.plugin('a')
});

fis.match('*.js', {
    parser: fis.plugin('b')
});

parser-b 会把 parser-a覆盖。有时候,用户也许需要累加效果。比如在 praser-a 完了后再处理 parser-b。或者先 parser-b 再 parser-a。

如果是用现有的配置方法。得这样配置:

fis.match('*.js', {
    parser: [fis.plugin('a'), fis.plugin('b')]
});

也就是说,我加某个过程的时候,需要关注原来有哪些插件,然后控制顺序。
实际上很多时候,只需要 append 或者 prepend 就完了。

暂定语法:

fis.match('*.js', {
    parser: fis.plugin('a')
});

fis.match('*.js', {
    parser: fis.plugin.append('b', {
        options...
    })
});

// 或者 

fis.match('*.js', {
    parser: fis.plugin.prepend('b', {
        options...
    })
});

// 或者压根就动词放在前面
// 

fis.match('*.js', {
    parser: fis.append.plugin('b', {
        options...
    })
});
fis.match('*.js', {
    parser: fis.prepend.plugin('b', {
        options...
    })
});

from fis3.

2betop avatar 2betop commented on May 30, 2024
  • 关于插件累加问题

还是给 fis.plugin 加第三个参数吧

fis.match('*.js', {
    fis.plugin('parser', {
        ...
    }, 'prepend')
})


fis.match('*.js', {
    fis.plugin('parser', {
        ...
    }, 'append')
})

from fis3.

oxUnd avatar oxUnd commented on May 30, 2024

这个里面的参数可能不应该是个动作,而是一个位置,不过 who care ,就这样吧。

from fis3.

nwind avatar nwind commented on May 30, 2024

因为现在的写法类似 CSS,所以用户会以为默认就是累加的,所以感觉 append/prepend 以后会是一个坑,为什么不考虑默认就累加?

from fis3.

2betop avatar 2betop commented on May 30, 2024

如果默认就是累加,那么要覆盖的话,该怎么配置?

from fis3.

oxUnd avatar oxUnd commented on May 30, 2024

css 中的属性覆盖,其实是由于合并的属性是可以拆分成有限集合的;比如

body {
    margin: 0 2px;
}

等价于

body {
  margin-top: 0;
  margin-right: 2px;
  margin-bottom: 0;
  margin-left: 2px;
}

而,我们这块的属性值是一个无限集合,因为没有定义明确的位置,所以就不好去做处理了,覆盖不掉;

所以,这块算是小瑕疵吧,但有的时候确实需要一个覆盖功能。当初是想提供一个接口,获取当前文件前面分配到的属性值;

比如

fis.file.getProps(this /*, type*/)

然后由用户自己获取后 appendprepend 或者 splice

from fis3.

oxUnd avatar oxUnd commented on May 30, 2024
  • 官网

其实我是想文档全都链到 GitHub 得了,我看这样干得不在少数;诸位的意见呢?

实时欣赏链接

http://indexjs.sinaapp.com/fis3

from fis3.

oxUnd avatar oxUnd commented on May 30, 2024
  • fis3 内核只解决依赖问题,而不绑定 AMD 、CommonJS 等规范

把 fis3-hook-module 移出核心了,如果用户想用,就得安装它,并启用它;

npm install [-g] fis3-hook-module # 可 Global 安装也可 Local 安装 
// fis-conf.js
fis.hook('module');

核心依赖只用注释语法搞定;

in js

// @require <subpath>

in css

/* @require <subpath> */

in html

<!-- @require <subpath> -->

from fis3.

hefangshi avatar hefangshi commented on May 30, 2024

@xiangshouding 要不要考虑module改名mod或者commonjs,module容易和配置里面的modules弄混,我第一次开API的时候就弄混了。。

from fis3.

2betop avatar 2betop commented on May 30, 2024

现在用户那层,可以不用关心 moudles 了, 我觉得问题不大了。

from fis3.

2betop avatar 2betop commented on May 30, 2024
  • 关于 release 的 debug 信息

目前通过 --verbose 开启的调试信息,信息量太大没有分类,对于调试者非常痛苦。借鉴于 debug 打算给 fis.log 也开发对应的用法。

fis.log.ns('xxx:xxxx').debug('xxxx');

即,给 log 按 ns 来分类。然后命令行中,可以这么指定:

// 打印 compile 和 deploy 相关的信息
fis release --debug compile:*,debploy:*

// 除了 compile下面的其他都打印出来。
fis releaes --debug *,!compile:*

from fis3.

oxUnd avatar oxUnd commented on May 30, 2024

@2betop 其实我想说的是,我一般调试会按照文件去做筛选出信息来调试;那么其实这个 namespace 似乎对于我的调试没多大作用;另外,调试最多的地方也就只 compile.js、file.js 两块;

我们再仔细看看调试的场景

  1. 分配属性对了没?
  2. 各个插件点前后内容是否正确?
  3. 打包顺序对了没?
  4. 某个文件编译是否调用了设置的插件(类似 1 )?

综上其实能用 file 去做筛选日志,应该就可以满足调试了,对于 namespace 的引入只能是定位问题(系统 Bug)使用比较广泛,想知道这个问题出在什么地方;

from fis3.

2betop avatar 2betop commented on May 30, 2024
  • 关于 match 的调试

我的想法是,通过新的命令行来。

fis info static/*.js 

output

/static/jquery.js
---  isMod: true           line: 6  Column: 12
---  parser: [ 'less']     line 10 Column 20

from fis3.

2betop avatar 2betop commented on May 30, 2024

差点忘记了,还有 fis info ::packager

from fis3.

oxUnd avatar oxUnd commented on May 30, 2024

fis info ? 当真?

from fis3.

2betop avatar 2betop commented on May 30, 2024

fis match 吧

from fis3.

2betop avatar 2betop commented on May 30, 2024

Or fis inspect

from fis3.

2betop avatar 2betop commented on May 30, 2024

@xiangshouding 关于你提出来的需求:

  1. fis inspect 可以解决问题。
  2. 内容一直都不会 debug 出来,所以这个没法支持
  3. 这块打包插件里面分配 package:map namespace fis.log.ns('package:map').log('packing... xxx')
  4. fis inspect "your file path"

from fis3.

2betop avatar 2betop commented on May 30, 2024

inspect 插件已完工

获取行列信息,太麻烦了,不值得,目前只是标记是第几个 match 的什么规则命中了。

from fis3.

2betop avatar 2betop commented on May 30, 2024

fis errors

image

from fis3.

oxUnd avatar oxUnd commented on May 30, 2024
  • 发布相关

需要明确一下几个点

  • 仓库开发时间
    • 6.30
  • 官网放在什么地方
    • fis.baidu.com/v3
  • 投文稿的地方
    • fex, div.io
    • family ?有人看吗
  • 重新设计 logo?
    • 沿用以前的

请大家尽快回复意见;

from fis3.

hussion avatar hussion commented on May 30, 2024

fis3 map.json文件如何产出啊,文档翻了几遍都没看到

from fis3.

2betop avatar 2betop commented on May 30, 2024

http://fex.baidu.com/fis3/docs/fis2-to-fis3.html 这里面将了 map.json

from fis3.

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.