build(rollup): use rollup to pack CDN bundle

This commit is contained in:
yuqi.pyq 2019-11-14 20:52:43 +08:00
parent bd334b1990
commit 1fc71c0dd6
23 changed files with 938 additions and 34913 deletions

1
.gitignore vendored
View File

@ -65,6 +65,7 @@ jspm_packages/
# End of https://www.gitignore.io/api/node
lib/
dist/
.DS_Store
public

View File

@ -1,19 +1,19 @@
// @see https://babeljs.io/docs/en/next/config-files#project-wide-configuration
module.exports = (api) => {
api.cache(() => process.env.NODE_ENV);
if(api.env("site")) { //
if (api.env('site')) { //
return {
"presets": [
presets: [
[
"@babel/preset-env",
'@babel/preset-env',
{
"loose": true,
"modules": false
}
loose: true,
modules: false,
},
],
'@babel/preset-react',
"babel-preset-gatsby"
]
'babel-preset-gatsby',
],
};
}
return {
@ -25,6 +25,9 @@ module.exports = (api) => {
browsers: 'Last 2 Chrome versions, Firefox ESR',
node: 'current',
},
// set `modules: false` when building CDN bundle, let rollup do commonjs works
// @see https://github.com/rollup/rollup-plugin-babel#modules
modules: api.env('bundle') ? false : 'auto',
},
],
[
@ -52,8 +55,11 @@ module.exports = (api) => {
}
],
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-transform-modules-commonjs',
[
// let rollup do commonjs works
// @see https://github.com/rollup/rollup-plugin-babel#modules
api.env('bundle') ? {} : '@babel/plugin-transform-modules-commonjs',
// 开发模式下以原始文本引入,便于调试
api.env('bundle') ? {} : [
// import glsl as raw text
'babel-plugin-inline-import',
{
@ -71,11 +77,10 @@ module.exports = (api) => {
transform: 'constObject',
}
],
// TODO减少最终打包产物大小
// 1. 去除 Shader 中的注释
// @see https://www.npmjs.com/package/babel-plugin-remove-glsl-comments
// 2. 内联 WebGL 常量
// @see https://www.npmjs.com/package/babel-plugin-inline-webgl-constants
// 按需引用 @see https://github.com/lodash/babel-plugin-lodash
'lodash',
// 内联 WebGL 常量 @see https://www.npmjs.com/package/babel-plugin-inline-webgl-constants
api.env('bundle') ? 'inline-webgl-constants' : {},
],
env: {
build: {

4
build/bundle.ts Normal file
View File

@ -0,0 +1,4 @@
// @ts-ignore
export * from '@l7/scene';
// @ts-ignore
export * from '@l7/layers';

View File

@ -0,0 +1,33 @@
import { createFilter } from 'rollup-pluginutils';
// borrow from https://github.com/uber/luma.gl/blob/master/dev-modules/babel-plugin-remove-glsl-comments/index.js#L4-L5
const INLINE_COMMENT_REGEX = /\s*\/\/.*[\n\r]/g;
const BLOCK_COMMENT_REGEX = /\s*\/\*(\*(?!\/)|[^*])*\*\//g;
// 生产环境压缩 GLSL
export default function glsl(include, minify) {
const filter = createFilter(include);
return {
name: 'glsl',
transform(code, id) {
if (!filter(id)) return;
if (minify) {
code = code
.trim() // strip whitespace at the start/end
.replace(/\n+/g, '\n') // collapse multi line breaks
// remove comments
.replace(INLINE_COMMENT_REGEX, '\n')
.replace(BLOCK_COMMENT_REGEX, '')
.replace(/\n\s+/g, '\n') // strip identation
// .replace(/\s?([+-\/*=,])\s?/g, '$1') // strip whitespace around operators
// .replace(/([;\(\),\{\}])\n(?=[^#])/g, '$1'); // strip more line breaks
}
return {
code: `export default ${JSON.stringify(code)};`,
map: { mappings: '' }
};
}
};
}

79
build/rollup.config.js Normal file
View File

@ -0,0 +1,79 @@
import path from 'path';
import alias from '@rollup/plugin-alias';
import json from '@rollup/plugin-json';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import { terser } from "rollup-plugin-terser";
import analyze from 'rollup-plugin-analyzer';
import babel from 'rollup-plugin-babel';
import glsl from './rollup-plugin-glsl';
function resolveFile(filePath) {
return path.join(__dirname, '..', filePath)
}
module.exports = [
{
input: resolveFile('build/bundle.ts'),
output: {
file: resolveFile('dist/bundle.js'),
format: 'umd',
name: 'L7',
globals: {
'mapbox-gl': 'mapboxgl',
},
},
external: [
'mapbox-gl',
],
treeshake: true,
plugins: [
alias(
{
resolve: ['.tsx', '.ts'],
entries: [
{
find: /^@l7\/(.*)/,
replacement: resolveFile('packages/$1/src'),
},
]
},
),
resolve({
browser: true,
preferBuiltins: false,
extensions: ['.js', '.ts'],
}),
glsl(
['**/*.glsl'],
true,
),
json(),
// @see https://github.com/rollup/rollup-plugin-node-resolve#using-with-rollup-plugin-commonjs
commonjs({
namedExports: {
eventemitter3: [ 'EventEmitter' ],
// @see https://github.com/rollup/rollup-plugin-commonjs/issues/266
lodash: [
'isNil',
'uniq',
'clamp',
'isObject',
'isFunction',
'cloneDeep',
'isString',
'isNumber',
],
}
}),
babel({
extensions: ['.js', '.ts'],
}),
terser(),
analyze({
summaryOnly: true,
limit: 20,
}),
],
},
];

230
dev-docs/使用方法.md Normal file
View File

@ -0,0 +1,230 @@
# 使用方法
L7 提供三种使用方式CDN、Submodule 以及 React 组件。
## 通过 CDN 使用
首先在 `<head>` 中引入 L7 CDN 版本的 JS 和 CSS 文件:
```html
<head>
<script src='https://api.l7/v2.0.0-beta/l7.js'></script>
<link href='https://api.l7/v2.0.0-beta/l7.css' rel='stylesheet' />
</head>
```
如果使用 Mapbox还需要额外引入 Mapbox 的 JS 和 CSS 文件,这一步可以参考 [Mapbox 文档](https://docs.mapbox.com/mapbox-gl-js/overview/#quickstart)
```html
<head>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.5.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.5.0/mapbox-gl.css' rel='stylesheet' />
<!-- 上一步引入的 L7 JS 和 CSS -->
</head>
```
⚠️高德采用异步加载,因此不需要引入任何额外静态文件。
然后在 `<body>` 中定义一个容器并设置一个 `id`。通过全局 `L7` 这个命名空间可以获取场景 `L7.Scene` 和图层 `L7.PolygonLayer`
```html
<body>
<div
id="map"
style="position: absolute;top: 0;left: 0;right: 0;bottom: 0;"
></div>
<script>
(async function() {
// 获取数据
const response = await fetch(
'https://gw.alipayobjects.com/os/basement_prod/d2e0e930-fd44-4fca-8872-c1037b0fee7b.json',
);
const data = await response.json();
// 创建场景
const scene = new L7.Scene({
id: 'map', // 容器 id
type: 'mapbox', // 高德 amap 或者 mapbox
style: 'mapbox://styles/mapbox/streets-v9',
center: [110.19382669582967, 50.258134],
pitch: 0,
zoom: 3,
token: 'pg.xxx', // 高德或者 Mapbox 的 token
});
// 创建图层
const layer = new L7.PolygonLayer({
enablePicking: true,
enableHighlight: true,
passes: [
[
'colorHalftone',
{
size: 8,
},
],
],
});
layer
.source(data)
.size('name', [0, 10000, 50000, 30000, 100000])
.color('name', [
'#2E8AE6',
'#69D1AB',
'#DAF291',
'#FFD591',
'#FF7A45',
'#CF1D49',
])
.shape('fill')
.style({
opacity: 0.8,
});
// 添加图层到场景中
scene.addLayer(layer);
// 渲染场景
scene.render();
})();
</script>
</body>
```
⚠️需要获取高德或者 Mapbox 的使用 token 并传入 `L7.Scene` 的构造函数,获取方式如下:
* 高德地图开发者 Key [申请方法](https://lbs.amap.com/dev/key/)
* [Mapbox Access Tokens](https://docs.mapbox.com/help/how-mapbox-works/access-tokens/#creating-and-managing-access-tokens)
## 通过 Submodule 使用
首先通过 `npm/yarn` 安装 `@l7/scene``@l7/layers`
```bash
npm install --save @l7/scene @l7/layers
// or
yarn add @l7/scene @l7/layers
```
然后就可以使用其中包含的场景和各类图层:
```typescript
import { Scene } from '@l7/scene';
import { PolygonLayer } from '@l7/layers';
(async function() {
// 获取数据
const response = await fetch(
'https://gw.alipayobjects.com/os/basement_prod/d2e0e930-fd44-4fca-8872-c1037b0fee7b.json',
);
const data = await response.json();
// 创建场景
const scene = new Scene({
center: [110.19382669582967, 50.258134],
id: 'map',
pitch: 0,
style: 'dark',
type: 'amap',
zoom: 3,
token: 'pg.xxx', // 高德或者 Mapbox 的 token
});
// 创建图层
const layer = new PolygonLayer({});
layer
.source(data)
.size('name', [0, 10000, 50000, 30000, 100000])
.color('name', [
'#2E8AE6',
'#69D1AB',
'#DAF291',
'#FFD591',
'#FF7A45',
'#CF1D49',
])
.shape('fill')
.style({
opacity: 0.8,
});
// 添加图层到场景中
scene.addLayer(layer);
// 渲染场景
scene.render();
})();
```
最后在 `<head>` 中引入 L7 CDN 版本的 CSS 文件:
```html
<head>
<link href='https://api.l7/v2.0.0-beta/l7.css' rel='stylesheet' />
</head>
```
L7 目前的文档都通过这种方式使用,可以参考项目中的 stories
* [高德地图](https://github.com/antvis/L7/blob/next/stories/MapAdaptor/components/AMap.tsx)
* [Mapbox](https://github.com/antvis/L7/blob/next/stories/MapAdaptor/components/Mapbox.tsx)
## [WIP] React
React 组件待开发,目前可以暂时以 Submodule 方式使用:
```tsx
import { Scene } from '@l7/scene';
import { PolygonLayer } from '@l7/layers';
import * as React from 'react';
export default class AMap extends React.Component {
private scene: Scene;
public componentWillUnmount() {
this.scene.destroy();
}
public async componentDidMount() {
const response = await fetch(
'https://gw.alipayobjects.com/os/basement_prod/d2e0e930-fd44-4fca-8872-c1037b0fee7b.json',
);
const scene = new Scene({
center: [110.19382669582967, 50.258134],
id: 'map',
pitch: 0,
style: 'dark',
type: 'amap',
zoom: 3,
token: 'pg.xxx', // 高德或者 Mapbox 的 token
});
const layer = new PolygonLayer({});
layer
.source(await response.json())
.size('name', [0, 10000, 50000, 30000, 100000])
.color('name', [
'#2E8AE6',
'#69D1AB',
'#DAF291',
'#FFD591',
'#FF7A45',
'#CF1D49',
])
.shape('fill')
.style({
opacity: 0.8,
});
scene.addLayer(layer);
scene.render();
this.scene = scene;
}
public render() {
return (
<div
id="map"
style={{
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
}}
/>
);
}
}
```
⚠️组件 Unmount 时需要通过 `scene.destroy()` 手动销毁场景。

286
dev-docs/构建方案.md Normal file
View File

@ -0,0 +1,286 @@
# 构建方案
考虑到 L7 提供的三种[使用方法](./使用方法.md)CDN、Submodule 和 React 组件,我们需要提供对应的构建方案。
由于 React 组件待开发,下面我们将从方案技术细节、优化手段两方面介绍 CDN 和 Submodule 的构建方案。
## CDN
考虑到后续将引入 WebWorker 特性,目前 Webpack4 暂时还不支持多种 targetweb + webworker混合的输出模式相关 [ISSUE](https://github.com/webpack/webpack/issues/6525)。
如果后续支持,配合 SplitChunksPlugin 应该能解决在 Worker 和不同 entry 之间共享代码的问题。
因此目前和 Mapbox 做法一样,我们使用 Rollup 构建 CDN Bundler。
打包命令如下,会在 `dist/` 下输出产物:
```bash
yarn bundle
```
### UMD
以 L7 为命名空间,让用户可以通过类似 `L7.Scene` 的方式使用。同时以 UMD 为构建目标:
```javascript
{
input: resolveFile('build/bundle.ts'),
output: {
file: resolveFile('dist/bundle.js'),
format: 'umd',
name: 'L7',
},
}
```
目前只需要暴露场景以及图层相关的 API因此 Bundler 非常简单:
```typescript
// build/bundle.ts
export * from '@l7/scene';
export * from '@l7/layers';
```
### Alias
为了帮助 resolver 定位 lerna packages需要重命名类似 `@l7/scene` 这样的依赖路径:
```javascript
import alias from '@rollup/plugin-alias';
plugins: [
alias(
{
resolve: ['.tsx', '.ts'],
entries: [
{
find: /^@l7\/(.*)/,
replacement: resolveFile('packages/$1/src'),
},
]
},
),
]
```
配合 [`terser`](https://github.com/TrySound/rollup-plugin-terser) 压缩后,我们就能得到可运行的 CDN 版本了,但从减少构建产物大小出发还有很多优化可以做。
### 减少包大小
除了 Rollup 提供的 TreeShaking我们主要从三个方面考虑
* 减少第三方依赖大小尤其是 Lodash
* external Mapbox 依赖
* 压缩 GLSL 代码
* 去除多余空格、换行符和注释
* 内联 WebGL 常量
* 预计算 define 变量
#### Lodash 按需引用
通过 analysis 插件可以看到第三方依赖大小占比:
```
/node_modules/lodash/lodash.js
███████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 23.79 % (540.328 KB)
/node_modules/regl/dist/regl.js
██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 12.21 % (277.403 KB)
/node_modules/hammerjs/hammer.js
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3.25 % (73.847 KB)
/node_modules/uri-js/dist/es5/uri.all.js
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.28 % (51.721 KB)
```
仔细查看 Lodash 的引用情况:
```
███████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
file: /node_modules/lodash/lodash.js
bundle space: 23.79 %
rendered size: 540.328 KB
original size: 540.51 KB
code reduction: 0.03 %
dependents: 13
- /packages/core/src/services/layer/StyleAttribute.ts
- /packages/core/src/services/shader/ShaderModuleService.ts
- /packages/core/src/services/renderer/passes/post-processing/BlurHPass.ts
```
按需引用 Lodash 常见的做法有几种:
* [loash-es](https://github.com/lodash/lodash/tree/es)
* babel-plugin-lodash
* lodash-webpack-plugin
由于我们使用 Rollup 以及 `rollup-plugin-babel`[babel-plugin-lodash](https://github.com/lodash/babel-plugin-lodash) 可以很好地解决这个问题。该插件的[原理](https://github.com/rollup/rollup/issues/610#issuecomment-270801483)其实也是引用 `lodash-es`
```javascript
// this...
import { template } from 'lodash-es';
// ...basically becomes this:
import template from 'lodash-es/template.js';
```
最终的效果还是很明显的:
```
/node_modules/regl/dist/regl.js
████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 16.55 % (277.403 KB)
/node_modules/hammerjs/hammer.js
██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 4.41 % (73.847 KB)
/node_modules/uri-js/dist/es5/uri.all.js
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3.09 % (51.721 KB)
/node_modules/lodash.mergewith/index.js
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3.06 % (51.256 KB)
```
#### 剔除 Mapbox
不同于高德异步加载的方式Mapbox 用户需要手动引入 Mapbox 的 JS 和 CSS因此 L7 CDN 版本就需要剔除了。通过 `globals` 假定用户负责引入 Mapbox 的 CDN 版本:
```javascript
{
output: {
globals: {
'mapbox-gl': 'mapboxgl',
},
},
external: [
'mapbox-gl',
],
}
```
这样 L7 Bundler 中就不包含 Mapbox 的 Module Bundler(mapbox-gl) 了。
#### 内联 WebGL 常量
在构建阶段可以将 WebGL 常量替换成对应的值,可以减少字符长度:
```javascript
// from
const max = gl.MAX_VERTEX_ATTRIBS;
// to
const max = 34921;
```
luma.gl 和 deck.gl 都使用了 [babel-plugin-inline-webgl-constants](https://www.npmjs.com/package/babel-plugin-inline-webgl-constants)。
来看一下实际效果,在压缩前就能减少字符长度:
```javascript
// 内联前
const usageMap = {
[gl.STATIC_DRAW]: 'static',
[gl.DYNAMIC_DRAW]: 'dynamic',
[gl.STREAM_DRAW]: 'stream'
};
// 内联后
const usageMap = {
[35044]: 'static',
[35048]: 'dynamic',
[35040]: 'stream'
};
```
#### 压缩 GLSL 代码
在开发编写 Shader 时,我们是不需要对 GLSL 代码进行压缩的,因为在 Shader 编译失败时能根据错误信息定位到具体行列。
但是在生产环境下,我们就需要把 GLSL 源代码中包含的**多余**的换行、空格以及注释去掉,减少最终引入字符串的大小。
这里需要注意的是并不是所有换行都可以简单去除,例如 `define` 语句末尾的换行一定要保留。
luma.gl 和 deck.gl 使用了 [babel-plugin-remove-glsl-comments](https://github.com/uber/luma.gl/tree/master/dev-modules/babel-plugin-remove-glsl-comments) 简单地移除注释,但很明显,多余的空格和换行符依然存在。
因此我们需要写一个简单的 Rollup 插件:
```javascript
export default function glsl(include, minify) {
const filter = createFilter(include);
return {
name: 'glsl',
transform(code, id) {
if (!filter(id)) return;
if (minify) {
code = code
.trim() // strip whitespace at the start/end
.replace(/\n+/g, '\n') // collapse multi line breaks
// remove comments
.replace(INLINE_COMMENT_REGEX, '\n')
.replace(BLOCK_COMMENT_REGEX, '')
.replace(/\n\s+/g, '\n') // strip identation
}
return {
code: `export default ${JSON.stringify(code)};`,
map: { mappings: '' }
};
}
};
}
```
#### GLSL minifier
以上针对 GLSL 的压缩仅限于字符替换,更彻底的优化必然需要生成 GLSL 对应的 AST从而进行变量重命名、死代码消除等等更高级的优化手段。[glsl-minifier](https://github.com/TimvanScherpenzeel/glsl-minifier) 就是这样一个 CLI 工具。
其中的预计算特性有点类似 [Prepack](https://github.com/facebook/prepack),在构建阶段就计算出 `define` 变量的值:
```glsl
#define SPREAD 8.00
#define MAX_DIR_LIGHTS 0
#define MAX_POINT_LIGHTS 0
#define MAX_SPOT_LIGHTS 0
#define MAX_HEMI_LIGHTS 0
#define MAX_SHADOWS 0
#define GAMMA_FACTOR 2
uniform mat4 viewMatrix;
uniform vec3 cameraPosition;
uniform vec2 resolution;
uniform float time;
uniform sampler2D texture;
void main() {
vec2 uv = gl_FragCoord.xy / resolution.xy;
float v = texture2D( texture, uv ).x;
if (v == 1000.) discard;
v = sqrt(v);
gl_FragColor = vec4( vec3( 1. - v / SPREAD ), 1.0 );
}
```
上述代码压缩结果如下,`define` 统统不见了,变量名也进行了改写:
```glsl
uniform highp vec2 resolution;uniform sampler2D texture;void main(){highp vec2 a;a=(gl_FragCoord.xy/resolution);lowp vec4 b;b=texture2D(texture,a);if((b.x==1000.0)){discard;}lowp vec4 c;c.w=1.0;c.xyz=vec3((1.0-(sqrt(b.x)/8.0)));gl_FragColor=c;}
```
当然 glsl-minifier 做的远不止这些,还会应用变量名改写、死代码消除等等优化手段:
> Optimisations include function inlining, dead code removal, copy propagation, constant folding, constant propagation, arithmetic optimizations and so on. Minifications includes variable rewriting and whitespace trimming.
显然这种手段要求我们的 Shader 代码在构建时是稳定的,然而 L7 使用的 GLSL 模块化方案需要在运行时进行模块拼接,如果在构建时代码片段中包含的变量发生了改写,势必影响运行时的拼接结果。另外 minifier 会校验代码的正确性,不理解我们自定义的模块引入语句 `pragma include 'module'` 是一定会报错的。
以这样的 Shader 为例:
```glsl
#pragma include "project"
void main() {
// 从 project 模块引入方法
project(position);
}
```
执行压缩时会报错:
```bash
$ node_modules/.bin/glsl-minifier -i ./build/example.frag -o ./build/example.min.frag
Error:
(28,2): error: no function with name 'project'
Exiting glsl-minifier!
```
因此要想使用这个终极压缩方案,需要修改 L7 目前的 GLSL 模块化方案,代码拼接不能在运行时而需要在构建时完成。但这样就很难兼顾扩展性,毕竟用户自定义图层的 Shader 代码肯定只有运行时才能拿到。
所以一个折中的办法是在构建时先对 L7 内置图层的 Shader 代码进行模块化处理,得到最终的 GLSL 文本,然后再 minify。同时保留运行时模块化拼接的能力应对用户自定义图层。
## Submodule
使用 Yarn workspaces + Lerna。
### 异步加载 Mapbox
以 L7 Bundler 方式使用时,由于需要在运行时根据用户配置项选择地图底图,会导致构建时需要将全部地图依赖引入,无法进行 TreeShaking。
目前高德地图使用运行时异步加载方式引入,不会导致该问题,但 Mapbox 同样使用 Bundler对于高德用户就多余了。
一个可能的方案是对于 Mapbox 使用 CodeSplitting。在容器首次获取 Mapbox 地图服务时异步加载并缓存。

34858
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -16,6 +16,8 @@
"@babel/preset-typescript": "^7.3.3",
"@commitlint/cli": "^8.1.0",
"@commitlint/config-conventional": "^8.1.0",
"@rollup/plugin-alias": "^2.2.0",
"@rollup/plugin-json": "^4.0.0",
"@storybook/addon-actions": "^5.1.9",
"@storybook/addon-console": "^1.2.1",
"@storybook/addon-info": "^5.1.9",
@ -37,6 +39,8 @@
"babel-plugin-const-enum": "^0.0.2",
"babel-plugin-css-modules-transform": "^1.6.2",
"babel-plugin-inline-import": "^3.0.0",
"babel-plugin-inline-webgl-constants": "^1.0.1",
"babel-plugin-lodash": "^3.3.4",
"babel-plugin-transform-postcss": "^0.3.0",
"babel-preset-gatsby": "^0.2.20",
"clean-webpack-plugin": "^0.1.19",
@ -53,6 +57,7 @@
"geotiff": "^1.0.0-beta.6",
"gh-pages": "^2.1.1",
"gl": "^4.4.0",
"glsl-minifier": "^0.0.13",
"html-webpack-plugin": "^3.2.0",
"husky": "^3.0.9",
"jest": "^24.9.0",
@ -70,6 +75,13 @@
"react-dom": "^16.8.6",
"react-i18next": "^11.0.1",
"rimraf": "^2.6.2",
"rollup": "^1.27.0",
"rollup-plugin-analyzer": "^3.2.2",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-terser": "^5.1.2",
"rollup-pluginutils": "^2.8.2",
"sass-loader": "^7.1.0",
"style-loader": "^1.0.0",
"styled-components": "^3.4.6",
@ -114,7 +126,9 @@
"coveralls": "jest --coverage && cat ./tests/coverage/lcov.info | coveralls",
"tsc": "tsc",
"build:declarations": "lerna exec --stream --no-bail 'tsc --project ./tsconfig.build.json'",
"watch": "lerna exec --parallel 'BABEL_ENV=build babel --watch src --root-mode upward --out-dir dist --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments'"
"watch": "lerna exec --parallel 'BABEL_ENV=build babel --watch src --root-mode upward --out-dir dist --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments'",
"bundle": "NODE_ENV=bundle node_modules/.bin/rollup -c ./build/rollup.config.js",
"glsl-minify": "node_modules/.bin/glsl-minifier -i ./build/example.frag -o ./build/example.min.frag"
},
"workspaces": [
"packages/*",

View File

@ -24,7 +24,7 @@
"@l7/core": "0.0.1",
"@l7/utils": "0.0.1",
"@turf/distance": "^6.0.1",
"eventemitter3": "^3.1.0",
"eventemitter3": "^4.0.0",
"inversify": "^5.0.1",
"inversify-inject-decorators": "^3.1.0",
"inversify-logging": "^0.2.1"

View File

@ -8,7 +8,6 @@ import {
} from '@l7/core';
import { DOM } from '@l7/utils';
import { EventEmitter } from 'eventemitter3';
import { inject } from 'inversify';
export enum PositionType {
'TOPRIGHT' = 'topright',

View File

@ -22,7 +22,7 @@
"@l7/utils": "0.0.1",
"@mapbox/tiny-sdf": "^1.1.1",
"ajv": "^6.10.2",
"eventemitter3": "^3.1.0",
"eventemitter3": "^4.0.0",
"gl-matrix": "^3.1.0",
"hammerjs": "^2.0.8",
"inversify": "^5.0.1",

View File

@ -64,7 +64,8 @@ container
.inSingletonScope();
container
.bind<IStyleAttributeService>(TYPES.IStyleAttributeService)
.to(StyleAttributeService);
.to(StyleAttributeService)
.inRequestScope();
container
.bind<ICameraService>(TYPES.ICameraService)
.to(CameraService)
@ -126,9 +127,11 @@ export const lazyInject = (
// make it work as usual
original.call(this, proto, key);
// return link to proto, so own value wont be 'undefined' after component's creation
descriptor!.initializer = () => {
if (descriptor) {
descriptor.initializer = () => {
return proto[key];
};
}
};
};
export const lazyMultiInject = (
@ -145,10 +148,12 @@ export const lazyMultiInject = (
): void {
// make it work as usual
original.call(this, proto, key);
if (descriptor) {
// return link to proto, so own value wont be 'undefined' after component's creation
descriptor!.initializer = () => {
return proto[key];
};
}
};
};

View File

@ -23,6 +23,8 @@ const bytesPerElementMap = {
[gl.UNSIGNED_SHORT]: 2,
};
let counter = 0;
/**
* Layer
*/
@ -33,6 +35,8 @@ export default class StyleAttributeService implements IStyleAttributeService {
private attributes: IStyleAttribute[] = [];
private c = counter++;
private featureLayout: {
sizePerElement: number;
elements: Array<{

View File

@ -1,7 +1,7 @@
/**
* WebGL
* @see http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
* TODO: 使babel
* 使babel
* @see https://github.com/uber/deck.gl/blob/7.1-release/dev-docs/roadmaps/dist-size-roadmap.md#inline-gl-constants
*/

View File

@ -1,5 +1,3 @@
import { EventEmitter } from 'eventemitter3';
import { IImage } from '../asset/IIconService';
import { ILayer } from '../layer/ILayerService';
import { IMapConfig } from '../map/IMapService';
import { IRenderConfig } from '../renderer/IRendererService';

View File

@ -29,7 +29,7 @@
"d3-color": "^1.4.0",
"d3-scale": "^3.1.0",
"earcut": "^2.2.1",
"eventemitter3": "^3.1.0",
"eventemitter3": "^4.0.0",
"gl-matrix": "^3.1.0",
"gl-vec2": "^1.3.0",
"inversify": "^5.0.1",

View File

@ -186,6 +186,7 @@ export default class AMapService implements IMapService {
style = 'light',
minZoom = 0,
maxZoom = 18,
token = AMAP_API_KEY,
...rest
} = mapConfig;
@ -212,7 +213,7 @@ export default class AMapService implements IMapService {
resolve();
};
const url: string = `https://webapi.amap.com/maps?v=${AMAP_VERSION}&key=${AMAP_API_KEY}&plugin=Map3D&callback=onload`;
const url: string = `https://webapi.amap.com/maps?v=${AMAP_VERSION}&key=${token}&plugin=Map3D&callback=onload`;
this.$jsapi = document.createElement('script');
this.$jsapi.charset = 'utf-8';
this.$jsapi.src = url;

View File

@ -26,8 +26,7 @@ const EventMap: {
camerachange: 'move',
};
import { MapTheme } from './theme';
mapboxgl.accessToken =
'pk.eyJ1IjoieGlhb2l2ZXIiLCJhIjoiY2pxcmc5OGNkMDY3cjQzbG42cXk5NTl3YiJ9.hUC5Chlqzzh0FFd_aEc-uQ';
const LNGLAT_OFFSET_ZOOM_THRESHOLD = 12;
/**
@ -45,7 +44,6 @@ export default class MapboxService implements IMapService {
private markerContainer: HTMLElement;
private cameraChangedCallback: (viewport: IViewport) => void;
private $mapContainer: HTMLElement | null;
private $link: HTMLLinkElement;
// init
public addMarkerContainer(): void {
@ -175,6 +173,7 @@ export default class MapboxService implements IMapService {
id,
attributionControl = false,
style = 'light',
token = 'pk.eyJ1IjoieGlhb2l2ZXIiLCJhIjoiY2pxcmc5OGNkMDY3cjQzbG42cXk5NTl3YiJ9.hUC5Chlqzzh0FFd_aEc-uQ',
...rest
} = mapConfig;
this.$mapContainer = document.getElementById(id);
@ -185,6 +184,7 @@ export default class MapboxService implements IMapService {
* TODO: 使用 mapbox v0.53.x custom layer gl context
* @see https://github.com/mapbox/mapbox-gl-js/blob/master/debug/threejs.html#L61-L64
*/
mapboxgl.accessToken = token;
// @ts-ignore
this.map = new mapboxgl.Map({
container: id,
@ -197,20 +197,13 @@ export default class MapboxService implements IMapService {
// 不同于高德地图,需要手动触发首次渲染
this.handleCameraChanged();
this.$link = document.createElement('link');
this.$link.href =
'https://api.tiles.mapbox.com/mapbox-gl-js/v1.2.1/mapbox-gl.css';
this.removeLogoControl();
this.$link.rel = 'stylesheet';
document.head.appendChild(this.$link);
}
public destroy() {
this.eventEmitter.removeAllListeners();
if (this.map) {
this.map.remove();
document.head.removeChild(this.$link);
this.$mapContainer = null;
}
}

View File

@ -29,7 +29,7 @@
"@turf/meta": "^6.0.2",
"d3-dsv": "^1.1.1",
"d3-hexbin": "^0.2.2",
"eventemitter3": "^3.1.0",
"eventemitter3": "^4.0.0",
"gl-matrix": "^3.1.0",
"inversify": "^5.0.1",
"inversify-inject-decorators": "^3.1.0",

View File

@ -20,7 +20,7 @@
"license": "ISC",
"dependencies": {
"@turf/helpers": "^6.1.4",
"eventemitter3": "^3.1.0",
"eventemitter3": "^4.0.0",
"gl-matrix": "^3.1.0",
"inversify": "^5.0.1",
"inversify-inject-decorators": "^3.1.0",

253
yarn.lock
View File

@ -386,7 +386,7 @@
dependencies:
"@babel/types" "^7.0.0"
"@babel/helper-module-imports@^7.7.0":
"@babel/helper-module-imports@^7.0.0-beta.49", "@babel/helper-module-imports@^7.7.0":
version "7.7.0"
resolved "https://registry.npm.taobao.org/@babel/helper-module-imports/download/@babel/helper-module-imports-7.7.0.tgz#99c095889466e5f7b6d66d98dffc58baaf42654d"
integrity sha1-mcCViJRm5fe21m2Y3/xYuq9CZU0=
@ -1556,7 +1556,7 @@
lodash "^4.17.13"
to-fast-properties "^2.0.0"
"@babel/types@^7.7.0", "@babel/types@^7.7.1", "@babel/types@^7.7.2":
"@babel/types@^7.0.0-beta.49", "@babel/types@^7.7.0", "@babel/types@^7.7.1", "@babel/types@^7.7.2":
version "7.7.2"
resolved "https://registry.npm.taobao.org/@babel/types/download/@babel/types-7.7.2.tgz#550b82e5571dcd174af576e23f0adba7ffc683f7"
integrity sha1-VQuC5VcdzRdK9XbiPwrbp//Gg/c=
@ -3023,6 +3023,11 @@
npmlog "^4.1.2"
write-file-atomic "^2.3.0"
"@luma.gl/constants@^7.3.0-alpha.1":
version "7.3.2"
resolved "https://registry.npm.taobao.org/@luma.gl/constants/download/@luma.gl/constants-7.3.2.tgz#99c5d665f9e6d21192525038e47ec4acfbbbe0a6"
integrity sha1-mcXWZfnm0hGSUlA45H7ErPu74KY=
"@mapbox/geojson-area@0.2.2":
version "0.2.2"
resolved "https://registry.yarnpkg.com/@mapbox/geojson-area/-/geojson-area-0.2.2.tgz#18d7814aa36bf23fbbcc379f8e26a22927debf10"
@ -3256,6 +3261,20 @@
react-lifecycles-compat "^3.0.4"
warning "^3.0.0"
"@rollup/plugin-alias@^2.2.0":
version "2.2.0"
resolved "https://registry.npm.taobao.org/@rollup/plugin-alias/download/@rollup/plugin-alias-2.2.0.tgz#3ac52ece8b39583249884adb90fb316484389fe5"
integrity sha1-OsUuzos5WDJJiErbkPsxZIQ4n+U=
dependencies:
slash "^3.0.0"
"@rollup/plugin-json@^4.0.0":
version "4.0.0"
resolved "https://registry.npm.taobao.org/@rollup/plugin-json/download/@rollup/plugin-json-4.0.0.tgz#4462e83c7ad5544bef4a601a6e8450daedc4b69b"
integrity sha1-RGLoPHrVVEvvSmAaboRQ2u3Etps=
dependencies:
rollup-pluginutils "^2.5.0"
"@samverschueren/stream-to-observable@^0.3.0":
version "0.3.0"
resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f"
@ -3962,7 +3981,7 @@
resolved "https://registry.npm.taobao.org/@types/eslint-visitor-keys/download/@types/eslint-visitor-keys-1.0.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Feslint-visitor-keys%2Fdownload%2F%40types%2Feslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d"
integrity sha1-HuMNeVRMqE1o1LPNsK9PIFZj3S0=
"@types/estree@*":
"@types/estree@*", "@types/estree@0.0.39":
version "0.0.39"
resolved "https://registry.npm.taobao.org/@types/estree/download/@types/estree-0.0.39.tgz?cache=0&sync_timestamp=1572461973040&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Festree%2Fdownload%2F%40types%2Festree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
integrity sha1-4Xfmme4bjCLSMXTKqnQiZEOJUJ8=
@ -4191,6 +4210,13 @@
"@types/prop-types" "*"
csstype "^2.2.0"
"@types/resolve@0.0.8":
version "0.0.8"
resolved "https://registry.npm.taobao.org/@types/resolve/download/@types/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194"
integrity sha1-8mB00jjgJlnjI84aE9BB7uKA4ZQ=
dependencies:
"@types/node" "*"
"@types/semver@^6.0.1":
version "6.2.0"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-6.2.0.tgz#d688d574400d96c5b0114968705366f431831e1a"
@ -4882,7 +4908,7 @@ are-we-there-yet@~1.1.2:
delegates "^1.0.0"
readable-stream "^2.0.6"
argparse@^1.0.7:
argparse@^1.0.10, argparse@^1.0.7:
version "1.0.10"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
@ -5407,6 +5433,13 @@ babel-plugin-inline-import@^3.0.0:
dependencies:
require-resolve "0.0.2"
babel-plugin-inline-webgl-constants@^1.0.1:
version "1.0.1"
resolved "https://registry.npm.taobao.org/babel-plugin-inline-webgl-constants/download/babel-plugin-inline-webgl-constants-1.0.1.tgz#ca81b3e3c3816356a23414a44bf367f51c5b7a89"
integrity sha1-yoGz48OBY1aiNBSkS/Nn9Rxbeok=
dependencies:
"@luma.gl/constants" "^7.3.0-alpha.1"
babel-plugin-istanbul@^5.1.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz#df4ade83d897a92df069c4d9a25cf2671293c854"
@ -5424,6 +5457,17 @@ babel-plugin-jest-hoist@^24.9.0:
dependencies:
"@types/babel__traverse" "^7.0.6"
babel-plugin-lodash@^3.3.4:
version "3.3.4"
resolved "https://registry.npm.taobao.org/babel-plugin-lodash/download/babel-plugin-lodash-3.3.4.tgz#4f6844358a1340baed182adbeffa8df9967bc196"
integrity sha1-T2hENYoTQLrtGCrb7/qN+ZZ7wZY=
dependencies:
"@babel/helper-module-imports" "^7.0.0-beta.49"
"@babel/types" "^7.0.0-beta.49"
glob "^7.1.1"
lodash "^4.17.10"
require-package-name "^2.0.1"
babel-plugin-macros@2.6.1, babel-plugin-macros@^2.0.0, babel-plugin-macros@^2.4.5, babel-plugin-macros@^2.6.1:
version "2.6.1"
resolved "https://registry.npm.taobao.org/babel-plugin-macros/download/babel-plugin-macros-2.6.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbabel-plugin-macros%2Fdownload%2Fbabel-plugin-macros-2.6.1.tgz#41f7ead616fc36f6a93180e89697f69f51671181"
@ -5523,6 +5567,13 @@ babel-plugin-react-docgen@^3.0.0:
react-docgen "^4.1.1"
recast "^0.14.7"
babel-plugin-remove-glsl-comments@^1.0.0:
version "1.0.0"
resolved "https://registry.npm.taobao.org/babel-plugin-remove-glsl-comments/download/babel-plugin-remove-glsl-comments-1.0.0.tgz#62c0910707798a60504b70d09f9e2733ae10fc93"
integrity sha1-YsCRBwd5imBQS3DQn54nM64Q/JM=
dependencies:
minimatch "^3.0.0"
babel-plugin-remove-graphql-queries@^2.7.15:
version "2.7.15"
resolved "https://registry.npm.taobao.org/babel-plugin-remove-graphql-queries/download/babel-plugin-remove-graphql-queries-2.7.15.tgz#d1f9dcf885dfc0141cf3ac203f94050bf0f94ea4"
@ -6267,7 +6318,7 @@ builtin-modules@^1.1.1:
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=
builtin-modules@^3.0.0:
builtin-modules@^3.0.0, builtin-modules@^3.1.0:
version "3.1.0"
resolved "https://registry.npm.taobao.org/builtin-modules/download/builtin-modules-3.1.0.tgz#aad97c15131eb76b65b50ef208e7584cd76a7484"
integrity sha1-qtl8FRMet2tltQ7yCOdYTNdqdIQ=
@ -7812,6 +7863,20 @@ css@^2.2.4:
source-map-resolve "^0.5.2"
urix "^0.1.0"
cssauron-glsl@X.X.X:
version "1.0.0"
resolved "https://registry.npm.taobao.org/cssauron-glsl/download/cssauron-glsl-1.0.0.tgz#9873641442b52bae08b9103f8546885af69c74cc"
integrity sha1-mHNkFEK1K64IuRA/hUaIWvacdMw=
dependencies:
cssauron "~1.0.0"
cssauron@~1.0.0:
version "1.0.0"
resolved "https://registry.npm.taobao.org/cssauron/download/cssauron-1.0.0.tgz#3c9891541075be90ee59c0c2a3d400e4fffec42d"
integrity sha1-PJiRVBB1vpDuWcDCo9QA5P/+xC0=
dependencies:
through X.X.X
csscolorparser@~1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/csscolorparser/-/csscolorparser-1.0.3.tgz#b34f391eea4da8f3e98231e2ccd8df9c041f171b"
@ -9409,6 +9474,11 @@ estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0:
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d"
integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==
estree-walker@^0.6.1:
version "0.6.1"
resolved "https://registry.npm.taobao.org/estree-walker/download/estree-walker-0.6.1.tgz?cache=0&sync_timestamp=1572191010814&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Festree-walker%2Fdownload%2Festree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362"
integrity sha1-UwSRQ/QMbrkYsjZx0f4yGfOhs2I=
esutils@^2.0.0, esutils@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
@ -11434,7 +11504,45 @@ globule@^1.0.0:
lodash "~4.17.10"
minimatch "~3.0.2"
glsl-tokenizer@^2.0.2:
glsl-deparser@^1.0.0:
version "1.0.0"
resolved "https://registry.npm.taobao.org/glsl-deparser/download/glsl-deparser-1.0.0.tgz#5e7eb363ec54af92916ccffc82ed03e9bfe33e0c"
integrity sha1-Xn6zY+xUr5KRbM/8gu0D6b/jPgw=
dependencies:
cssauron-glsl X.X.X
through "~1.1.2"
glsl-min-stream@^1.0.0:
version "1.0.0"
resolved "https://registry.npm.taobao.org/glsl-min-stream/download/glsl-min-stream-1.0.0.tgz#b6bfe6353a42b15b1fac354290cb3551e0582812"
integrity sha1-tr/mNTpCsVsfrDVCkMs1UeBYKBI=
dependencies:
cssauron-glsl X.X.X
shortest "0.0.0"
through "~1.1.2"
glsl-minifier@^0.0.13:
version "0.0.13"
resolved "https://registry.npm.taobao.org/glsl-minifier/download/glsl-minifier-0.0.13.tgz#12c92150f6da4a4f417059ff02ead2b986552fee"
integrity sha1-EskhUPbaSk9BcFn/AurSuYZVL+4=
dependencies:
argparse "^1.0.10"
glsl-deparser "^1.0.0"
glsl-min-stream "^1.0.0"
glsl-parser "^2.0.1"
glsl-tokenizer "^2.1.4"
string-to-stream "^1.1.1"
glsl-parser@^2.0.1:
version "2.0.1"
resolved "https://registry.npm.taobao.org/glsl-parser/download/glsl-parser-2.0.1.tgz#3ffac4ee05cc4d8141fd6b1e41e82b3766ff61b9"
integrity sha1-P/rE7gXMTYFB/WseQegrN2b/Ybk=
dependencies:
glsl-tokenizer "^2.1.4"
through "2.3.4"
through2 "^0.6.3"
glsl-tokenizer@^2.0.2, glsl-tokenizer@^2.1.4:
version "2.1.5"
resolved "https://registry.yarnpkg.com/glsl-tokenizer/-/glsl-tokenizer-2.1.5.tgz#1c2e78c16589933c274ba278d0a63b370c5fee1a"
integrity sha512-XSZEJ/i4dmz3Pmbnpsy3cKh7cotvFlBiZnDOwnj/05EwNp2XrhQ4XKJxT7/pDt4kp4YcpRSKz8eTV7S+mwV6MA==
@ -13001,6 +13109,11 @@ is-jpg@^2.0.0:
resolved "https://registry.npm.taobao.org/is-jpg/download/is-jpg-2.0.0.tgz#2e1997fa6e9166eaac0242daae443403e4ef1d97"
integrity sha1-LhmX+m6RZuqsAkLarkQ0A+TvHZc=
is-module@^1.0.0:
version "1.0.0"
resolved "https://registry.npm.taobao.org/is-module/download/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591"
integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=
is-natural-number@^4.0.1:
version "4.0.1"
resolved "https://registry.npm.taobao.org/is-natural-number/download/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8"
@ -13120,6 +13233,13 @@ is-redirect@^1.0.0:
resolved "https://registry.npm.taobao.org/is-redirect/download/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24"
integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=
is-reference@^1.1.2:
version "1.1.4"
resolved "https://registry.npm.taobao.org/is-reference/download/is-reference-1.1.4.tgz#3f95849886ddb70256a3e6d062b1a68c13c51427"
integrity sha1-P5WEmIbdtwJWo+bQYrGmjBPFFCc=
dependencies:
"@types/estree" "0.0.39"
is-regex@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491"
@ -14552,7 +14672,7 @@ lodash@4.17.14:
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba"
integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==
lodash@4.17.15, lodash@^4.0.0, lodash@^4.0.1, lodash@^4.11.1, lodash@^4.15.0, lodash@^4.16.5, lodash@^4.17.0, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0, lodash@~4.17.10, lodash@~4.17.5:
lodash@4.17.15, lodash@^4.0.0, lodash@^4.0.1, lodash@^4.11.1, lodash@^4.15.0, lodash@^4.16.5, lodash@^4.17.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0, lodash@~4.17.10, lodash@~4.17.5:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
@ -14741,6 +14861,13 @@ macos-release@^2.2.0:
resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-2.3.0.tgz#eb1930b036c0800adebccd5f17bc4c12de8bb71f"
integrity sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==
magic-string@^0.25.2:
version "0.25.4"
resolved "https://registry.npm.taobao.org/magic-string/download/magic-string-0.25.4.tgz#325b8a0a79fc423db109b77fd5a19183b7ba5143"
integrity sha1-MluKCnn8Qj2xCbd/1aGRg7e6UUM=
dependencies:
sourcemap-codec "^1.4.4"
make-dir@^1.0.0, make-dir@^1.2.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c"
@ -15286,7 +15413,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1:
resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=
"minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2:
"minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
@ -19145,7 +19272,7 @@ read@1, read@^1.0.7, read@~1.0.1:
dependencies:
mute-stream "~0.0.4"
"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6:
"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.0, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6:
version "2.3.6"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf"
integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==
@ -19727,6 +19854,11 @@ require-main-filename@^2.0.0:
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b"
integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==
require-package-name@^2.0.1:
version "2.0.1"
resolved "https://registry.npm.taobao.org/require-package-name/download/require-package-name-2.0.1.tgz#c11e97276b65b8e2923f75dabf5fb2ef0c3841b9"
integrity sha1-wR6XJ2tluOKSP3Xav1+y7ww4Qbk=
require-resolve@0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/require-resolve/-/require-resolve-0.0.2.tgz#bab410ab1aee2f3f55b79317451dd3428764e6f3"
@ -19798,7 +19930,7 @@ resolve@1.1.7:
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=
resolve@1.x, resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.12.0, resolve@^1.3.2, resolve@^1.5.0, resolve@^1.8.1:
resolve@1.x, resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.11.1, resolve@^1.12.0, resolve@^1.3.2, resolve@^1.5.0, resolve@^1.8.1:
version "1.12.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6"
integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==
@ -19908,6 +20040,68 @@ rmc-feedback@^2.0.0:
babel-runtime "6.x"
classnames "^2.2.5"
rollup-plugin-analyzer@^3.2.2:
version "3.2.2"
resolved "https://registry.npm.taobao.org/rollup-plugin-analyzer/download/rollup-plugin-analyzer-3.2.2.tgz#1ea109d164ac8cdbfeaacf1cf271bb66ca643d94"
integrity sha1-HqEJ0WSsjNv+qs8c8nG7ZspkPZQ=
rollup-plugin-babel@^4.3.3:
version "4.3.3"
resolved "https://registry.npm.taobao.org/rollup-plugin-babel/download/rollup-plugin-babel-4.3.3.tgz#7eb5ac16d9b5831c3fd5d97e8df77ba25c72a2aa"
integrity sha1-frWsFtm1gxw/1dl+jfd7olxyoqo=
dependencies:
"@babel/helper-module-imports" "^7.0.0"
rollup-pluginutils "^2.8.1"
rollup-plugin-commonjs@^10.1.0:
version "10.1.0"
resolved "https://registry.npm.taobao.org/rollup-plugin-commonjs/download/rollup-plugin-commonjs-10.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frollup-plugin-commonjs%2Fdownload%2Frollup-plugin-commonjs-10.1.0.tgz#417af3b54503878e084d127adf4d1caf8beb86fb"
integrity sha1-QXrztUUDh44ITRJ6300cr4vrhvs=
dependencies:
estree-walker "^0.6.1"
is-reference "^1.1.2"
magic-string "^0.25.2"
resolve "^1.11.0"
rollup-pluginutils "^2.8.1"
rollup-plugin-node-resolve@^5.2.0:
version "5.2.0"
resolved "https://registry.npm.taobao.org/rollup-plugin-node-resolve/download/rollup-plugin-node-resolve-5.2.0.tgz#730f93d10ed202473b1fb54a5997a7db8c6d8523"
integrity sha1-cw+T0Q7SAkc7H7VKWZen24xthSM=
dependencies:
"@types/resolve" "0.0.8"
builtin-modules "^3.1.0"
is-module "^1.0.0"
resolve "^1.11.1"
rollup-pluginutils "^2.8.1"
rollup-plugin-terser@^5.1.2:
version "5.1.2"
resolved "https://registry.npm.taobao.org/rollup-plugin-terser/download/rollup-plugin-terser-5.1.2.tgz#3e41256205cb75f196fc70d4634227d1002c255c"
integrity sha1-PkElYgXLdfGW/HDUY0In0QAsJVw=
dependencies:
"@babel/code-frame" "^7.0.0"
jest-worker "^24.6.0"
rollup-pluginutils "^2.8.1"
serialize-javascript "^1.7.0"
terser "^4.1.0"
rollup-pluginutils@^2.5.0, rollup-pluginutils@^2.8.1, rollup-pluginutils@^2.8.2:
version "2.8.2"
resolved "https://registry.npm.taobao.org/rollup-pluginutils/download/rollup-pluginutils-2.8.2.tgz?cache=0&sync_timestamp=1568405888956&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frollup-pluginutils%2Fdownload%2Frollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e"
integrity sha1-cvKvB0i1kjZNvTOJ5gDlqURKNR4=
dependencies:
estree-walker "^0.6.1"
rollup@^1.27.0:
version "1.27.0"
resolved "https://registry.npm.taobao.org/rollup/download/rollup-1.27.0.tgz?cache=0&sync_timestamp=1573576528242&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frollup%2Fdownload%2Frollup-1.27.0.tgz#7afe0da89c967cec5ccea7e919da6c89a1a68666"
integrity sha1-ev4NqJyWfOxczqfpGdpsiaGmhmY=
dependencies:
"@types/estree" "*"
"@types/node" "*"
acorn "^7.1.0"
rst-selector-parser@^2.2.3:
version "2.2.3"
resolved "https://registry.yarnpkg.com/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz#81b230ea2fcc6066c89e3472de794285d9b03d91"
@ -20405,6 +20599,11 @@ shellwords@^0.1.1:
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==
shortest@0.0.0:
version "0.0.0"
resolved "https://registry.npm.taobao.org/shortest/download/shortest-0.0.0.tgz#dc4c8d0722e7a9208ec7d2098e4cda8cac6e567d"
integrity sha1-3EyNByLnqSCOx9IJjkzajKxuVn0=
sift@^5.1.0:
version "5.1.0"
resolved "https://registry.npm.taobao.org/sift/download/sift-5.1.0.tgz?cache=0&sync_timestamp=1571575345522&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsift%2Fdownload%2Fsift-5.1.0.tgz#1bbf2dfb0eb71e56c4cc7fb567fbd1351b65015e"
@ -20722,6 +20921,11 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1:
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
sourcemap-codec@^1.4.4:
version "1.4.6"
resolved "https://registry.npm.taobao.org/sourcemap-codec/download/sourcemap-codec-1.4.6.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsourcemap-codec%2Fdownload%2Fsourcemap-codec-1.4.6.tgz#e30a74f0402bad09807640d39e971090a08ce1e9"
integrity sha1-4wp08EArrQmAdkDTnpcQkKCM4ek=
space-separated-tokens@^1.0.0:
version "1.1.4"
resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.4.tgz#27910835ae00d0adfcdbd0ad7e611fb9544351fa"
@ -20993,6 +21197,14 @@ string-similarity@^1.2.2:
lodash.map "^4.6.0"
lodash.maxby "^4.6.0"
string-to-stream@^1.1.1:
version "1.1.1"
resolved "https://registry.npm.taobao.org/string-to-stream/download/string-to-stream-1.1.1.tgz#aba78f73e70661b130ee3e1c0192be4fef6cb599"
integrity sha1-q6ePc+cGYbEw7j4cAZK+T+9stZk=
dependencies:
inherits "^2.0.1"
readable-stream "^2.1.0"
string-width@^1.0.1, string-width@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
@ -21647,6 +21859,15 @@ terser-webpack-plugin@1.4.1, terser-webpack-plugin@^1.2.4, terser-webpack-plugin
webpack-sources "^1.4.0"
worker-farm "^1.7.0"
terser@^4.1.0:
version "4.4.0"
resolved "https://registry.npm.taobao.org/terser/download/terser-4.4.0.tgz?cache=0&sync_timestamp=1573407784308&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fterser%2Fdownload%2Fterser-4.4.0.tgz#22c46b4817cf4c9565434bfe6ad47336af259ac3"
integrity sha1-IsRrSBfPTJVlQ0v+atRzNq8lmsM=
dependencies:
commander "^2.20.0"
source-map "~0.6.1"
source-map-support "~0.5.12"
terser@^4.1.2:
version "4.3.9"
resolved "https://registry.yarnpkg.com/terser/-/terser-4.3.9.tgz#e4be37f80553d02645668727777687dad26bbca8"
@ -21728,11 +21949,21 @@ through2@^3.0.0:
dependencies:
readable-stream "2 || 3"
through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@^2.3.8, through@~2.3.4:
through@2, "through@>=2.2.7 <3", through@X.X.X, through@^2.3.4, through@^2.3.6, through@^2.3.8, through@~2.3.4:
version "2.3.8"
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=
through@2.3.4:
version "2.3.4"
resolved "https://registry.npm.taobao.org/through/download/through-2.3.4.tgz#495e40e8d8a8eaebc7c275ea88c2b8fc14c56455"
integrity sha1-SV5A6Nio6uvHwnXqiMK4/BTFZFU=
through@~1.1.2:
version "1.1.2"
resolved "https://registry.npm.taobao.org/through/download/through-1.1.2.tgz#344a5425a3773314ca7e0eb6512fbafaf76c0bfe"
integrity sha1-NEpUJaN3MxTKfg62US+6+vdsC/4=
thunky@^1.0.2:
version "1.1.0"
resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d"