-
Notifications
You must be signed in to change notification settings - Fork 169
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
Rewrite attach by @Id and template-in-template features #3098
Conversation
8b3ea20
to
8d3b525
Compare
NodeMap map = node.getMap(NodeFeatures.ELEMENT_DATA); | ||
JsonObject object = (JsonObject) map.getProperty(NodeProperties.PAYLOAD) | ||
.getValue(); | ||
private void appendVirtualChild(BindingContext context, StateNode node, |
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.
|
||
private JsonObject getPayload(StateNode node) { | ||
NodeMap map = node.getMap(NodeFeatures.ELEMENT_DATA); | ||
return (JsonObject) map.getProperty(NodeProperties.PAYLOAD).getValue(); | ||
} | ||
|
||
private static Optional<String> extractNodeId(StateNode node) { |
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.
@@ -94,18 +94,6 @@ public static Object decodeWithTypeInfo(StateTree tree, JsonValue json) { | |||
case JsonCodec.NODE_TYPE: { | |||
int nodeId = (int) array.getNumber(1); | |||
Node domNode = tree.getNode(nodeId).getDomNode(); |
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.
JsSet<Function<StateNode, Boolean>> copy = JsCollections | ||
.set(domNodeSetListeners); | ||
copy.forEach(listener -> { | ||
if (listener.apply(this) == Boolean.TRUE) { |
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.
fb34faf
to
8bb7714
Compare
Reviewed 28 of 38 files at r1, 1 of 1 files at r2, 6 of 8 files at r3, 4 of 5 files at r5, 2 of 2 files at r7. flow-client/src/main/java/com/vaadin/client/flow/StateNode.java, line 243 at r6 (raw file):
Should this just be flow-client/src/main/java/com/vaadin/client/flow/binding/SimpleElementBindingStrategy.java, line 599 at r5 (raw file):
Due to the complexity collecting to appendVirtualChild would it be a good idea/possible to move the virtual child binding parts to a util class or such? (not blocking) flow-client/src/main/java/com/vaadin/client/flow/binding/SimpleElementBindingStrategy.java, line 709 at r7 (raw file):
This is not needed as we just return false if we come here. flow-client/src/main/java/com/vaadin/client/flow/util/ClientJsonCodec.java, line 97 at r6 (raw file):
How does flow-client/src/test-gwt/java/com/vaadin/client/flow/GwtBasicElementBinderTest.java, line 759 at r7 (raw file):
Could also have a message that opens assert failure instead of the now uninformative 'expected: 1 actual: N'. flow-server/src/main/java/com/vaadin/flow/nodefeature/VirtualChildrenList.java, line 80 at r6 (raw file):
The flow-server/src/main/java/com/vaadin/flow/nodefeature/VirtualChildrenList.java, line 86 at r6 (raw file):
Mind fixing flow-server/src/main/java/com/vaadin/server/communication/rpc/AttachTemplateChildRpcHandler.java, line 99 at r6 (raw file):
This log marking should perhaps open a bit on why it's severe and add that no response should have come from the client. flow-server/src/main/java/com/vaadin/ui/polymertemplate/TemplateInitializer.java, line 211 at r6 (raw file):
On both counts I would say that it should not be exposed in the API. flow-server/src/test/java/com/vaadin/flow/nodefeature/VirtualChildrenListTest.java, line 41 at r6 (raw file):
the String casts are redundant and not needed. flow-tests/test-root-context/src/main/webapp/frontend/com/vaadin/flow/uitest/ui/template/JsGrandParent.html, line 32 at r6 (raw file):
new line flow-tests/test-root-context/src/main/webapp/frontend/com/vaadin/flow/uitest/ui/template/JsSubTemplate.html, line 32 at r6 (raw file):
new line. Comments from Reviewable |
Review status: all files reviewed at latest revision, 12 unresolved discussions. flow-client/src/main/java/com/vaadin/client/flow/StateNode.java, line 243 at r6 (raw file): Previously, caalador wrote…
Technically it may be But in reality I don't trust GWT compiler with its boxing/unboxing. So I prefer to use the exact type declared in the method return value (did you know e.g. that flow-client/src/main/java/com/vaadin/client/flow/binding/SimpleElementBindingStrategy.java, line 599 at r5 (raw file): Previously, caalador wrote…
I don't like utility classes because of logical spreading. I would like to extract the logic out of the blocks but unfortunately it doesn't improve the code significantly. flow-client/src/main/java/com/vaadin/client/flow/binding/SimpleElementBindingStrategy.java, line 709 at r7 (raw file): Previously, caalador wrote…
Done. flow-client/src/main/java/com/vaadin/client/flow/util/ClientJsonCodec.java, line 97 at r6 (raw file): Previously, caalador wrote…
The same as it had done previously : it should care about this itself. This code has been introduced as a workaround for attach elements which are targets of JS execution. flow-client/src/test-gwt/java/com/vaadin/client/flow/GwtBasicElementBinderTest.java, line 759 at r7 (raw file): Previously, caalador wrote…
Done. flow-server/src/main/java/com/vaadin/flow/nodefeature/VirtualChildrenList.java, line 80 at r6 (raw file): Previously, caalador wrote…
Done. flow-server/src/main/java/com/vaadin/flow/nodefeature/VirtualChildrenList.java, line 86 at r6 (raw file): Previously, caalador wrote…
Done. flow-server/src/main/java/com/vaadin/server/communication/rpc/AttachTemplateChildRpcHandler.java, line 99 at r6 (raw file): Previously, caalador wrote…
Done. flow-server/src/main/java/com/vaadin/ui/polymertemplate/TemplateInitializer.java, line 211 at r6 (raw file): Previously, caalador wrote…
Done. flow-server/src/test/java/com/vaadin/flow/nodefeature/VirtualChildrenListTest.java, line 41 at r6 (raw file): Previously, caalador wrote…
No. flow-tests/test-root-context/src/main/webapp/frontend/com/vaadin/flow/uitest/ui/template/JsGrandParent.html, line 32 at r6 (raw file): Previously, caalador wrote…
Done. flow-tests/test-root-context/src/main/webapp/frontend/com/vaadin/flow/uitest/ui/template/JsSubTemplate.html, line 32 at r6 (raw file): Previously, caalador wrote…
Done. Comments from Reviewable |
SonarQube analysis reported 7 issues Watch the comments in this conversation to review them. 3 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:
|
Reviewed 9 of 9 files at r8. flow-client/src/main/java/com/vaadin/client/flow/StateNode.java, line 243 at r6 (raw file): Previously, denis-anisimov (Denis) wrote…
That's true, but should it then be flow-client/src/main/java/com/vaadin/client/flow/util/ClientJsonCodec.java, line 97 at r6 (raw file): Previously, denis-anisimov (Denis) wrote…
ok. Then it's fine. Comments from Reviewable |
Fix for #3057, #3058.
This change is