0%

webpack 是一个用于现代javascript应用程序的静态模块打包工具。

https://webpack.docschina.org/concepts/

入口

指示webpack应该使用哪个模块来作为构建其内部依赖图的开始
默认为./src/index.js
配置

1
2
3
module.exports = {
entry: './path/to/my/entry/file.js',
};
阅读全文 »

学习本文的收益:
1.掌握如何使用V8引擎
2.对于小程序V8 Worker的理解更深刻

阅读全文 »

  • Display
    • display:none或visibility:hidden 隐藏元素
    • inline 块转为内联
    • block 内联转为块
阅读全文 »

没有使用过的关键字

  • abstract
  • instanceof
  • super
  • enum
  • switch
  • export
  • interface
  • synchronized
  • extends
  • this
  • case
  • throw
  • catch
  • final
  • native
  • throws
  • char
  • finally
  • new
  • transient
  • class
  • null
  • package
  • try
  • typeof
  • debugger
  • goto
  • protected
  • default
  • public
  • void
  • delete
  • implements
  • volatile
  • import
  • with
  • static
阅读全文 »

本文介绍c++插件,简单来讲c++插件就是在c层直接调用v8,可以内置一些js api,通过学习nodejs c++插件,忽然灵光一闪,v8中有一个拦截器,虽然没有用过,但是通过这个拦截器应该可以做js的代理吧,今天先来总结nodejs c++插件,后续会继续研究js的代理。

如果你发现下面我讲的东西你不好理解,你可以查看这个目录下的另一篇文章(https://yuque.antfin.com/xiaobao.spf/ad2gcp/sm0sxn),仔细研读,然后再回来查看这边文章,你会发现nodejs c++插件竟然如此简单。

阅读全文 »

API

cluster.js

1
2
const childOrPrimary = 'NODE_UNIQUE_ID' in process.env ? 'child' : 'primary';
module.exports = require(`internal/cluster/${childOrPrimary}`);
阅读全文 »

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const dns = require('dns');

dns.lookup('example.org', (err, address, family) => {
console.log('address: %j family: IPv%s', address, family);
});

dns.resolve4('juneleo.cn', (err, addresses) => {
if (err) throw err;

console.log(`addresses: ${JSON.stringify(addresses)}`);

addresses.forEach((a) => {
dns.reverse(a, (err, hostnames) => {
if (err) {
throw err;
}
console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`);
});
});
});


const dnsArrays = dns.getServers();
dnsArrays.forEach((it) => {
console.log(it)
});
阅读全文 »

原生js

1
2
3
4
5
6
7
8
function fib(n) {
if (n <= 0) return 0;
if (n <= 2) return 1;
return fib(n - 2) + fib(n - 1);
}
const start = Date.now();
console.log(fib(45));
console.log(`cost=${Date.now() - start}`)
阅读全文 »

example.js

1
2
3
const inc = require('./increment').increment;
const a = 1;
console.log(inc(a)); // 2
阅读全文 »

webpack 是一个用于现代javascript应用程序的静态模块打包工具。

阅读全文 »

根据TaskManager中的Task构建方式进行替换Task

源码

DefaultTaskContainer源码

1
2
3
4
5
public <T extends Task> T create(String name, Class<T> type, Action<? super T> configuration) throws InvalidUserDataException {
T task = this.create(name, type);
configuration.execute(task);
return task;
}
阅读全文 »

多项目构建

1
2
3
implementation project(':poseidon')
implementation project(':helper')
implementation project(':cardadapter')
阅读全文 »

一级classpath

1
2
3
4
5
6
7
8
9
10
11
12
com.android.tools.build:gradle:4.1.0
net.sf.proguard:proguard-gradle:6.0.3
com.autonavi.scm:icecream:1.0.7
com.autonavi.scm:milk:1.4.7
com.amap.qa:hibeaver:1.6.1.0
com.amap.android.plugin:asmc:0.1.2
com.autonavi.amap:bestor-gradle-plugin:1.0.5
com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.3
com.android.boost.easyconfig:easyconfig:2.2.10
com.neenbedankt.gradle.plugins:android-apt:1.8
com.autonavi.scm:portal_plugin:1.3.8
com.github.JuneLeo:dependencies-diff:1.1.2
阅读全文 »

3.2.1版本正常主项目的编译流程

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|------------------------------------------------------------------------
| processDebugResources , app|
|------------------------------------------------------------------------
| com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask_Decorated
|------------------------------------------------------------------------
| inputs file|
|-----------------------------------------------------------------
| /Users/juneleo/demo/CardControl/app/build/intermediates/aar_metadata_check/debug
| /Users/juneleo/demo/CardControl/poseidon/build/intermediates/compiled_local_resources/debug/out
| /Users/juneleo/.gradle/caches/transforms-2/files-2.1/0440b26303762a0d09f988d28effd92e/android.support.v7.recyclerview
| /Users/juneleo/.gradle/caches/transforms-2/files-2.1/b9be6620532dc927d1cf2fc250571de2/android.support.design-r.txt
| /Users/juneleo/demo/CardControl/poseidon/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt
| /Users/juneleo/demo/CardControl/app/build/intermediates/res/merged/debug
| /Users/juneleo/demo/CardControl/app/build/intermediates/packaged_manifests/debug
| /Users/juneleo/demo/CardControl/app/build/intermediates/merged_manifests/debug
| /Users/juneleo/Library/Android/sdk/platforms/android-26/android.jar
|-----------------------------------------------------------------
| outputs file|
|-----------------------------------------------------------------
| /Users/juneleo/demo/CardControl/app/build/intermediates/compile_and_runtime_not_namespaced_r_class_jar/debug/R.jar
| /Users/juneleo/demo/CardControl/app/build/intermediates/incremental/processDebugResources
| /Users/juneleo/demo/CardControl/app/build/intermediates/processed_res/debug/out
| /Users/juneleo/demo/CardControl/app/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt
| /Users/juneleo/demo/CardControl/app/build/intermediates/runtime_symbol_list/debug/R.txt
|-----------------------------------------------------------------
阅读全文 »

代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
public abstract class ReplaceTask<T extends Task, S extends Task> {
public ReplaceTask() {
}

public abstract Class<S> getReplaceTaskClass();

public abstract Class<T> getCustomTaskClass();


public void replace(Project project) {
List<Task> replaceTasks = new ArrayList<>();
//1.
for (Task task : project.getTasks()) {
if (task.getClass().getName().startsWith(getReplaceTaskClass().getName())) {
replaceTasks.add(task);
}
}
//2.
for (Task replaceTask : replaceTasks) {
project.getTasks().remove(replaceTask);
}

for (Task replaceTask : replaceTasks) {
//3.
Task task = project.getTasks().create(replaceTask.getName(), getCustomTaskClass());
//4.
task.dependsOn(replaceTask.getDependsOn());
}

}
}

阅读全文 »

背景

什么是ArtifactType?
通过ArtifactType我们可以获取到编译过程中aar包,aar中res,assets,classes,r等各种类型文件的路径,不同的ArtifactType表示不同的资源类型。

阅读全文 »

1
2
3
4
:amap_bundle_miniapp:miniapp-api:generateDebugRFile > 
Resolve files of :amap_bundle_miniapp:miniapp-api:debugCompileClasspath >
dice-11.00.0.316.aar >
14.95 MB/15.52 MB downloaded
阅读全文 »

jvmti 全名jvm tooling interface,可以监控jvm虚拟机,并且可以监控如下事件

阅读全文 »