-
Notifications
You must be signed in to change notification settings - Fork 37
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
SWC-7067 #5611
SWC-7067 #5611
Conversation
public class CardConfiguration { | ||
|
||
String type; | ||
double secondaryLabelLimit; |
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.
double secondaryLabelLimit; | |
long secondaryLabelLimit; |
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.
Did something change, I thought long values were disallowed? Or perhaps I'm misunderstanding.
From https://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJSNI.html
The Java long type cannot be represented in JavaScript as a numeric type, so GWT emulates it using an opaque data structure. This means that JSNI methods cannot process a long as a numeric type. The compiler therefore disallows, by default, directly accessing a long from JSNI: JSNI methods cannot have long as a parameter type or a return type, and they cannot access a long using a JSNI reference.
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.
This is JsInterop, not JSNI. However, it seems like double
is the least problematic primitive type for JsInterop. In JsInterop, int
and long
do work; we're using those for properties in other JsInterop types. I cannot find an authoritative document that describes exactly what Java primitives and classes JsInterop supports.
Keeping double is probably fine!
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.
Right! I'm still thinking in JSNI. I guess I'll leave it, for the small potential performance gain
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.
Small primitive type change but overall looks good
No description provided.