dragome-sdk icon indicating copy to clipboard operation
dragome-sdk copied to clipboard

Web Worker Support

Open ghost opened this issue 8 years ago • 4 comments

Dragome produced code should also be able to work in a web worker.

ghost avatar Mar 16 '16 08:03 ghost

https://github.com/bertung/dragome-sdk/blob/resources/dragome-web/src/main/java/com/dragome/web/enhancers/jsdelegate/DefaultDelegateStrategy.java

@MethodAlias(alias= "window.getSimpleClassname")

may be replaced with

@MethodAlias(alias= "self.getSimpleClassname") to make it compatible with web workers. Web workers do not have window object.

ghost avatar Jul 05 '16 19:07 ghost

It looks like it is not possible to make Dragome web worker friendly with the use of qxoo library. It has window references all over. I am closing this bug because it looks impracticable to change it.

ghost avatar Jul 05 '16 19:07 ghost

@MethodAlias(alias= "window.getSimpleClassname") is the only usage of MethodAlias that is referencing the Window object, all the other usages are either local aliases or EventDispatcher references. I believe it's really easy to decouple from Window object at least for MethodAlias usages.

fpetrola avatar Jul 05 '16 19:07 fpetrola

It just occured to me. Add the following line of code to the helpers.js, it should solve it all

if(window===undefined)self.window=self;

ghost avatar Jul 05 '16 19:07 ghost