-
Notifications
You must be signed in to change notification settings - Fork 161
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
Visit classes when passed as argument to methods. #6041
Conversation
Please check #5658 to see if it's resolved or not. |
a7accf9
to
ff5ab45
Compare
c7b4117
to
e7e2098
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.
Does this change catch a situation where the user has, for some reason, a service class. Something like:
public class SomeView extends HorizontalLayoyt {
public SomeView() {
String userId = getUserId();
UserRouteService.registerUserRoute(RouteConfiguration.forSessionScope(), userId);
}
}
public class UserRouteService {
public static void registerUserRoute(RouteConfiguration config, String userId) {
config.setRoute(userId, UserView.class, null);
// some logic
}
}
The example is a bit forced, but regardless: would something like that be caught?
Reviewed 1 of 1 files at r2.
Reviewable status: all discussions resolved, 0 of 1 LGTMs obtained (waiting on @mehdi-vaadin and @ujoni)
This fixes dynamic routes
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.
When SomeView.class
is visited because it's in a route, UserView.class
should be visited as well.
Added a test that demonstrates it
Reviewable status: all discussions resolved, 0 of 1 LGTMs obtained (waiting on @mehdi-vaadin)
e7e2098
to
e93b467
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.
Reviewed 1 of 1 files at r2.
Reviewable status: 3 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @manolo and @mehdi-vaadin)
flow-server/src/test/java/com/vaadin/flow/server/frontend/scanner/ScannerDependenciesTest.java, line 130 at r2 (raw file):
should_visit_Constructor
Method names don't follow the naming convention. It should follow subjectOfTheTest_input_expectedOutput
. E.g. for this case, the name of the method should be like grtFrontendDependencies_viewWithComponentsInCtor_depsShouldBeAdded
.
flow-server/src/test/java/com/vaadin/flow/server/frontend/scanner/ScannerTestComponents.java, line 114 at r2 (raw file):
public RouterLayout1() { }
What's the purpose of this?
flow-server/src/test/java/com/vaadin/flow/server/frontend/scanner/ScannerTestComponents.java, line 125 at r2 (raw file):
public RouterLayout2(String a) { }
What's the purpose of this?
e93b467
to
81d8231
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.
Reviewable status: 3 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @manolo and @mehdi-vaadin)
flow-server/src/test/java/com/vaadin/flow/server/frontend/scanner/ScannerDependenciesTest.java, line 130 at r2 (raw file):
Previously, mehdi-vaadin (Mehdi Javan) wrote…
should_visit_Constructor
Method names don't follow the naming convention. It should follow
subjectOfTheTest_input_expectedOutput
. E.g. for this case, the name of the method should be likegrtFrontendDependencies_viewWithComponentsInCtor_depsShouldBeAdded
.
There are many conventions for test names. I follow the ‘should’ one, the same used in may Vaadin products like Connect, Components, etc
flow-server/src/test/java/com/vaadin/flow/server/frontend/scanner/ScannerTestComponents.java, line 114 at r2 (raw file):
Previously, mehdi-vaadin (Mehdi Javan) wrote…
public RouterLayout1() { }
What's the purpose of this?
Proly constructor was used for some case in the past and left empty after that. Removed but unrelated with this PR
flow-server/src/test/java/com/vaadin/flow/server/frontend/scanner/ScannerTestComponents.java, line 125 at r2 (raw file):
Previously, mehdi-vaadin (Mehdi Javan) wrote…
public RouterLayout2(String a) { }
What's the purpose of this?
Done.
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.
Reviewed 2 of 3 files at r1, 1 of 2 files at r3.
Reviewable status: 3 unresolved discussions, 1 of 1 LGTMs obtained (waiting on @mehdi-vaadin and @ujoni)
flow-server/src/test/java/com/vaadin/flow/server/frontend/scanner/ScannerDependenciesTest.java, line 130 at r2 (raw file):
Previously, manolo (Manuel Carrasco Moñino) wrote…
There are many conventions for test names. I follow the ‘should’ one, the same used in may Vaadin products like Connect, Components, etc
The other tests seems to use should_somethingInCamelCase
. Otherwise I am fine with this.
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.
Reviewed 2 of 2 files at r3.
Reviewable status: complete! all discussions resolved, 2 of 1 LGTMs obtained
Fixes Dynamic Routes #5509
Fixes components instantiated in FactoryBeans #5658
This change is