The download package for the _javascript_ client has been updated with
a properly minified version of the code. James has raised a bug on
YUI about the faulty minification.
Ian
On 06/09/2015 11:56 AM, James Sutton1
wrote:
Hi,
The _javascript_ client seems to be
broken
when minified, I've raised a bug here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=469700,
but thought I would pop it on the mailing list as well.
It seems that the YUI Compressor
is
not renaming the Message getters and setters correctly during
compression:
Non- Compressed:
get payloadBytes() { return
this._getPayloadBytes();
},
YUI Compressed:
get payloadBytesfunction()
{
return this._getPayloadBytes()
},
I've tried compressing using
Google
Closure and JSmin and they seem to compress correctly.
Closure Compressed:
get payloadBytes() {
return this._getPayloadBytes()
},
JSmin Compressed:
get payloadBytes() {
return this._getPayloadBytes();
},
Because of this, when you try to publish a
message,
the following error is shown:
Uncaught TypeError: Cannot
read
property 'byteLength' of undefined mqttws31-min.js:15
Paho.MQTT.q.encode mqttws31-min.js:15
Paho.MQTT.v._socket_send mqttws31-min.js:15
Paho.MQTT.v._process_queue mqttws31-min.js:15
Paho.MQTT.v._schedule_message mqttws31-min.js:15
Paho.MQTT.v.send mqttws31-min.js:15
Paho.MQTT.p.send mqttws31-min.js:15
Because it has been renamed to payloadBytesFunction, it does
not work when
the following code is executed:
var F = this.payloadMessage.payloadBytes;
K += F.byteLength;
Is changing the maven build to use closure or
JSMin
the best solution? Or is there something better we could do?
Kind regards,
James Sutton
Software Engineer - IoT Foundation
IBM United Kingdom Limited Registered
in
England and Wales with number 741598 Registered office: PO Box
41, North
Harbour, Portsmouth, Hants. PO6 3AU
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales
with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth,
Hampshire PO6
3AU
_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev
--
Ian Craggs
icraggs@xxxxxxxxxx IBM United Kingdom
Paho Project Lead; Committer on Mosquitto
|