Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] 自维护 koa-router #3423

Closed
3 tasks done
XadillaX opened this issue Jan 24, 2019 · 8 comments
Closed
3 tasks done

[RFC] 自维护 koa-router #3423

XadillaX opened this issue Jan 24, 2019 · 8 comments

Comments

@XadillaX
Copy link
Member

XadillaX commented Jan 24, 2019

背景

目前 Egg.js 继承的 koa-router 基本上处于维护瘫痪状态,各种特性、PR、Issue 都基本上没人处理了。无法达到很好的一个特性更新的效果。

例如这里有一个 PR 有需要在中间件中用到,但是一直没人响应。

该 PR 目前的作用就是,每执行到一个 Controller 的时候,都能从 ctx 中获取到当前匹配到的路由的路由定义字符串,以供各种解析、判断等用途。例如根据路由规则来实现某种策略。

思路

从现有的 koa-router 进行 Fork,到 eggjs/koa-router-for-egg,名字可以另起。然后在 Egg.js 中从原来的继承自 koa-router 改成继承自新 fork 出来的包。

跟进

@XadillaX
Copy link
Member Author

/cc @killagu

@atian25
Copy link
Member

atian25 commented Jan 24, 2019

直接叫 egg-router 好了,把 app.resource 等方法也抽进去

@XadillaX
Copy link
Member Author

@atian25 先直接 fork 过来,这样可以做到伤筋动骨最少,然后第一个版本出来之后,后续再慢慢改进。

@XadillaX
Copy link
Member Author

ZijianHe/koa-router#494 (comment)

@dead-horse 在询问是否可以把 koa-router 给 transfer 到 koajs 这个 organization 下。这样一来,就不必要再搞一个 egg-router 了。

@atian25
Copy link
Member

atian25 commented Jan 29, 2019

ZijianHe/koa-router@bd78572

fork 吧。

@jas0ncn
Copy link

jas0ncn commented Jan 29, 2019

感谢 Egg 团队努力,是否可以不仅仅修改为 egg-router,依然保持兼容 koa 呢?

@Foveluy
Copy link

Foveluy commented Jan 29, 2019

我估计谈不拢。不行直接 fork 改名得了,省得引发「挖矿事件」。

@dead-horse
Copy link
Member

这个问题不再在这里讨论了。

@eggjs eggjs locked and limited conversation to collaborators Jan 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants