Skip to content

Releases: apache/dubbo-js

dubbo2.js@2.1.5

28 Jun 06:42
Compare
Choose a tag to compare
  1. refactor zookeeper.ts and remove _agentMap
  2. dubbo.subscribe({onTrace(msg) => {//...}}) , runtime tracing.
  3. 感谢思元小伙伴pull-request,refactor byte operator.

dubb2.js@2.1.4

20 Jun 07:42
Compare
Choose a tag to compare
  1. 重构代码
  2. fixed bug
  3. 默认只使用一个socket长连接,支持断开自动重连,未来可能会弱化socket-pool

dubbo2.js@2.0.4

12 Jun 07:41
Compare
Choose a tag to compare

issue #7

总算找到了解决这个问题的方案,这个问题的难点不是怎么实现,而是typescript怎么去定义暴露服务类型,给出代码的完美提示。这个还真有点难。但是不去解决这个问题,真的代码写的很炸。

import A from 'A',
import B from 'B'
import c from 'C'
import ... 

const dubbo = new Dubbo({
  interfaces: [
   'A',
   'B',
   'C',
  ......
  ]
});

const a = A(dubbo);
const b = B(dubbo);
const c = C(dubbo);
......

//整合egg
app.dubbo = {
 a,
 b,
c,
......
}

同学们想这个接口规模再提高10x 代码就无法看了,当然代码上有优化的空间,但是痛点就是类型的代码提示,一旦动态就无法精确获得类型提示。

我们的翻译器生成的代码格式基本都是
export xxProvider = (dubbo: Dubbo): XxProvider => dubbo.proxyService({...});

在typescript2.8以后支持了conditional type.可以很好解决我们这个问题。

image

将provider集合起来,然后放入Dubbo中,
image

就可以获取优秀的开发体验

image

enjoy :)

在2.0.4+版本中,我们api不再兼容interfaces参数方式,全面使用service参数。

//注入到dubbo的服务,例如:
const userRequest = (dubbo: Dubbo): IUserRequest => dubbo.proxyService<IUserRequest>({...});
const service = {userRequest};


const dubbo = new Dubbo<typeof service>({
 // ....,other parameters
  service
});

dubbo.service.userRequest.xxx()

更多细节,请参阅 examples或者单元测试。

dubbo2.js@1.0.4

11 Jun 02:56
Compare
Choose a tag to compare
  1. fixed log
  2. 使用const emum instead of enum, less runtime and more performace
  3. reduce hot function

dubbo2js-1.0.3

22 May 09:32
Compare
Choose a tag to compare

[1] zookeeper parseURL 去除多余的decodeURIComponent
[2] scheduler 的dubboInvoke添加availiable socket worker的检测

release dubbo2.js

07 May 02:30
Compare
Choose a tag to compare

fixed typescript types
export Context

dubbo-invoker@1.0.1

07 May 06:30
Compare
Choose a tag to compare

fixed, 如果匹配不上返回null,不去覆盖。

dubbo-invoker@1.0.0

07 May 02:17
4a03957
Compare
Choose a tag to compare

发布npm模块