On Dec 13, 2009, at 9:25 PM, Ludovic Dubost wrote:
Marius Dumitru Florea a écrit :
Vincent Massol wrote:
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:
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
Can it be added by a user without rebuilding from source?
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.
In this case I would suggest we propose a download of the version with it.
Well I don't know a lot of people who're using it (especially since it's not usable as it is ;)). It seems a lot of overhead for us to maintain a special distribution just for something that should not even supported by the XWiki dev team. Actually I'd like to propose to move it to the sandbox till someone starts working on it again and make it functional (as we do for all other stuff we have). Thanks -Vincent