On Dec 11, 2009, at 12:09 PM, Marius Dumitru
Florea wrote:
> Hi devs,
>
> I'd like to disable the WYSIWYG sync plugin (the one that adds
> experimental support for real time editing) in the WYSIWYG code
> till
> we
> clean and refactor it. The main reason is to reduce the size of the
> JavaScript code generated by GWT:
>
> 641.3 KB when enabled
> 545.2 KB when disabled
>
> The technical explanation:
>
> The sync plugin uses a diff Java library ported by Ludovic to GWT.
> This
> library uses the generic Object class in lots of places.
> Instances of
> classes defined in this library are passed from the client to the
> server
> and back, and so they have to be serialized and deserialized. When
> fields of Object type or List<Object> or Object[] are
> deserialized on
> the client, GWT doesn't know the concrete type and thus generates
> JavaScript code to handle every possibility (i.e. all classes
> implementing IsSerializable tag interface). This increases a lot
> the
> size of the JavaScript code. Here's the warning we get during GWT
> compilation:
>
>
http://pastebin.com/m61aa381f
>
> mainly:
>
> [WARN] In order to produce smaller client-side code, 'Object' is
> not
> allowed; consider using a more specific type
>
> To disable the WYSIWYG syntax plugin I have to comment one line of
> code:
>
> // WysiwygEditorFactory.java
> pfm.addPluginFactory(SyncPluginFactory.getInstance());
>
> and to remove an import. GWT compiles to JavaScript only the code
> that
> is really used.
>
> Here's my +1
>
+1
Right now no, mainly because GWT doesn't support reflection and if a
class is not used at compile time it doesn't appear in the generated
JavaScript code.