Minimizing / Uglifying with Google Realtime API

59 views Asked by At

If my code registers a custom realtime type:

gapi.drive.realtime.custom.registerType(MyType, CONST.MY_CUSTOM_TYPE);
// Set the collaborative fields:
MyType.prototype.type = gapi.drive.realtime.custom.collaborativeField('type');
...
// Set the routine to call on initialize:
gapi.drive.realtime.custom.setInitializer(MyType, initializeMyType);

...and initializes it:

function initializeMyType() {
    this.type = 0;
};

When the code is uglified / compressed / minimized etc, the above gets turned into something like this:

gapi.drive.realtime.custom.registerType(A, "MY_TYPE");
A.prototype.B = gapi.drive.realtime.custom.collaborativeField('type');
...
gapi.drive.realtime.custom.setInitializer(A, C);
...
function C() {this.B = 0;};

...so the prototype property 'type' is now known to my code as "B", though collaborativeField is still called with 'type'.

My question is, does this matter? All appears to work, except that when using the realtime debugger I get console warnings asking if I forgot to register my custom types. But the realtime debugger itself appears to work as normal, as does the program as far as I can tell. Am I somehow changing the definition / structure of my realtime model, breaking it for any other user with different property names, or are these property names only used locally?

0

There are 0 answers