-
Notifications
You must be signed in to change notification settings - Fork 164
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
feat: use superclass of VadinServlet/Request if possible #9699
Conversation
8754129
to
4803667
Compare
@@ -16,6 +16,8 @@ | |||
package com.vaadin.flow.server.communication; | |||
|
|||
import javax.servlet.ServletContext; | |||
import javax.servlet.ServletRequest; | |||
import javax.servlet.ServletRequestWrapper; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4803667
to
ae688b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution and sorry for the long delay with the review, but this PR basically shows how reluctant people are to comment on PRs that don't explain why changes are proposed. There is no issue open that would explain why this is needed so you need to start with that.
Secondly many of the changes seem like invalid and, sorry for being direct but, a waste of time. Please help me understand why this would be valuable. If not, I think we'll just have to say no thanks this time - I hope you understand.
flow-server/src/main/java/com/vaadin/flow/server/VaadinServlet.java
Outdated
Show resolved
Hide resolved
flow-server/src/main/java/com/vaadin/flow/server/VaadinServletRequest.java
Show resolved
Hide resolved
flow-server/src/main/java/com/vaadin/flow/server/VaadinServletService.java
Show resolved
Hide resolved
flow-server/src/main/java/com/vaadin/flow/server/communication/PushRequestHandler.java
Show resolved
Hide resolved
flow-server/src/main/java/com/vaadin/flow/server/communication/PushRequestHandler.java
Show resolved
Hide resolved
flow-server/src/main/java/com/vaadin/flow/server/communication/PushRequestHandler.java
Show resolved
Hide resolved
flow-server/src/main/java/com/vaadin/flow/server/communication/PushRequestHandler.java
Show resolved
Hide resolved
flow-server/src/main/java/com/vaadin/flow/server/communication/StreamResourceHandler.java
Show resolved
Hide resolved
...-server/src/main/java/com/vaadin/flow/server/communication/WebComponentBootstrapHandler.java
Show resolved
Hide resolved
...-server/src/main/java/com/vaadin/flow/server/communication/WebComponentBootstrapHandler.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we we're to allow having your own VaadinService
then it would be good if there was some sort of test in the project that would make it so that this feature is not accidentally broken.
Now that the reasoning behind the PR is clear, the next question would be about the added value and use case - why do you want to use your own VaadinService ?
(edit: this type of discussions would be better to have in an issue before starting the implementation)
Because of your OSGi approach is not the way how I would expect to handle OSGi and Vaadin. It is kind of "Works with OSGi" and will fit most of people. But really working with And your OSGi bundles also have the wrong license. If you allow others to having an own VaadinService i will add test that force and check ClassCastExceptions. |
I take it you mean with this that there would be a better way for this to work by utilizing declarative services in OSGi. I think this is a direction that we would want to take too and would gladly accept those contributions, but this direction should be taken by first discussing and agreeing on the steps in issues before jumping into implementation - it will be more smooth that way as then we know what is incoming and are more likely to help you get it in instead of need to start by questioning that "why is this code needed". From our perspective, we have to start that way as we're promising to maintain the code for 15 years to users who need that.
Just to be sure - do you mean the commercial license in vaadin/osgi or something else ?
I don't have any objections to this now that I understand the goal. Though, I would rather work together to improve our OSGi support for all instead of enabling people to build their own support. We're gladly willing to give out licenses to those who contribute to it. |
I broken all my contribution in the moment where i had seen that you moved the osgi part to commercial license in vaadin/osgi. Because this was just an private interest a commercial license would not be an option for me and some guyes with the same interests. I will discuss this with them. |
To clarify to myself for later times, this is still waiting for a test to be added that would prevent breaking the "feature" that easily. |
6246f58
to
c4070f7
Compare
i added the wished tests: |
The build failed due to unrelated build agent issues, I'll retrigger it tomorrow and take a look at the test. |
@pleku Could you please retrigger it? |
flow-server/src/main/java/com/vaadin/flow/server/VaadinServlet.java
Outdated
Show resolved
Hide resolved
5d8a31a
to
4bf8142
Compare
forced push to trigger rerun of tests, (last one also did not finished |
Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
4bf8142
to
152aace
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the long delay, I was on winter vacation last week ⛷️
Only couple of small comments and then this would be 🟢
|
||
public class OtherImplementationsTest { | ||
@Test | ||
public void StaticFileServer_Constructor_uses_VadinService() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-blocking nit: typoed Vaadin here and c/p the error to other method names too ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed into Vaadin
|
||
import com.vaadin.flow.server.communication.PushRequestHandler; | ||
|
||
public class OtherImplementationsTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get the test, but at a glance probably most developers will not. Please change the name to CustomVaadinServiceImplementationTest
and maybe add a comment line "Makes sure that a custom vaadin service that is not vaadin servlet service can be used in when desired".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, Thx
Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
SonarQube analysis reported 7 issues Watch the comments in this conversation to review them. 5 extra issuesNote: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:
|
This change causes massive backwards binary compatibility issues with e.g. add-ons compiled against older versions of Vaadin. This happens because method invocations in bytecode are tied to the method return type and not only the method name and parameter types. I would suggest reverting to avoid those issues. Furthermore, I don't even understand the whole point of making this change. If you want to use a custom service implementation together with |
To further elaborate on my previous message, the point is that They're not supposed to be separated from each other. A proper separation would require more thorough architectural considerations rather than only tweaking some return types that happened to get in the way when trying to do something that you're not supposed to even try. |
I don't know why the bot has added the label |
Thanks@pleku , there was a wrong tag in platform repo, so the bot caught the wrong flow release for V19.0.0. i have fixed the issue. |
I cases you are not using the
VaadinServletService
because you ship your own own (Servlet-based)VaadinService
.Then you are, at the moment, not able to use fundamental classes like
VaadinServlet
. This is because they use your VaadinServletService. But you are not using any methods of VaadinServletService because VaadinService is enough. So I suggest to use superclasses if possible.VaadinServletRequest
needs aVaadinServletService
If you have your own VaadinService implementation you can't rely on VaadinServletRequest
ant an the moment you cant use a lot of classes like
VaadinServlet
,PushRequestHandler
,StreamResourceHandler
,WebComponentBootstrapHandler