examples icon indicating copy to clipboard operation
examples copied to clipboard

feat: add TypeScript framework-ts example

Open waitingsong opened this issue 7 years ago • 2 comments

need commits of https://github.com/eggjs/egg/pull/2321

Checklist
  • [x] npm test passes
  • [x] tests and/or benchmarks are included
  • [x] documentation is changed or added
  • [ ] commit message follows commit guidelines
Affected core subsystem(s)
Description of change

waitingsong avatar Apr 05 '18 11:04 waitingsong

已知问题

  • route 导入模块 如下图
2018-04-05_195127

如果改为导入框架模块 yadan-ts,就会爆一堆类型错误。如果使用当前的 'egg' 模块,那么应用 app/package.json 又需要引入 egg 不知道是否会导致其他问题?

  "dependencies": {
    "egg": "^2.6.0",
    "egg-scripts": "^2.6.0",
    "yadan-ts": "../yadan"
  },
  • 调用框架服务的类型推断
2018-04-05_200930

目前无法读取到框架 yadan-tsctx.service 的类型,只能使用上图的丑陋定义方法

waitingsong avatar Apr 05 '18 12:04 waitingsong

有空再按照茶叶蛋的规范更新

waitingsong avatar Apr 10 '18 02:04 waitingsong