Sunday, June 18, 2017

Re: Annoying Map containing List bug

Hi, Ignacio!

Actually, compilation it is pretty fast: 16 minutes in draft mode (during development) and 48 minutes for release (in strict mode with all optimizations), for all 43 modules. I'm considering consolidate all app in 1 module, then it will takes 50 seconds to compile :-O - already tested.

Of course, I've been optimizing everything I can (blacklisting everything I don't need, improving compiler options, improving linker options, hardware and OS combinations) to get into this.

About using NetBens, well, I don't see much difference from free competitors - is more about "ergonomics" (I feel that everything I need is exactly where it should be) and because it is really reliable and stable (ex: no plugin "blows" my installation - everything just works as expected, and new developers start working on day 0). And it works really well in remote desktop environment (where I've only one install serving several developers).

Regards being a GWT bug or not (accepting Object), I believe a JSon serializer would be much easier to work with (and readable)... I hope RPC evolves in future releases, because it is damm fast and reliable.

At least, this annoying "List of enum" bug get fixed... :-)

I would like to use super dev mode, but it seems to not understand my folders layout - and then I can't see the java code, only javascript code. It is a mistery, and I also miss the IDE breakpoints, so I've give up on super dev mode.


Regards,

Edson


Em domingo, 18 de junho de 2017 08:42:17 UTC-3, Ignacio Baca Moreno-Torres escreveu:
Oh, developing with netbeans, using legacy devmode (hosted mode) and using Object with GWT RPC... you really like it hard! hehe so your one permutation draft compilation takes about an hour, isn't it? damn GWT! 😜 I thought that RPC will generate serializers for every subtype of Object, but from the Jens comment looks like it just ignores it in this case, but I bet you use Object in more places, your serializers should be huge! .The last years we have been applying changes to make GWT more lightweight and we have been reducing compilation times even the application have been growing constantly, this also improves debugging experience and app size. Using Object there is against any faster/optimized or even type-safe code, hehe so not saying is a bad idea, just saying it worth finding some alternative 😉.

On Saturday, June 17, 2017 at 8:39:48 PM UTC+2, Edson Richter wrote:
I've found a weird behavior of GWT.
I've a code that communicates with server side via RPC.

The request returns a Map<String, Object> wich runs fine. Until last week, when I spent about 3 days to figure that I can't put a List<Enum> in the map. The problem is not from Server side to Client side, but when the client side try to send the Map back to server side, it throws an error "this$static[signature][2] is not a function", without any clue about the problem.

the server side RPC code is similar to:

public Map<String, Object> getContext() {
  Map<String, Object> myMap = new HashMap<String, Object>();
  List<String> someStrings = new ArrayList<String>();
  List<String> otherStrings = new ArrayList<String>();
  List<SITUACAO> situacoes = new ArrayList<SITUACAO>();

  someStrings.add("Some strings to test");
  otherStrings.add("Other strings to test");
  situacoes.add(SITUACAO.NOVA);
  myMap.put("someString", someStrings);
  myMap.put("otherString", otherStrings);
  myMap.put("someConstant", situacoes);
  return myMap; 
}

The client side receives data, and show a dialog with that data. No error. But when I try to send the map back over the wire, I get the error.

Changing the code to:

public Map<String, Object> getContext() {
  Map<String, Object> myMap = new HashMap<String, Object>();
  List<String> someStrings = new ArrayList<String>();
  List<String> otherStrings = new ArrayList<String>();
  List<String> situacoes = new ArrayList<String>();

  someStrings.add("Some strings to test");
  otherStrings.add("Other strings to test");
  situacoes.add(SITUACAO.NOVA.name());
  myMap.put("someString", someStrings);
  myMap.put("otherString", otherStrings);
  myMap.put("someConstant", situacoes);
  return myMap; 
}

...is a workaround!

In time: before someone try to convince me that a Map<String,Object> is a bad idea, it is working really well - I've a system with about 500.000 lines of code, and I'll not change this.

If you need more details to fix this annoying bug, please let me know.

Regards,

Edson Richter

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment