Giter Site home page Giter Site logo

fis3-parser-apm's Introduction

APM

npm Build Status Coveralls

APM (AMD Package Manager) is a npm-based package manager for AMD.

Installation

If your node version >= 4.7.0, feel free to install.

$ [sudo] npm install -g apmjs

Make sure you have it

$ apmjs -v

Enjoy

e.g. install https://registry.npmjs.org/@searchfe%2Fpromise

$ apmjs install @searchfe/promise

For more details, see: https://github.com/apmjs/apmjs/wiki.

Differences with NPM cli

  • apmjs install: Resolve and flatten ddependencies, see dependency-resolving
  • apmjs link: Link to/from <npm-prefix>/lib/amd_modules, install as needed
  • apmjs unlink: Unlink global AMD modules
  • apmjs version: Prints apmjs version, of course.
  • .js is not allowed in package name, since .js is always appended when require.js fetching scripts.

fis3-parser-apm's People

Contributors

dependabot[bot] avatar fengchuantao avatar harttle avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fis3-parser-apm's Issues

同名文件,会导致依赖分析错误

例如同时存在 index.d.ts, index.common.js, index.js,引用 index 会匹配到前面两个。预期是职匹配到最后一个。需要升级依赖分析部分。

异步 require 打包

目前提供了 __inlinePackage() 方法用于同步输出模块代码,inline package 后包内所有文件都可以按照模块方式引用。但 异步require的情况下会递归下载包内所有小文件,因此性能较差。需要考虑异步 require 场景下如何对每个包进行打包。以下是一些构想:

  1. 不变更 apmjs 核心。在编译插件里实现。文件打包属于性能优化,不影响版本和依赖关系。因此安装后得到的结构不会发生任何变化,所有打包发生在编译时。
  2. 原有的小文件继续存在,不强制打包。存在一些第三方库,并非所有代码都需要加载,只会加载其中一部分。这属于包内文件粒度的性能优化,要允许这种情况。
  3. __AMD_CONFIG 只负责包的打包文件,包内的小文件从这项配置移除,解决 AMD Config 太大的问题。合理性在于:其他小文件属于精细的打包优化,可以要求手动配置。

Cannot read property 'message' of undefined

若 index.json 中描述的 filepathfullpath 不存在(未具体验证是哪个不存在引发的问题),则在编译时会报错:

[ERROR] Cannot read property 'message' of undefined

依赖分析极其慢的问题

由于使用 madge cli 进行依赖分析,每次需要启动进程会很慢。可以通过增强 madge js api 的方式来避免启动 node。

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.