Closed kids-return closed 4 years ago
need to slice the yii-web
public part into a repo
It shares a big pack of similarities since REST functions over HTTP: request/response, headers, content type negotiation etc.
Splitting yii-web
up even further would result in a huge amount of unnecessary work.
Since yii-rest
is also web-related it makes sense as is.
@tomlutzenberger
If we don't separate yii-web
then we can merge yii-rest
into yii-web
, this repo will have no meaning.
So yii-web
also needs to be merged into yii-core
, because yii-web
also depends to yii-core
.
This will cause us to return to the state of yii2.0
. The time during this period is wasted.
We will always cycle between cutting and merging.
I think separation is correct. We should now concentrate all our efforts on solving problems in the process of separation.
for now, we only need to address the dependencies between yi-web
and yi-rest
to implement all the features of yii2.0
.
Reference: https://github.com/yiisoft/yii-project-template/issues/12 https://github.com/yiisoft/yii-web/pull/27
need to slice the
yii-web
public part into a repo
or
yii-web
depend yii-rest
, the generic part is moved to yii-rest
, yii-web
for rewriting
This problem also needs to be solved See: https://github.com/yiisoft/view/issues/6
@samdark @cebe @hiqsol @schmunk42 @SilverFire @klimov-paul @rob006 What do you think? Yii3.0 does not need to consider BC
Separation is fine: REST part isn't needed if you want web only but main reason for it is to make releases, issues and maintenance independent at least to some degree.
@kids-return how would you implement HTTP features needed for REST w/o reusing web part?
yii-rest
, yii-web
depend yii-rest
(this will ensure the minimization of yii-rest
)This is what I can think of now, I will find out if there are other separation schemes.
I prefer the first one.
I am currently being plagued by this problem, I think there should be a lot of repo. Can you help me? https://github.com/yiisoft/db/issues/29
I think variant 3 is fine for now.
this depends on how much yii-web includes asset related stuff.
Pretty much all of it.
Is there a result now?
I found that yii-rest
is increasingly dependent on yii-web
.
If you use scenario 3, we should move the relevant work to this repo as soon as possible.
Currently yii-base-api
is no longer working.
I think we should focus on solving these dependencies first, so that we can avoid a lot of meaningless work.
E.g. yii-base-api
can't work, I have to go to a lot of related repo, check commit, it's painful
I can't fix before I don't know the result. ☹️
I vote for solution 3.
I vote for solution 3.
3, as I said before.
I have started to try the related work, my steps are as follows
step 1
Move the relevant files from yii-web
to ensure that yii-rest
works properly.
step 2
Make yii-web
depend on yii-rest
. Remove unrelated files from yii-web
and make yii-web
difference file extend yii-rest
step 3
Fix file comments related content
step 4
Move and fix tests
step 5
Move and fix docs.
Of course, problems may occur in the process.
But the promotion will be better than the stagnation.
After doing some work, I found that it might be better to separate http
from yii-core
to yii-http
.
Because it is more appropriate to put yii-rest
and yii-web
the same content to yii-http
.
But I want to advance according to the above steps. Other related issues will be discussed at the appropriate time
Wait, wait. By number 3 I've meant rest depends on web, not vice versa.
HTTP is in yii-web currently, not in yii-core.
yii-rest
depends on yii-web
?
Then yii-rest
indirectly depends on view
?
But in most cases yii-rest
does not need to rely on view
!
How to implement api framework
like Lumen
and Slim
How can the current yii-base-api
work properly?
Logically, REST depends on HTTP, PSR-7 request-response, formatters. In reality you need a page with API documentation that is likely to use view.
So it seems separating yii-http could be a good idea.
No matter which method use I only hope that we can move forward,Instead of stagnation. There are many other problems on the way forward. If we don’t advance, we will never find the next problem.
I want to advance according to my ideas. If you end up against it, or have a better plan, then proceed with git reset
.
@samdark
In reality you need a page with API documentation that is likely to use view.
Logically, in this case, you would install and use yii-web, no?
I was understanding 3 the other way around (web would depend on rest), but to be fair, having either one of those libs depend on the other would be weird.
Having yiisoft/yii-http
implementing PSR-7 could be a nicer way to address our present issue. (@rob006 I'm curious, what are your arguments against this?)
I'm curious, what are your arguments against this?
Lack of sufficient arguments in favor of extracting another package. I was already against extracting view
package because there is no real reason to do this ("you may not need some stuff" is not a valid reason for creating another package). Creating yii-http
looks like an escalation of this over-abstracting madness, only to solve a problem which should not exist in the first place :D.
So how do we now need to make yi-rest and yii-base-api work?
How about letting it run first? What do you need to do next? ? ? ? ? ?
We've discussed it with @machour in private and decided that yii-rest should depend on yii-web.
Sorry for getting back and forth, @kids-return.
@samdark if I only wanted to build a REST API and yii-rest
which depends on yii-web
which includes yii-view
, do I need views to implement a REST API?
Ideally, if I only wanted to build a REST API and use Yii as a micro-framework, I am now dependent upon yii-views
.
Sorry to bump this topic, but I was working on the documentation for https://github.com/yiisoft/docs/issues/32 and stumbled upon this dependency issue.
My specific use case is different as I am working on deploying Yii3 with Bref (Lambda) so extra dependencies are hot on my list. Truth be told, this is not a show stopper to include view, but as we add more dependencies my Lambda dependency/size limit gets closer to the max.
This repo is not ready. As for yii-web, https://github.com/yiisoft/yii-web/issues/136
View dependency was not necessary for yii-web. Killed.
Can be closed?
currently
yii-web
is dependview
yii-rest
does not need dependview
I don't think thisrepo
needs to depend onyii-web
.